How do the error counters work?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How do the error counters work?

4,121件の閲覧回数
lpcware
NXP Employee
NXP Employee

Every CAN controller has two error counters, one for transmit and one for receive. These error counters
are nearly always made available to read by firmware and when certain events happen there are usually
flags in registers and interrupts that can be triggered to notify firmware.
On every failed receive of a frame the receive counter is increased and on every successful receive it is
decreased. On every failed transmit of a frame the transmit counter is increased and on every successful
transmit it is decreased.
If either counter reaches 127 then the CAN controller enters “error passive” state. This means it cannot transmit error frames as potentially it has an internal problem, and that problem will be disrupting communications on the bus. Also, there will be a larger gap between consecutive sent messages to allow for other communication to happen and not “clog” the bus.
If the transmit error counter reaches 256 then the CAN controller enters “bus off” state. It cannot send frames onto the bus. Typically a complete re-initialization of the CAN controller is required to exit this state.

"FAQ contribution from Embedded Systems Academy, experts in CAN bus. For more information visit www.esacademy.com"

ラベル(1)
  • CAN

タグ(1)
0 件の賞賛
返信
0 返答(返信)