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.
ESP32 External Interrupt with functions SPI
-
- Posts: 9730
- Joined: Thu Nov 26, 2015 4:08 am
Re: ESP32 External Interrupt with functions SPI
You're using an operating system anyway: Arduino is built on ESP-IDF, which is built on FreeRTOS. The other alternative would be to set a volatile variable in the interrupt, then check for that in your main loop and do the SPI transfer.
Who is online
Users browsing this forum: julcol and 49 guests