~5us ADC read using ESP32-S3

litmus337
Posts: 4
Joined: Thu Mar 06, 2025 1:53 am

~5us ADC read using ESP32-S3

Postby litmus337 » Thu Apr 10, 2025 12:49 am

Hi,
I'm trying to do some very fast ADC sampling with at least 200kHz sampling rate.
Utilizing only ADC1, with Oneshot mode driver, I was able to obtain analog data in ~30 us. With Continuous mode driver, using very small conversion frame size, it was feasible but super unsteady; when I do some hard work analyzing ADC data it often paniks. Even some data was corrupted and not usable.
So, to achieve very fast sampling, what should I do? my next approach is to access the ADC peripheral directly, is it valid? If valid how can I do that?

alb702
Posts: 14
Joined: Tue Dec 07, 2021 3:31 am

Re: ~5us ADC read using ESP32-S3

Postby alb702 » Thu Apr 10, 2025 9:34 am

A first cause of this - is bad decision in ESP32 hardware: control two ADCs through one peripherial register. To prevent
acces to register from several tasks need to use syncronization objects: semaphores, spinlocks, etc... Therefore oneshot read
function have long execution time.
If in Your project used only ADC1 (warning: ADC2 used by Wifi) is possible to make more fast i/o-registers-based ADC driver.

MicroController
Posts: 2669
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: ~5us ADC read using ESP32-S3

Postby MicroController » Fri Apr 11, 2025 6:17 pm

at least 200kHz sampling rate.
Utilizing only ADC1, with Oneshot mode driver, ...
Why would you try and do one-shot in this case?

Who is online

Users browsing this forum: Applebot, ChatGPT-User, GPTBot, Nerez83, Perplexity-User and 1 guest