ESP32 External Interrupt with functions SPI
Posted: Wed Mar 03, 2021 7:49 pm
Hello.
I have a question. I am developing a project that consists of obtaining the values from the ADE9000 through the spi bus, to process this information with the ESP32 and upload the data to server. I am using the Arduino IDE.
The problem lies in when it occurs an event such as voltage dip and swell. The ADE9000 activates a pin of the ESP32, this produces an interrupt. But to disable this interrupt and get what kind of event has occurs poduced and its value, I need to read and write to a specific register through the spi bus. Therefore I need to use spi transfers inside the interrupt routine.
I want to know what problems this method causes and what solutions I can implement.
I have seen that the people have used binary sempahore, but I want to design a program without operating system based on tasks.
I have a question. I am developing a project that consists of obtaining the values from the ADE9000 through the spi bus, to process this information with the ESP32 and upload the data to server. I am using the Arduino IDE.
The problem lies in when it occurs an event such as voltage dip and swell. The ADE9000 activates a pin of the ESP32, this produces an interrupt. But to disable this interrupt and get what kind of event has occurs poduced and its value, I need to read and write to a specific register through the spi bus. Therefore I need to use spi transfers inside the interrupt routine.
I want to know what problems this method causes and what solutions I can implement.
I have seen that the people have used binary sempahore, but I want to design a program without operating system based on tasks.