cancel
Showing results for 
Search instead for 
Did you mean: 

Polling or Interrupt better for CAN-FD reception

VPras
Associate II

Hi,

I have brought a new Nucleo-H743ZI kit. I wanted to receive data from 5 nodes using CAN-FD which transmits at the rate of 5mbps. which is the best method to use Polling or interrupt to receive the data over CAN-FD??

Note: each node send 30 kilobytes of data every second

Thanks,

Vimal

1 REPLY 1
Danish1
Lead II

All methods have their advantages and disadvantages.

Interrupts are harder to code and understand. But they allow the microcontroller to get on with "other things" while at the same time as being ready for the next CAN message to arrive.

What "other things" might I be talking about? Although each node might send a small amount of data then leave a large gap before the next chunk, there is nothing that stops a second node from sending its data immediately after data just came in from the first node. You might want to print out the information from each node, write it to a memory-card or something else. If you're polling, you are unable to receive the second node's stuff until you have finished printing (or whatever) and you'll lose the message (ok so CAN can cause lost messages to be re-sent, but you don't want that to happen unnecessarily). But with interrupts the next message can come in at the same time as you're processing the first one.

Hope this helps,

Danish