How to synchronise multiple SPI interupts
Posted: Wed Nov 21, 2018 4:15 pm
Hi,
I read a lot of discussions about SPI interrupts (or ESP32 external interrupts in general), and I wonder if there are guide lines to use multiple sensors with SPI interface working with interrupts.
Practically I use the RFM69 transceiver which generates an interrupts when a RF frame is received. With the current (official) library SPI transfer handling is done in the Interrupt routine itself, which is causing a variety of crashes.
As I understand the OS is also using SPI to access the Memory.
So I did rework this library as the RMF69X (see github) by limiting the SPI interrupt to the setting of a flag and handle the SPI transfer as a normal routine, which looks to be OK (but I didn't really made some extensive tests).
Some people using it claims that in some cases there is a clash with the memory access.
So I am looking for a flag such a "SPI has interrupt" or "SPI has transaction" variables (like ones of the Arduino library), or any form of synchronization method between several asynchronous SPI access and the one used by the OS, to improve the RFM69X library.
Any ideas or explanations are welcome
Thanks in advance
Robert
I read a lot of discussions about SPI interrupts (or ESP32 external interrupts in general), and I wonder if there are guide lines to use multiple sensors with SPI interface working with interrupts.
Practically I use the RFM69 transceiver which generates an interrupts when a RF frame is received. With the current (official) library SPI transfer handling is done in the Interrupt routine itself, which is causing a variety of crashes.
As I understand the OS is also using SPI to access the Memory.
So I did rework this library as the RMF69X (see github) by limiting the SPI interrupt to the setting of a flag and handle the SPI transfer as a normal routine, which looks to be OK (but I didn't really made some extensive tests).
Some people using it claims that in some cases there is a clash with the memory access.
So I am looking for a flag such a "SPI has interrupt" or "SPI has transaction" variables (like ones of the Arduino library), or any form of synchronization method between several asynchronous SPI access and the one used by the OS, to improve the RFM69X library.
Any ideas or explanations are welcome
Thanks in advance
Robert