![Texas Instruments TMS320x281 series Reference Manual Download Page 75](http://html1.mh-extra.com/html/texas-instruments/tms320x281-series/tms320x281-series_reference-manual_1095203075.webp)
3.3.2 Answering a Remote Request
3.3.3 Updating the Data Field
3.4
Interrupts
www.ti.com
Interrupts
3. Set the CANTRS flag for that mailbox. Since the mailbox is configured as receive, it only sends a
remote request message to the other node.
Set CANTRS.3 = 1
4. The module stores the answer in that mailbox and sets the RMP bit when it is received. This action
can initiate an interrupt. Also, make sure no other mailbox has the same ID.
Wait for RMP.3 = 1
5. Read the received message.
1. Configure the object as as a transmit mailbox.
2. Set the auto answer mode (AAM) (MSGID.29) bit in the MSGID register before the mailbox is enabled.
MSGID(1) = 0x35AC0000
3. Update the data field.
MDL, MDH(1) = xxxxxxxxh
4. Enable the mailbox by setting the CANME flag to 1.
CANME.1 = 1
When a remote request is received from another node, the TRS flag is set automatically and the data
is transmitted to that node. The identifier of the received message and the transmitted message are
the same.
After transmission of the data, the TA flag is set. The CPU can then update the data.
Wait for TA.1 = 1
To update the data of an object that is configured in auto answer mode, the following steps need to be
performed. This sequence can also be used to update the data of an object configured in normal
transmission with TRS flag set.
1. Set the change data request (CDR) (MC.8) bit and the mailbox number (MBNR) of that object in the
master control register (CANMC). This tells the CAN module that the CPU wants to change the data
field. For example, for object 1:
Write MC = 0x0000101
2. Write the message data into the mailbox data register. For example:
Write CANMDL(1) = xxxx0000h
3. Clear the CDR bit (MC.8) to enable the object.
Write MC = 0x00000000
There are two different types of interrupts. One type of interrupt is a mailbox related interrupt, for example,
the receive-message-pending interrupt or the abort-acknowledge interrupt. The other type of interrupt is a
system interrupt that handles errors or system-related interrupt sources, for example, the error-passive
interrupt or the wake-up interrupt. See
.
The following events can initiate one of the two interrupts:
•
Mailbox interrupts
–
Message reception interrupt: a message was received
–
Message transmission interrupt: a message was transmitted successfully
–
Abort-acknowledge interrupt: a pending transmission was aborted
–
Received-message-lost interrupt: an old message was overwritten by a new one (before the old
message was read)
–
Mailbox timeout interrupt (eCAN mode only): one of the messages was not transmitted or received
within a predefined time frame
•
System interrupts
–
Write-denied interrupt: the CPU tried to write to a mailbox but was not allowed to
–
Wake-up interrupt: this interrupt is generated after a wake up
SPRU074F – May 2002 – Revised January 2009
eCAN Configuration
75