ESP8266 ADC read nonblocking
Talla Brian Monde wrote 05/08/2020 at 19:41 • 1 pointHello , is there a function or some codes to do an ADC read non blocking operation on an ESP8266 ? i need your help
Hello , is there a function or some codes to do an ADC read non blocking operation on an ESP8266 ? i need your help
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.
adc.cpp: https://pastebin.com/Vy6ityx8
adc.h: https://pastebin.com/fGQb03FA
Using arduino. Manage to sample with 24kHz. Wifi disabled. Using SPI to transfer to a Wifi-Enabled esp.
Are you sure? yes | no
I2S + DMA is what you're looking for. See @Simon Merrett's reference above.
You might find this article useful: https://www.toptal.com/embedded/esp32-audio-sampling
He shows how to setup a dedicated sampling task outside of your main loop, with several key optimizations. He also peels apart the standard analog_read function to make it possible to sample from a timer interrupt. Should be able to do the same with the esp8266 core.
Also, if switching to an ESP32 is an option, you might find some of my demos useful, from this project: https://hackaday.io/project/170710-esp32-tnc-and-audio-relay-for-hfvhf-packet-radio
Are you sure? yes | no
Thanks i have used esp32 for ADC Read nonblocking and it has worked very well but esp32 is more expensive so i wanted to do same with the 8266 core . The link does not go thanks.
Are you sure? yes | no
As far as I know, the SDK does not support non-blocking ADC operation. And since there are no register definitions for the ADCs in the official reference manual, the only way to get this to work would be by digging through the SDK assembly.
In short, as far as I know it's (more or less) impossible.
Are you sure? yes | no
I see . The assembly will be a very hard coconut to crack thanks Daniel.
Are you sure? yes | no
https://www.esp8266.com/viewtopic.php?f=13&t=2134
Any help?
Are you sure? yes | no