Can register definitions, Sending a message, Tx message registers – Lantronix DSTni-EX User Manual

Page 71: Figure 5-1. tx message routing

Advertising
background image

63

CAN Register Definitions

TX Message Registers

To avoid priority inversion issues in the transmit path, three transmit buffers are available with a
built-in priority arbiter. When a message is transmitted, the priority arbiter evaluates all pending
messages and selects the one with the highest priority. The message priority is re-evaluated
after each message abort event such as arbitration loss.

Figure 5-1. TX Message Routing

TxMessage 0

TxMessage 0

TxMessage 0

PRIORITY

ARBITER

CAN Module

uP Bus

CAN BUS

Sending a Message
The following sequence describes how to send a message.

1. Write message into one of the Transmit Message Holding registers TxMessage0/1/2).

2. Request transmission by setting the respective TRX flag. This flag remains set as long as

the message holding registers contains this message. The content of the message buffer
must not be changed while the TRX flag is set.

3. The TRX flags remain set as long as the message transmit request is pending.

4. The successful transfer of a message is indicated by the respective tx_xfer interrupt and by

releasing the TRX flag. Depending on the tx_level configuration settings, an additional
interrupt source tx_msg is available to indicate that the Message Holding registers are
empty or below a certain level.

Removing a Message from a Transmit Holding Register
A message can be removed from one of the three Transmit Holding registers (TxMessage0/1/2)
by setting the TxAbort flag. Use following procedure to remove the contents of a particular
TxMessage buffer:

5. Set TxAbort to request the message removal.

6. This flag remains set as long as the message abort request is pending. It is cleared when

either the message won arbitration (tx_xmit interrupt active) or the message was removed
(tx_xmit interrupt inactive).

Advertising