English
Language : 

SH7059 Datasheet, PDF (568/1042 Pages) Renesas Technology Corp – 32-Bit RISC Microcomputer
17. Controller Area Network-II (HCAN-II)
17.7.5 Message Receive Sequence
Figure 17.11 shows the message receive sequence.
HCAN
End of arbitration field
Idle
End of frame
CAN bus
Valid CAN-ID received
Loop (N=31; N>0; N=N-1)
N=N-1
Compare ID with
mailbox[n] + LAFM[N]
(if MBC is set for reception)
Yes
No
ID
No
matched?
Yes
N=0?
Yes
Store mailbox-number[N]
and go back to idle state
Valid CAN frame received
Incorrect
Check MBC/
LAFM/CAN-ID
Correct
RXPR[N] (RFPR[N])
=1?
No
Yes
Yes: OverWrite
No: OverRun
NMC[N]
=1?
• Store message by overwriting
• Set UMSR
• Set IRR9 (if MBIMR[N]=0)
• Generate interrupt signal
(if IMR9=0)
Interrupt signal
• Reject message
• Set UMSR
• Set IRR9 (if MBIMR[N]=0)
• Generate interrupt signal
(if IMR9=0)
Interrupt signal
• Store message
• Set RXPR[N] (RFPR[N])
• Set IRR1(IRR2) (if MBIMR[N]=0)
• Generate interrupt signal
(if IMR1(IMR2)=0)
Interrupt signal
Read
IRR1(IRR2)=0
Read RXPR[N]
(RFPR[N])=0
Write 1 to RXPR[N]
(RFPR[N])
Read mailbox[N]
Read RXPR[N]
(RFPR[N])=1
Yes
IRR1(IRR2) No
=1?
Reinterrupt
monitoring
Read IRR
CPU receive interrupt
Figure 17.11 Message Receive Sequence
When the HCAN recognizes the end of the arbitration field during receiving of a message, it starts comparing the received
ID to the IDs set in the mailboxes, starting from mailbox 31 down to mailbox 0. It first checks the MBC if it is configured
as a receive box, and reads LAFM, and reads the CAN-ID of mailbox 31 to finally compare them to the received ID. If it
does not match, the same check takes place at mailbox 30 (if configured as a receive box). Once the HCAN finds a
matching ID, it stores the number of mailbox n into an internal buffer, stops the search, and goes back to the idle state,
waiting for the end of frame (EOF) to come. When an EOF is notified by the CAN interface logic, the HCAN reads the
MBC, LAFM, and CAN-ID of mailbox n to confirm the matching condition again (i.e., there has been no modification to
the configuration of mailbox n). This re-confirmation guarantees the data consistency even when a mailbox is reconfigured
during receiving a message. If it still matches, then the message is written to or abandoned, depending on the setting of the
NMC bit. If it is written to the corresponding mailbox, including the CAN-ID, i.e., there is a possibility that the CAN-ID is
overwritten by a different CAN-ID of the received message due to the LAFM used. This also implies that, if the ID of a
received message matches the ID + LAFM of 2 or more mailboxes, the higher numbered mailbox will always store the
relevant messages and the lower numbered mailbox will never receive messages. Therefore, the settings of the IDs and
LAFMs need to be carefully made.
Rev.3.00 Mar. 12, 2008 Page 478 of 948
REJ09B0177-0300