Functional Description
791
SLAU723A – October 2017 – Revised October 2018
Copyright © 2017–2018, Texas Instruments Incorporated
Controller Area Network (CAN) Module
identifier. Use the MXTD and MDIR bits to specify whether to use XTD and DIR for acceptance
filtering. A value of 0x00 enables all messages to pass through the acceptance filtering. Also note that
for these bits to be used for acceptance filtering, they must be enabled by setting the UMASK bit in the
CANIFnMCTL register.
4. For a 29-bit identifier:
a. Configure ID[15:0] in the CANIFnARB1 register for bits [15:0] of the message identifier.
b. Configure ID[12:0] in the CANIFnARB2 register for bits [28:16] of the message identifier.
c. Set the XTD bit to indicate an extended identifier.
d. Set the DIR bit to indicate transmit.
e. Set the MSGVAL bit to indicate that the message object is valid.
5. For an 11-bit identifier:
a. Disregard the CANIFnARB1 register.
b. Configure ID[12:2] in the CANIFnARB2 register for bits [10:0] of the message identifier.
c. Clear the XTD bit to indicate a standard identifier.
d. Set the DIR bit to indicate transmit.
e. Set the MSGVAL bit to indicate that the message object is valid.
6. In the CANIFnMCTL register:
a. Optionally set the UMASK bit to enable the mask (MSK, MXTD, and MDIR specified in the
CANIFnMSK1 and CANIFnMSK2 registers) for acceptance filtering.
b. Optionally set the TXIE bit to enable the INTPND bit to be set after a successful transmission.
c. Optionally set the RMTEN bit to enable the TXRQST bit to be set on the reception of a matching
remote frame allowing automatic transmission.
d. Set the EOB bit for a single message object.
e. Configure the DLC[3:0] field to specify the size of the data frame. Take care during this
configuration not to set the NEWDAT, MSGLST, INTPND, or TXRQST bits.
7. Load the data to be transmitted into the CAN IFn Data (CANIFnDA1, CANIFnDA2, CANIFnDB1,
CANIFnDB2) registers. Byte 0 of the CAN data frame is stored in DATA[7:0] in the CANIFnDA1
register.
8. Program the number of the message object to be transmitted in the MNUM field in the CAN IFn
Command Request (CANIFnCRQ) register.
9. When everything is properly configured, set the TXRQST bit in the CANIFnMCTL register. When this
bit is set, the message object is available to be transmitted, depending on priority and bus availability.
Setting the RMTEN bit in the CANIFnMCTL register can also start message transmission if a matching
remote frame has been received.
11.3.5 Updating a Transmit Message Object
The CPU may update the data bytes of a Transmit Message Object any time using the CAN Interface
Registers and neither the MSGVAL bit in the CANIFnARB2 register nor the TXRQST bits in the
CANIFnMCTL register need to be cleared before the update.
Even if only some of the data bytes are to be updated, all four bytes of the corresponding CANIFnDAn /
CANIFnDBn register must be valid before the content of that register is transferred to the message object.
Either the CPU must write all four bytes into the CANIFnDAn / CANIFnDBn register or the message object
is transferred to the CANIFnDAn / CANIFnDBn register before the CPU writes the new data bytes.
To only update the data in a message object, the WRNRD, DATAA, and DATAB bits in the CANIFnMSKn
register are set, followed by writing the updated data into CANIFnDA1, CANIFnDA2, CANIFnDB1, and
CANIFnDB2 registers, and then the number of the message object is written to the MNUM field in the
CAN IFn Command Request (CANIFnCRQ) register. To begin transmission of the new data as soon as
possible, set the TXRQST bit in the CANIFnMSKn register.