Open JohnKozell opened 1 month ago
I my experience, I have not had luck using hardware interrupts with the MCP2515 and an ATmega328. The issue I run into is the MCP2515 will hold /INT active until the receive buffers are empty. That means the interrupt routine would need to check the state of /INT before exiting. I have also experienced issues with the edge based triggering some interrupt peripherals want instead of an explicit state to trigger the interrupt. The RP2040 has more than enough speed over the ATmega328 I use with the MCP2515, so I would expect a well written interrupt routine to be possible with it.
Using the set_mask_filter_recv.ino example with CANBUS RP2040 board, I do not see the interrupt callback being fired, despite relaxing the receive filters. However, if I modify the loop to use the checkReceive() instead, I can detect the message and process it with the readMsgBuf().
Is there some other pre-condition or configuration I need to perform, prior to attachInterrupt()?