Core with acceptance filtering – Xilinx LogiCORE IP CAN 3.2 User Manual

Page 26

Advertising
background image

26

www.xilinx.com

CAN Getting Started Guide

UG186 April 19, 2010

Chapter 4: Detailed Example Design

Five messages are written in sequence:

1.

The first message is written to the TXHPB and is a standard data frame.

2.

The second message is written to the TX FIFO and is a standard data frame.

3.

The third message is written to the TX FIFO and is a standard remote frame.

4.

The fourth message is written to the TX FIFO and is an extended data frame.

5.

The fifth message is written to the TX FIFO and is an extended remote frame.

After each message is written, the test bench waits for the assertion of the interrupt
line. When the interrupt line is asserted, the following conditions occur:

The bits set in the ISR are displayed.

The RX FIFO is read if the RXOK bit is set. The message received is compared
with the message previously transmitted.

The ICR is written to. This clears the bits in the ISR that are set.

With no acceptance filtering, all five messages are received in the RX FIFO.

Core with Acceptance Filtering

The demonstration test bench performs the following tasks:

Input clock signals are generated.

A reset is applied to the example design.

The Baud Rate Prescalar register and Bit Timing registers are written to. These
registers are read from and the values read are compared with the values written.

The Interrupt Enable Register is written to enable interrupts for TXBFLL and RXOK
bits. This register is read from and the value read is compared with the value written.

Acceptance Filter ID Register 1 and Acceptance Filter Mask Register 1 are written to.
These registers are read from and the values read are compared with the values
written.

The Acceptance Filter Register is written to enable Acceptance Filter pair 1. This
register is read from and the value read is compared with the value written.

The Mode Select Register is written to select Loop Back mode. This register is read
from and the value read is compared with the value written.

The Software Reset Register is written to enable CEN bit. This register is read from
and the value written is compared with the value read.

Five messages are written in a sequence.

1.

The first message is written to the TXHPB and is a standard data frame.

2.

The second message is written to the TX FIFO and is a standard data frame.

3.

The third message is written to the TX FIFO and is a standard remote frame.

4.

The fourth message is written to the TX FIFO and is an extended data frame.

5.

The fifth message is written to the TX FIFO and is an extended remote frame.

After each message is written, the test bench waits for the interrupt line to be asserted.
When the interrupt line is asserted, the following conditions occur:

The bits in the ISR that are set are displayed.

The RX FIFO is read if the RXOK bit is set. The message that is received is
compared with the message that was transmitted.

The ICR is written to. This clears the bits in the ISR that are set.

Advertising