-->
Page 1 of 1

ADC Sample Rate

PostPosted: Tue Dec 08, 2015 5:25 pm
by John Heath
Hi guys,

I have a custom PCB using an ESP8266-12E to do AP+Station, Config page, NIST, REST, DST, etc. Works great.

Problem is I need to sample at 8KHz and the analogRead() function won't go above 2.5KHz.

pvvx's Web Master has read_adcs(), which samples at 20KHz.

1) How do you get it to compile / work in Arduino?

2) If you run it in Arduino in loop(), how fast does it run?

Re: ADC Sample Rate

PostPosted: Tue Dec 08, 2015 5:52 pm
by martinayotte
Do you means https://github.com/pvvx/esp8266web ?
From what I see in the code, in driver/adc.c, he is using an external I2C ADC, not the ADC from ESP which is only 10 bits and, in fact as you mentioned, limited in sampling rate.
From this code, it is not clear which ADC he is using.
Maybe you should send him a PM.

Re: ADC Sample Rate

PostPosted: Tue Dec 08, 2015 6:01 pm
by John Heath
martinayotte wrote:From what I see in the code, in driver/adc.c, he is using an external I2C ADC, not the ADC from ESP which is only 10 bits and, in fact as you mentioned, limited in sampling rate.


Thank you for your reply. I've learned a lot from your forum posts.

I'm going to contact him and ask whether the ADC is external or on board the ESP.

Re: ADC Sample Rate

PostPosted: Tue Dec 08, 2015 6:18 pm
by martinayotte
I'm sure it is an external I2C ADC, according to https://github.com/pvvx/esp8266web/blob ... iver/adc.c,
but there is no comment which says which one.
Please, when you get the answer from him, post it back here ... ;)