Does the CAN-Controller looses messages when interrupts are off?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hallo everyone,

   

I am using a PSoC 5 in a CAN-Network. I would like to turn off the interrupts for a critical section. Will the interrupt of the CAN-controller get lost or will it wait until interrupts are enabled again?

   

Thank you and best regards,

   

HeDo

0 Likes
4 Replies
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

Interrupts happening during a critical section should be triggered properly when that section has ended.

   

The only problem might be that the CAN controller might lose messages if the section takes to long to execute (but the same problem occurs when ISR execution as such takes too long).

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

You may play around with the interrupt priorities to avoid the need for critical sections. When CAN has got the highest priority (lowest number) no message will be lost.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Actually, I would like to store the messages in a list which will be checked and changed in a main loop. I would like to keep it real time.

   

best regards,

   

HeDo

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Data transmission is (even at high rates) comparatively slow compared to the CPU's speed.

   

Since the implementation of CAN is done in real hardware, this will keep on running when interrupts are disabled for a short time. Afaik there will an error-flag raised on an RX overrun, so that you have the chance to at least "see" a transmit error.

   

Storing messages in a list and handling in the main-loop does generally not conflict with other interrupt driven parts of your project.

   

 

   

Bob

0 Likes