I would like to request an ADC sample, The system would wait until the modem is ready to sleep, starts a fast read.
Then when the result is ready I would like a callback that will pass on the results.
I don't know if this is possible, but I think it could reduce a lot of overhead when sampling the ADC often.
Also by taking advantage of the modem sleep cycle, maybe the values could be more accurate.
I am currently using the NON-OS SDK version 2.0.0
This process will reduce overhead for CPU but will not be effective for low latency ADC sampling, i.e. the time between you decide to measure a sample and the time when you actually read the ADC will be in micro-seconds. Long lag! But ok for tasks like regular sampling.
If you need to sample the ADC when the system enters automatic sleep mode between Wi-Fi activity, you can create an idle task hook in the RTOS SDK and use that for ADC sampling. I have not tested this but the ESP8266 enters modem sleep when idle task is executed. So that is where you go for the ADC!
Let me know that helps (should work on RTOS SDK).
I would like to stay on the NON OS SDK. Also, I would like to maintain a WiFi connection while reading the ADC. I have tried forcing modem sleep for power savings, I was automatically disconnected from the access point every time. Your post got me thinking about this in a new way.
Since I am asking for a feature, I don't expect this change to be high priority. It would be nice if Espressif developers would consider this request.
I am used to working with 8 bit microcontrollers that generates an interrupt when the ADC finishes an acquisition. I think the ADC is used by the modem when connected to an access point. This would make it risky to control the ADC directly. That is why I am requesting a callback function.
Who is online
Users browsing this forum: No registered users and 1 guest
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
We also have a RTOS version and a MESH version too!
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!