Controller Area Network (FlexCAN)
MPC5510 Microcontroller Family Reference Manual, Rev. 1
Freescale Semiconductor
25-41
Preliminary
25.4.9
Interrupts
The FlexCAN module interrupts are ORed together at the chip level as described in
in
There is an interrupt source for each MB from MB0 to MB15. There is no distinction between Tx and Rx
interrupts for a particular buffer, under the assumption that the buffer is initialized for either transmission
or reception. Each of the buffers has assigned a flag bit in the CANx_IFLAG2 or CANx_IFLAG1
registers. The bit is set when the corresponding buffer completes a successful transmission/reception and
is cleared when the CPU writes it to 1.
A combined interrupt for each of two MB groups, MB16–MB31 and MB32–MB63, is also generated by
an OR of all the interrupt sources from the associated MBs. This interrupt gets generated when any of the
MBs generates an interrupt. In this case the CPU must read the CAN
x_
IFLAG2 and CAN
x_
IFLAG1
registers to determine which MB caused the interrupt.
The other two interrupt sources (bus off/transmit warning/receive warning and error) generate interrupts
like the MB interrupt sources, and can be read from CAN
x
_ESR. The bus off/transmit warning/receive
warning and error interrupt mask bits are located in the CANx_CTRL.
25.4.10 Bus Interface
The CPU access to FlexCAN registers are subject to the following rules:
•
Read and write access to unimplemented or reserved address space results in access error. Any
access to unimplemented MB Rx individual mask register locations results in access error. Any
access to the Rx individual mask register space when the BCC bit in CANx_MCR is negated
results in access error.
•
For a FlexCAN configuration that uses less than the total number of MBs and MAXMB is set
accordingly, the remaining MB and Rx mask register spaces can be used as general-purpose RAM
space. Note that the Rx individual mask registers can only be accessed in freeze mode, and this is
still true for unused space within this memory. Note also that reserved words within RAM cannot
be used. As an example, suppose FlexCAN is configured with 64 MBs and MAXMB is
programmed with zero. The maximum number of MBs in this case becomes one. The MB memory
starts at 0x0060, but the space from 0x0060 to 0x007F is reserved (for SMB usage), and the space
from 0x0080 to 0x008F is used by the one MB. This leaves us with the available space from
0x0090 to 0x047F. The available memory in the mask registers space would be from 0x0884 to
0x097F. Byte, word, and long word accesses are allowed to the unused MB space.
NOTE
Unused MB space must not be used as general purpose RAM while
FlexCAN is transmitting and receiving CAN frames.
25.5
Initialization and Application Information
This section provides instructions for initializing the FlexCAN module.