Bug in adc_set_clk_div() : Clock for adc1 is fixed

alejol
Posts: 2
Joined: Tue Sep 20, 2022 11:34 pm

Bug in adc_set_clk_div() : Clock for adc1 is fixed

Postby alejol » Wed Sep 21, 2022 12:13 am

I use ESP32 board in the Arduino IDE.
I try to sample channels using ADC1. Need fast analog to digital conversion inside a timer interrupt routine.

First, i have used Arduino's analogRead() function. This takes about 80 microseconds per conversion.
Then, i used adc1_get_raw(ADC1_CHANNEL_0). This work a bit faster, 42 microseconds.

Then, when try to use analogSetClockDiv(clockDiv) or adc_set_clk_div(clockDiv) nothing changes, the conversion takes the same time.
No matter what value clockDiv has.

I think is a bug in Espressif files .

Maybe someone can tell me how to change the clock of the analog to digital converter. Maybe setting processor's registers directly.

Thanks in advance!

trustmiao
Posts: 42
Joined: Mon Aug 06, 2018 5:16 am

Re: Bug in adc_set_clk_div() : Clock for adc1 is fixed

Postby trustmiao » Wed Sep 21, 2022 9:35 am

i believe it is partly related to the dma, try this https://github.com/espressif/esp-idf/tr ... _read/main

Who is online

Users browsing this forum: No registered users and 117 guests