Page 1 of 1

Using I2S_NUM_1 for Multi Channel ADC sampling

Posted: Tue Sep 29, 2020 11:30 am
by Kamlaa
Hi everyone :)
I just got the code working for using an ADC together with I2S. I used ESP-IDF 4.0 because versions > 4.0 don't seem to support the code I found. (User ESP_houwenxiang on https://www.esp32.com/viewtopic.php?t=2346#p37378). With some changes in the rtc_module.c I got it working for both ADCs.

Both ADCs with up to five channels seem to work perfectly fine when using I2S_NUM_0. But when I start using I2S_NUM_1 it either blocks or returns wrong values (wrong values = constant 3.3V). I saw that only I2S_NUM_0 supports DAC function (https://docs.espressif.com/projects/esp ... s/i2s.html), so my guess is that this may apply to the ADC functions as well. Is this true?

My goal use both ADCs with I2S to measure 10 channels "simultaneously". I need I2S to get higher SPS. My Code is mostly based ESP_houwenxiang' - see link above.

Thanks!

Re: Using I2S_NUM_1 for Multi Channel ADC sampling

Posted: Thu Oct 01, 2020 9:57 am
by Kamlaa
I think I found the reason:
Besides, only I2S0 supports on-chip DAC/ADC modes, as well as
receiving and transmitting PDM signals. (12.1 I2S Overview)
(https://www.mouser.com/pdfdocs/ESP32-Tech_Reference.pdf). From what I can tell this means that doing any sampling with any ADC and I2S1 won't work.

Only hope would be that I2S0 is somehow able to read from ADC1 and ADC2 at the same time.
Given that I found a different solution I will stop working on this...

I will use this chance to appeal to any ESP_Dev reading this: Please add some example code for ADC I2S sampling for the suitable ESP-IDF version. It took many many days and hundreds of google searches to find the code by ESP_houwenxiang (https://www.esp32.com/viewtopic.php?t=2346#p37378), which (once found) worked perfectly fine.

This does not mean you are not doing enough :) While going through all the posts and topics I only found great support!