Download Print this page

Renesas M16C/50 Series User Manual page 649

Advertisement

M16C/5L Group, M16C/56 Group
23.6.1
Reception
Figure 23.43 shows an operation example of data frame reception in overwrite mode.
This example shows the operation of overwriting the first message when the CAN module receives two
consecutive CAN messages that matches the receiving conditions of the C0MCTL0 register.
SOF
CAN bus
RECREQ
INVALDATA
NEWDATA
MSGLOST
CAN0
reception
complete
interrupt
RECST
CAN0 error
interrupt
RECREQ, INVALDATA, NEWDATA, MSGLOST: Bits in the C0MCTLj register (j = 0 to 31)
RECST: Bit in the C0STR register
Figure 23.43 Operation Example of Data Frame Reception in Overwrite Mode
(1) When a SOF is detected on the CAN bus, the RECST bit in the C0STR register is set to 1
(reception in progress) if the CAN module has no message ready to start transmission.
(2) The acceptance filter procedure starts at the beginning of the CRC field to select the receive
mailbox.
(3) After a message has been received, the NEWDATA bit in the C0MCTLj register (j = 0 to 31) for the
receive mailbox is set to 1 (new data being updated/stored in the mailbox). The INVALDATA bit in
the C0MCTLj register is set to 1 (message is being updated) at the same time, and then the
INVALDATA bit is set to 0 (message valid) again after the complete message is transferred to the
mailbox.
(4) When the interrupt enable bit in the C0MIER register for the receive mailbox is 1 (interrupt
enabled), the CAN0 reception complete interrupt request is generated. This interrupt is generated
when the INVALDATA bit is set to 0.
(5) After reading the message from the mailbox, the NEWDATA bit needs to be set to 0 by a program.
(6) In overwrite mode, if the next CAN message has been received into a mailbox whose NEWDATA
bit is still set to 1, the MSGLOST bit in the C0MCTLj register is set to 1 (message has been
overwritten). The new received message is transferred to the mailbox. The CAN0 reception
complete interrupt request is generated the same as in (4).
R01UH0127EJ0110 Rev.1.10
Sep 01, 2011
Receive message in mailbox 0
CRC
ACK
Acceptance filtering
Receive message in mailbox 0
EOF
IFS SOF
Acceptance filtering
23. CAN Module
CRC
ACK
EOF
Page 612 of 803
IFS

Advertisement

loading