SPRADP4 February   2025 AM620-Q1 , AM623 , AM625 , AM625-Q1 , AM62A3 , AM62A3-Q1 , AM62A7 , AM62A7-Q1 , AM62P , AM62P-Q1 , AM67 , AM68A , AM69A , DRA821U , TDA4AEN-Q1 , TDA4AH-Q1 , TDA4AL-Q1 , TDA4AP-Q1 , TDA4VE-Q1 , TDA4VEN-Q1 , TDA4VH-Q1 , TDA4VL-Q1 , TDA4VM , TDA4VM-Q1 , TDA4VP-Q1

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Introduction
  5. 2MCAN Features
  6. 3MCAN Software Configuration
    1. 3.1 Filter Configuration
    2. 3.2 Transmitter Delay Compensation
    3. 3.3 MCAN Bit Timing Parameters
  7. 4Debug Tips to Resolve MCAN Communication Issues
    1. 4.1 Debugging the MCAN Hardware
    2. 4.2 Debugging using MCAN registers
      1. 4.2.1 MCAN Protocol Status Register
      2. 4.2.2 MCAN Error Counter Register
    3. 4.3 Understanding MCAN applications in TI SDKs
      1. 4.3.1 MCU PLUS SDK
      2. 4.3.2 Linux SDK
      3. 4.3.3 MCAL SDK
      4. 4.3.4 PDK
    4. 4.4 Other Common Issues
  8. 5Related FAQs
  9. 6Summary
  10. 7References

MCAN Error Counter Register

When the node sends an error frame or flag, this keeps the track of this status in a buffer register.

CAN controller is has two registers namely TEC and REC.

  1. Transmit Error Counter Register (TEC): Which counts the number of transmission errors detected on the frames that the ECU sends. Transmit Error Counter, values between 0 and 255.

  2. Receive Error Counter Register (REC): Which counts the number of reception errors detected on the frames that the ECU receives. Receive Error Counter, values between 0 and 127.

Whenever any node detects an error and sends an error frame, the node increases the counter value. If there is a successful message after an error flag, then the node decreases the counter value. The increase or decrease of TEC or REC counter value depends if the error happened in Transmitter ECU or receiver ECU. There are several rules governing how these counters are incremented or decremented.

A CAN node can be possibly in one of the three error states:

  1. Error Active State: In this state both of the error counters are less than 128 (REC < 128 and TEC < 128). This takes part fully in bus communication and signals an error by the transmission of an active error frame. This consists of a sequence of 6 dominant bits followed by 8 recessive bits, all other nodes respond with the appropriate error flag, in response to the violation of the bit stuffing rule.
  2. Error Passive State: A node goes into an error passive state if at least one of the error counters is greater than 127 ((TEC > 127 | REC > 127) and TEC <= 255). This still takes part in bus activities, but sends a passive error to the frame, and only on errors. Furthermore, an error passive node has to wait an additional time (Suspend Transmission Field, 8 recessive bits after Intermission Field) after transmission of a message, before the node can initiate a new data transfer.
  3. Bus-Off State: If the Transmit Error Counter of the CAN controller exceeds 255 (TEC > 255), then the node goes into the bus off state. The node is disconnected from the bus (using internal logic) and does not take part in the bus activities anymore. To reconnect the protocol controller, a bus-off recovery sequence has to be executed. This usually involves the re-initialization and configuration of the CAN controller by the host system, after which the node waits for 128 * 11 recessive bit times before commencing further communication.