lpcware

LPC11C24 can on-chip error handler

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by signumx on Mon May 14 12:13:25 MST 2012
Hi,

I'm using the CAN on-chip api and everything is working fine when I start my system.  I want to be able to detect and handle errors if, for instance, the communication cable to my module is cut.  When I test that, I can see that the CAN_error callback function is called the first time (by inserting a breakpoint in that function).  I plug my cable back, the communication restarts but if I remove it again, the CAN_error is never called again.

I thought of resetting the CANSTAT register but I'm apparently not allowed to  do so.  I also tried to call the initCan function inside the error handler but it does not help.  How do I either reinitialize the error flags or the whole CAN controller?

Thank you,
Jeff

Outcomes