
SPRS094I APRIL 1999 REVISED SEPTEMBER 2003
42
POST OFFICE BOX 1443
HOUSTON, TEXAS 772511443
controller area network (CAN) module (continued)
CAN controller architecture
Figure 8 shows the basic architecture of the CAN controller through this block diagram of the CAN Peripherals.
Temporary Receive Buffer
Data
ID
CAN Module
Control Logic
CPU Interface/
Memory Management Unit
CAN
Core
Control/Status Registers
Interrupt Logic
Control Bus
Acceptance Filter
Transmit Buffer
RAM 48x16
CANRX
CANTX
CAN
Transceiver
Matchid
CPU
mailbox 0
mailbox 1
mailbox 2
mailbox 3
mailbox 4
mailbox 5
R
R
T/R
T/R
T
T
Figure 8. CAN Module Block Diagram
The mailboxes are situated in one 48-word x 16-bit RAM. It can be written to or read by the CPU or the CAN.
The CAN write or read access, as well as the CPU read access, needs one clock cycle. The CPU write access
needs two clock cycles. In these two clock cycles, the CAN performs a read-modify-write cycle and, therefore,
inserts one wait state for the CPU.
Address bit 0 of the address bus used when accessing the RAM decides if the lower (0) or the higher (1)
16-bit word of the 32-bit word is taken. The RAM location is determined by the upper bits 5 to 1 of the address
bus.
Table 8 shows the mailbox locations in RAM. One half-word has 16 bits.
CAN interrupt logic
There are two interrupt requests from the CAN module to the peripheral interrupt expansion (PIE) controller:
the mailbox interrupt and the error interrupt. Both interrupts can assert either a high-priority request or a
low-priority request to the CPU. Since CAN mailboxes can generate multiple interrupts, the software should
read the CAN_IFR register for every interrupt and prioritize the interrupt service, or else, these multiple
interrupts will not be recognized by the CPU and PIE hardware logic. Each interrupt routine should service all
the interrupt bits that are set and clear them after service.