I've done some extensive googling but haven't found any kind of proper documentation. Is it possible to use i2s with the built-in ADC on an esp8266 to sample audio? And if so: any sample code on how to do so?

  • What do you mean by using i2s with the ADC? Do you mean you want to turn the ESP8266 into an I2S audio ADC to sample audio and send it out to some other I2S device? Why waste an ESP8266 on this (especially as the ADC is utter rubbish)? – Majenko Aug 6 '19 at 9:39
  • I want to use the built in adc and use i2s to get a constant sampling rate, as I'm going to just need it for beat detection. (if you have any other suggestion how to get a constant sampling rate, i'm really up for it. determining how many microseconds have passed (which was suggested to me before) is not really one of them :/ – Julian Finn Aug 6 '19 at 13:52
  • Just use a timer. I'm not that up on the internals of the ESP8266's peripherals, but most MCUs allow you to use a timer as the sample trigger to the ADC, then a "conversion complete" interrupt to get the data. – Majenko Aug 6 '19 at 14:08
  • As far as I can tell, the ESP8266 Timer only uses Microseconds, that's not fast enough :/ – Julian Finn Aug 6 '19 at 16:25
  • No, the ESP8266 timers use the clock frequency. 80MHz by default, which is a resolution of 12ns – Majenko Aug 6 '19 at 16:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.