38.5.13 Transmit State Diagram

Figure 38-11 describes how messages are queued for transmission. It illustrates how the most important transmit flags are set and cleared:
  1. Messages are queued for transmission by setting the TXREQ flag.
  2. The transmit priority will be determined. The FIFO or TXQ with the highest priority TXPRIx flag will be selected. The index of the TX message in the FIFO or TXQ will be calculated.
  3. The TX message is pending for transmission.
  4. Transmission can only start when the bus is Idle.
  5. A pending transmission can only be aborted before SOF is transmitted.
  6. During the transmission of a message, the CAN Protocol module checks for the following:
    1. Loss of arbitration during the arbitration field.
    2. Transmit errors.
  7. In case a message of a TX FIFO or the TXQ is transmitted successfully, the TXREQ will only be cleared after all messages of the FIFO are transmitted. After the transmission of any message, the status flags of the FIFO or TXQ are updated. In case STEF (CxCON[19]) is set, the message will be stored into the TEF and a timestamp will be attached if enabled.
  8. In case arbitration is lost, TXLARB of the TX FIFO or TXQ will be set and the device will switch over to receiving the message (see 38.8 Message Reception).
  9. In case an error is detected during the transmission of a message, an error frame will be transmitted and the appropriate error flags will be set. Messages will be retransmitted according to 38.5.9 Retransmission Attempts.
Figure 38-11. Transmit State Diagram