Using ESP-IDF 4.4.4, with ESP32-WROVER-B module.
I have followed the steps here to set up the ADC controller in DMA mode:
https://docs.espressif.com/projects/esp ... iver-usage
I am using one channel on ADC1 as the input. When calling "adc_digi_controller_configure", I use these options:
Code: Select all
const adc_digi_configuration_t controller_config =
{
.conv_limit_en = true,
.conv_limit_num = SAMPLE_COUNT,
.pattern_num = 1,
.adc_pattern = &pattern_config,
.sample_freq_hz = xxx,
.conv_mode = ADC_CONV_SINGLE_UNIT_1,
.format = ADC_DIGI_OUTPUT_FORMAT_TYPE1,
}
// pattern_config defines a single pattern, unit 0, channel 0, bit width 9 or 12, attenuation 11 dB.
Code: Select all
#define SOC_ADC_SAMPLE_FREQ_THRES_HIGH (2*1000*1000)
Is it possible to sample faster than this in DMA mode - i.e. some other configuration I need to change?
Can "conv_mode" be used to obtain a higher sample rate (i.e. by feeding the input to two channels and sampling both at once)? I see options for "ADC_CONV_BOTH_UNIT" and "ADC_CONV_ALTER_UNIT" but it's not clear whether they can be used to obtain higher sample rates. Also, the technical ref manual is confusing about whether ADC2 can be used with DMA - the text says that only ADC1 supports DMA, but the diagrams show both supporting DMA.