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
Solved! Go to Solution.
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.
This issue comes up a lot around here. Check out my checklist in:
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!
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.
Understood!
Thanks.