CAN Notes (3) the error status

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/qq_32618327/article/details/100512550


1. error status species

Unit is always in one of three states


1.1 Proactive error status

Active error state is a normal state can participate in bus communication

Unit is in the active state error when an error is detected , the output error flag active


1.2. Passive error state

Passive error state is easy to cause the wrong status

Although the cell is able to participate in a passive bus error state of a communication
, but not to interfere with other communication units, not actively transmitting error notification is received

Unit in a passive state, even when an error is detected an error
while the other unit is in the active state, if an error did not find an error, the entire bus also considered no error

When the cell is in a passive state error is detected an error, the error flag output passive

Further, in a passive unit in an error state after the transmission is not immediately start sending again
before the start of the next transmission, you must insert "delayed delivery," at an interval of frame period (8 recessive bits)


1.3. Bus-off state

Bus-off state on the bus can not participate in the communication state of
the reception and transmission of information is prohibited


Conversion 1.4. Three states

These states rely on the transmission error count and the reception error counter managed
determines which state to enter the count value, and the relationship between the count value of the error state as follows:

Unit error status Transmission error counter value (TEC) Receive error counter (REC)
False positives state And 0 to 127 And 0 to 127
Passive error state Or 128 to 255 Or 128 to 255
Bus-off state 256~∞ -

The relationship is as follows:
Here Insert Picture Description


2. The error count

Change transmission error count value and the reception error occurrence count based on certain conditions

A receive and transmit data simultaneously satisfies a plurality of conditions may
error counter starts counting at the first site of the time the error condition flags

Error count change conditions in the following table:

And transmitting changes in condition for receiving the error count Transmission error counter value (TEC) Receive error counter (REC)
Receiving means detecting an error - +1
Error flag receiving unit after completion of transmission, the first bit of the detected dominant level - +8
When the transmitting unit outputs an error flag +8 -
When transmitting unit transmitting the active error flag or overload flag bit errors detected +8 -
When the receiving unit transmits an active error flag or overload flag bit errors detected - +8
When after each unit from the active error flag, overload flag 14 detected the beginning of consecutive dominant bits, each detected eight consecutive dominant bits +8 +8
Upon detection of consecutive dominant bits 8 bits after passive error flag added +8 +8
(ACK is returned when the end of the data transmission unit transmits normally . 1 when the end of the frame and also no error is detected) -1; TEC = 0 ± 0 when -
At the end of the receiving unit receives data normally (the CRC 2 no error is detected and when a normal return ACK) - When 1≤REC≤127 -1; REC = 0 when ± 0; when REC> 127 = 127
Unit in a bus off state, detected 128 11 consecutive recessive bits =0 =0

Reference:
"CAN Primer"


Related Recommendation:
CAN Notes (2) CAN features
CAN Notes (1) CAN Introduction


Thank you!


  1. ACK: Acknowledge character (confirmed character) is sent to acknowledge receipt of the data is correct ↩︎

  2. CRC: Cyclic Redundancy Check (CRC) for error detection or error may occur after the check data transmitted or stored ↩︎

Guess you like

Origin blog.csdn.net/qq_32618327/article/details/100512550