
CHAPTER 19 CAN CONTROLLER
Preliminary User’s Manual U16541EJ1V0UM
668
19.9 Message Reception
19.9.1
Message reception
In all the operational modes of the CAN module, when a data frame is received, whether the received data frame
has to be stored in one of the message buffers that satisfy the following conditions is checked.
The message buffer has to be assigned to receive data frames (MA0 bit set (1) in C0MCONFm register)
The message buffer has to be configured as a receive message buffer (MT[2:0] bit string in C0MCONFm register
has to hold the values 001B, 010B, 011B, 100B or 101B)
The message buffer has to be marked ready for CAN protocol processing (RDY bit set (1) in C0MCTRLm register)
When two or more message buffers of the CAN module receive a message, the message (data frame or remote
frame) is always stored in the receive message buffer with the highest priority.
For example, when an unmasked receive message buffer and a message buffer linked to mask 0 have the same
identifier, the message is always stored in the unmasked receive message buffer even if this unmasked receive
message buffer has already received a message earlier (DN flag is set already).
Priority
Conditions
1 (highest)
Unmasked message buffer
2
Message buffer linked to mask 1
3
Message buffer linked to mask 2
4
Message buffer linked to mask 3
5 (lowest)
Message buffer linked to mask 4
19.9.2
Receive history list function
The receive history list (RHL) function records the number of the receive message buffer in which each data frame
or remote frame was stored. The RHL consists of 23 elements and two pointers, the last in-message pointer (LIPT
pointer) with the corresponding C0LIPT register and the receive history list get pointer (RGPT pointer) with the
corresponding C0RGPT register.
After the transition from INIT mode to one of the operational modes, the RHL
elements contain undefined values.
The LIPT pointer is utilized as a write pointer for the message buffer numbers stored in the RHL. Anytime a data
frame or remote frame is stored, a message buffer number is recorded to the RHL element. The LIPT pointer points
to this element. The LIPT pointer is incremented automatically when new elements are entered in the RHL. In this
way, the number of message buffers that received new messages recently will be recorded chronologically.
The RGPT pointer is utilized as a read pointer for message buffer numbers stored in the RHL. The RGPT pointer
points to the first RHL element that the CPU did not read yet. A stored message buffer number is read by reading the
C0RGPT register. The RGPT pointer is incremented automatically each time a message buffer number is read from
the C0RGPT register.
The receive history list pointer match bit (RHPM bit) in the C0RGPT register is set (1) whenever the RGPT pointer
matches the LIPT pointer. The RHPM bit set (1) signals to the application software that no more message frames
have been received. When a new message buffer number is recorded, the LIPT pointer is incremented again, and
the RHPM bit is cleared (0). In other words, the message buffer numbers that are stored in RHL indicate unread
message buffers.
The receive history list overflow bit (ROVF bit) is set (1) from the CAN module whenever the LIPT pointer points to
the RGPT pointer-1. In this state, the RHL is completely filled with message buffer numbers that have not been read
yet. When further reception of messages occurs, the last record in RHL is overwritten by the buffer number of the