- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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