EasyManuals Logo

Texas Instruments TMS320 2833 Series User Manual

Texas Instruments TMS320 2833 Series
868 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #792 background imageLoading...
Page #792 background image
eCAN Configuration
www.ti.com
792
SPRUI07March 2020
Submit Documentation Feedback
Copyright © 2020, Texas Instruments Incorporated
Controller Area Network (CAN)
13.7.2.1 Configuring a Mailbox for Transmit
To transmit a message, the following steps need to be performed (in this example, for mailbox 1):
1. Clear the appropriate bit in the CANTRS register to 0:
Clear CANTRS.1 = 0 (Writing a 0 to TRS has no effect; instead, set TRR.1 and wait until TRS.1
clears.) If the RTR bit is set, the TRS bit can send a remote frame. Once the remote frame is sent, the
TRS bit of the mailbox is cleared by the CAN module. The same node can be used to request a data
frame from another node.
2. Disable the mailbox by clearing the corresponding bit in the mailbox enable (CANME) register.
Clear CANME.1 = 0
3. Load the message identifier (MSGID) register of the mailbox. Clear the AME (MSGID.30) and AAM
(MSGID.29) bits for a normal send mailbox (MSGID.30 = 0 and MSGID.29 = 0). This register is usually
not modified during operation. It can only be modified when the mailbox is disabled. For example:
1. Write MSGID(1) = 0x15AC0000
2. Write the data length into the DLC field of the message control field register (MSGCTRL.3:0). The
RTR flag is usually cleared (MSGCTRL.4 = 0).
3. Set the mailbox direction by clearing the corresponding bit in the CANMD register.
4. Clear CANMD.1 = 0
4. Set the mailbox enable by setting the corresponding bit in the CANME register
Set CANME.1 = 1
This configures mailbox 1 for transmit mode.
13.7.2.2 Transmitting a Message
To start a transmission (in this example, for mailbox1):
1. Write the message data into the mailbox data field.
2. Set the corresponding flag in the transmit request register (CANTRS.1 = 1) to start the transmission of
the message. The CAN module now handles the complete transmission of the CAN message.
3. Wait until the transmit-acknowledge flag of the corresponding mailbox is set (TA.1 = 1). After a
successful transmission, this flag is set by the CAN module.
4. The TRS flag is reset to 0 by the module after a successful or aborted transmission (TRS.1 = 0).
5. The transmit acknowledge must be cleared for the next transmission (from the same mailbox).
a. Set TA.1 = 1
b. Wait until read TA.1 is 0
6. To transmit another message in the same mailbox, the mailbox RAM data must be updated. Setting
the TRS.1 flag starts the next transmission. Writing to the mailbox RAM can be half-word (16 bits) or
full word (32 bits) but the module always returns 32-bit from even boundary. The CPU must accept all
the 32 bits or part of it.
13.7.2.3 Configuring Mailboxes for Receive
To configure a mailbox to receive messages, the following steps must be performed (in this example,
mailbox 3):
1. Disable the mailbox by clearing the corresponding bit in the mailbox enable (CANME) register.
Clear CANME.3 = 0
2. Write the selected identifier into the corresponding MSGID register. The identifier extension bit must be
configured to fit the expected identifier. If the acceptance mask is used, the acceptance mask enable
(AME) bit must be set (MSGID.30 = 1). For example:
Write MSGID(3) = 0x4F780000
3. If the AME bit is set to 1, the corresponding acceptance mask must be programmed.
Write LAM(3) = 0x03C0000.
4. Configure the mailbox as a receive mailbox by setting the corresponding flag in the mailbox direction
register (CANMD.3 = 1). Make sure no other bits in this register are affected by this operation.

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments TMS320 2833 Series and is the answer not in the manual?

Texas Instruments TMS320 2833 Series Specifications

General IconGeneral
BrandTexas Instruments
ModelTMS320 2833 Series
CategoryController
LanguageEnglish

Related product manuals