In-System CAN error measurement

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

In-System CAN error measurement

1,449 Views
dwhite
Contributor I
MC9S12XDT256
 
I need to measure CAN bus errors (CRC, bit, form, stuff) after my system is installed to verify network integrity.
 
I thought this we be as simple as monitoring the error counter or adding an rx error ISR but now it looks impossible. The docs say I can't read the error counter except in sleep or init modes and the only error interrupt is the status change which will only occur after the error counter goes to 96. Since the error counter decrements with each correct message, this is useless to measure small bit error rates.
 
Can anyone suggest how to measure CAN errors in my application?
Labels (1)
0 Kudos
1 Reply

264 Views
Alban
Senior Contributor II
Hello DWhite,
 
The msCAN module was created with simplicity for the user in mind (almost).
It means that a lot is happening without user/soft intervention.
 
An incorrect frame is just dropped... Unfortunately for you, a lot of CAN modules work like this.
To detect timing problems or CRC, I see the use of timers as almost the only way...
The problem is to have enough memory/speed to deal with the traffic on the bus.
 
With your S12X, you are able to let the XGATE doing all the frame decoding and put it in a RAM buffer.
XGATE could calculate the CRC and check with the one taken.
 
But I don't think this can be achieved only with the msCAN module, you need external help.
 
Hope this helps,
Alban.
0 Kudos