Usage; Receive Messages; Figure 5.1 Flowchart Of Message Reception - Toshiba TXZ+ Series Reference Manual

Hide thumbs Also See for TXZ+ Series:
Table of Contents

Advertisement

5. Usage

5.1. Receive Messages

Figure 5.1 shows an example flowchart of message reception using the CANx reception completion interrupt
(INTCANxRXD).
Setup a mailbox for
message reception
Disable mailbox:
set [CANxMC]<MCn> to "0"
Configure mailbox for
reception:
set [CANxMC]<MDn> to "1"
Setup mailbox identifier
and [CANxMBnID]<IDE> bit
for Standard ID or extended ID
Set
[CANxMBnID]<GAME_LAME>
of the mailbox if necessary
Setup [CANxLAM]<LAM> /
[CANxGAM]<GAM>
If necessary
Enable interrupts:
set [CANxMBIM]<MBIMn>
to
1
"
"
Enable mailbox:
set [CANxMC]<MCn> to "1"
End of setup
It is also possible to use polling instead of receive interrupts. In this case, the "waiting for INTCANxRXD" in
above flowchart must be replaced by polling [CANxRMP]. Further, enabling interrupts and clearing
[CANxMBRIF] must be removed from the flow.
Yes
New setup for
the mailbox?
Check [CANxRMP]<RMPn> or
Data has become inconsistent
Yes

Figure 5.1 Flowchart of Message Reception

48 / 52
Receiving messages
No
No
Wait for
INTCANxRXD
Yes
[CANxMBRIF]<MBRIFn>
to determine the mailbox
Read out the mailbox
No
[CANxRML]<RMLn> = 1?
Yes
reading it out!
Clear [CANxRMP]<RMPn>,
this clears also <RMLn>
Read Out Mailbox again
No
[CANxRML]<RMLn> = 1?
TXZ+ Family
CAN Controller
Clear [CANxMBRIF]<MBRIFn>
and
return from interrupt
service routine
Special user tasks
Clear [CANxRMP]<RMPn>,
this clears also
[CANxRML]<RMLn>
2020-10-01
Rev. 1.0

Advertisement

Table of Contents
loading

Table of Contents