SPI with(in) interrupts on ESP8266
Posted: Tue Apr 23, 2019 5:38 am
Hi all! Im new to this forum aswell as with the ESP8266.
I've encountered a problem with the arduino SPI library in combination with the ESP8266.
I've read the SPI library should be compatible with the ESP. But some functions are appearantly missing. For instance SPI.usingInterrupt().
" 'class SPIClass' has no member named 'usingInterrupt' " is the message I get from the compiler. I would be really greatful if someone could tell me if there is a solution for such problems, and how to implement it?
The context is that I try to write sensor data to a SD card. Ive tried to call my writeToSD- funktion from the main loop, but for that to work I seem to need to reinitiate the SPI (SPI.begin() ) in my writeToSD() and turn interrupts off with noInterrupts() . But that is messing up my sample frequency of course. The strange thing is that the interrupt sequence seem to messing with the SPI in such way that I have to reinitiate it between the interrupts.
Thats when I though I could store the data from within the interrupt - function itself. But for that I need the SPI.usingInterrupt().
I would really appriciate any ideas how to solve this. And why are some functions missing in the arduino SPI-library, that are supposed to be there according to this link for example: https://github.com/esp8266/Arduino/issues/1943
I've encountered a problem with the arduino SPI library in combination with the ESP8266.
I've read the SPI library should be compatible with the ESP. But some functions are appearantly missing. For instance SPI.usingInterrupt().
" 'class SPIClass' has no member named 'usingInterrupt' " is the message I get from the compiler. I would be really greatful if someone could tell me if there is a solution for such problems, and how to implement it?
The context is that I try to write sensor data to a SD card. Ive tried to call my writeToSD- funktion from the main loop, but for that to work I seem to need to reinitiate the SPI (SPI.begin() ) in my writeToSD() and turn interrupts off with noInterrupts() . But that is messing up my sample frequency of course. The strange thing is that the interrupt sequence seem to messing with the SPI in such way that I have to reinitiate it between the interrupts.
Thats when I though I could store the data from within the interrupt - function itself. But for that I need the SPI.usingInterrupt().
I would really appriciate any ideas how to solve this. And why are some functions missing in the arduino SPI-library, that are supposed to be there according to this link for example: https://github.com/esp8266/Arduino/issues/1943