CAN BUS interruption not working

cancel
Showing results for 
Search instead for 
Did you mean: 

CAN BUS interruption not working

Jump to solution
660 Views
rogerferrer
Contributor I

Hello everyone,

 

CAN bus is not working properly in my project (MK10DX256VLH7 microcontroller).

 

I am using processor expert CAN_LDD component (PE.jpg). I copied and modified the example available on Help on component called Sending data frame with interrupt service (main.jpg).

 

It sends the data over and over again. It gets stucked in the while loop. It never triggers the interruption (events.jpg).

The can file done by PE seems correct (can.jpg).

 

I read this thread but I think the solution does not apply to my project.

 

Could someone give me some advice?

 

Thanks in advance.

 

PD: CW 10.6.4

Original Attachment has been moved to: Events.c.zip

Original Attachment has been moved to: CAN0.c.zip

Original Attachment has been moved to: main.c.zip

0 Kudos
1 Solution
417 Views
egoodii
Senior Contributor III

No.

That's the big difference between CAN and UART/SPI-type links.  With UART and SPI you just 'send your bits into the great blue yonder'.  Any proof of 'actual satisfactory delivery' requires firmware efforts at higher layers.  In CAN, this 'assurance of satisfactory delivery' is built directly into the CAN peripherals and bit-layer protocol (as well as full multi-master access-arbitration).  The CAN TX operation will NOT be 'happy' until SOME node gives the ACK, and NOBODY gives a NAK.  Retry is automatic.

That being said, you can of course loop-around and watch the flags to see it sent 'once' and then abort the TX MB.

View solution in original post

0 Kudos
4 Replies
416 Views
egoodii
Senior Contributor III

This issue comes up a lot around here.  Check out my checklist in:

https://community.nxp.com/thread/448467 

417 Views
rogerferrer
Contributor I

Hi Earl,

Thanks! I tried the Loop-Back mode (it ignores the ACK) and it triggered the interruption and went on. But no signal was shown at the CAN pins. I don't know if this is normal.

Is there any way, using only the microcontroller (no more nodes), to send only one frame?

Thanks again!

0 Kudos
418 Views
egoodii
Senior Contributor III

No.

That's the big difference between CAN and UART/SPI-type links.  With UART and SPI you just 'send your bits into the great blue yonder'.  Any proof of 'actual satisfactory delivery' requires firmware efforts at higher layers.  In CAN, this 'assurance of satisfactory delivery' is built directly into the CAN peripherals and bit-layer protocol (as well as full multi-master access-arbitration).  The CAN TX operation will NOT be 'happy' until SOME node gives the ACK, and NOBODY gives a NAK.  Retry is automatic.

That being said, you can of course loop-around and watch the flags to see it sent 'once' and then abort the TX MB.

0 Kudos
416 Views
rogerferrer
Contributor I

Understood!

Thanks.

0 Kudos