esp32s3 ADC sampling rate

ytesfai
Posts: 2
Joined: Mon Mar 13, 2023 6:56 pm

esp32s3 ADC sampling rate

Postby ytesfai » Wed Mar 15, 2023 8:30 pm

I have an application using esp32s3 where I want to sample three channels through ADC1. If I program a sampling rate of 3000 samples/sec, is it 3000 samples/sec per channel or 3000 samples across all channels. i.e. Do I see signal through channels 1, 2, 3 sampled at 3000samples/sec each, or 1000 samples/sec each.

In other words with the 3000 samples per second, 3 channels setting above, if I buffer 1 second worth of data, will I get 3000samples/channel * 3 channels = 9000 samples in the buffer or 3000 total samples in the buffer?

Related to that, the max sampling rate in soc_caps.h is 83333 samples/second, is this total or per channel max. i.e. if I have three channels, can I sample each of the channels at up to 83333 samples/second or is the max for each channel = 83333/3 = 27778 samples/second?

Thanks
Yohannes

ytesfai
Posts: 2
Joined: Mon Mar 13, 2023 6:56 pm

Re: esp32s3 ADC sampling rate

Postby ytesfai » Thu Jun 01, 2023 2:46 pm

Follow-up to this question. It looks like the main way maximum ADC frequency is controlled in the driver is through:

1. SOC_ADC_SAMPLE_FREQ_THRES_HIGH in soc_caps.h which controls absolute maximum sampling_freq that can be programmed
2. ADC_LL_CLKM_DIV_NUM_DEFAULT in adc_ll.h that controls the divisor on the clock, which in turns controls the maximum frequency that can be programmed.

In my application, I changed these two numbers and I was able to achieve higher sampling rate than the default maximum (83333Hz). I need the higher sampling rate so I need to make this change. But at the same time I don't want to customize the driver code as that makes it more difficult to upgrade to newer version of ESP-IDF. For example I made the two changes in IDF version 5.0.1. Going to 5.0.2 was smooth as the driver changes were minimal. But now trying to test IDF version 5.1beta breaks my code and I have to manually update driver files on the new driver version. My questions/desires are:

1. Can I override the two MACRO's from my top level application makefile?
2. Is it possible to move some of the definitions out of hardcoded in the c files and into user definable section (e.g. sdkConfig)?

Thanks in advance for any help

davidribeiro
Posts: 3
Joined: Thu Dec 14, 2023 3:36 pm

Re: esp32s3 ADC sampling rate

Postby davidribeiro » Thu Dec 14, 2023 3:40 pm

Hello, I have the same question that you had, did you figure out if it was maximum frequency per channel, or if it was the total maximum frequency (as in, each channel will only get a part of that sampling frequency)?

Who is online

Users browsing this forum: Bing [Bot], Majestic-12 [Bot] and 103 guests