13
13.6.3 Reading Out Received Data Frames
The following describes the procedure for reading out received data frames from the slot.
(1) Clearing the TRFIN (Transmit/Receive Finished) bit
Write H'4E, H'40 or H'00 to the CAN Message Control Register (C0MSLnCNT) to clear the
TRFIN bit to 0. After this write, the slot operates as follows:
Value written to
C0MSLnCNT
H'4E
H'40
H'00
Note 1: If message-lost check by the ML bit is needed, write H'4E to the C0MSLnCNT register as
you clear the TRFIN bit.
Note 2: If you clear the TRFIN bit by writing H'4E, H'40 or H'00, it is possible that new data will be
stored in the slot while still reading a message from the slot.
(2) Reading out from the message slot
Read out a message from the message slot.
(3) Checking the TRFIN (Transmit/Receive Finished) bit
Read the CAN Message Control Register to check the TRFIN (Transmit/Receive Finished) bit.
When TRFIN (Transmit/Receive Finished) bit = 1
It means that new data was stored in the slot while still reading out from the slot in (2). In this
case, the data read out in (2) may contain an indeterminate value. Therefore, reexecute
beginning with clearing of the TRFIN (Transmit/Receive Finished) bit in (1).
When TRFIN (Transmit/Receive Finished) bit = 0
It means that the CAN module finished reading out from the slot normally.
Slot operation after write
Operates as a data frame receive slot.
Overwrite can be verified by ML bit.
Operates as a data frame receive slot.
Overwrite cannot be verified by ML bit.
The slot stops transmit/receive operation.
13-67
CAN MODULE
13.6 Receiving Data Frames
Ver.0.10