EmbeddedRelated.com
Forums

can bus error handle

Started by Peter Kic January 7, 2009
Hi!!

I'm using lpc2378 and I have a problem with can bus. Sometimes
happends that CAN bus is locked. I thought this happend because of lpc
bug - "In a Data Overrun condition, the CAN controller is locked from
further message reception", but I monitor this with IRQ and this in
not a reason. I notice that I have a lot of Receive errors (I get IRQ
Error Status).

How to control, if it's loocked? If it's detected that, than must be
done soft reset and works. Soo how to detect if is locked?

Any body write a procedure for can bus errors?

Best regards
Peter

An Engineer's Guide to the LPC2100 Series

First of all you need understand why you have those errors...

When the number of errors exceeds certain predefined (and programmable)
limit, CAN controller goes into "off-bus" state. This can be detected
in the MOD register. So, the approach I am using:

1. When error is detected, log the details for future analysis.

2. Check, if controller still operational (MOD.RM = 0). If so, exit
from interrupt. Dependently on your network configuration, the message
will or will not be re-transimitted.

3. If MOD.RM = 1, restart controller.

I do not have a lot of experiance with can bus. I just used example
from keil for MCB2300 and little change it. Now I'm looking datasheet
and I notice can bus can run in different modes.

Before I starts study and testing modes, could you tell me, which mode
to use? When to use FULLCAN mode?

I have system with one can bus where is in a moment in 100-300ms can
be cca 60-100 incomming and cca 25-50 outgoing massages.

Now works ok, saometimes I get some errors.

Best regards
Peter Kic