esp-idf_v4.4.2版DMA ADC例程看不懂的地方

jiangteng
Posts: 25
Joined: Wed Jan 30, 2019 7:08 am

esp-idf_v4.4.2版DMA ADC例程看不懂的地方

Postby jiangteng » Fri Aug 26, 2022 11:01 am

adc_digi_init_config_t adc_dma_config = {
.max_store_buf_size = 1024,
.conv_num_each_intr = TIMES,
.adc1_chan_mask = adc1_chan_mask,
.adc2_chan_mask = adc2_chan_mask,
};
上面这个结构体初始化中,决定了ADC每转换TIMES次产生一次DMA中断,那么如果配置了n个通道,是每个通道都采集TIMES,还是每个通道转换TIMES/n次?

adc_digi_configuration_t dig_cfg = {
.conv_limit_en = ADC_CONV_LIMIT_EN,
.conv_limit_num = 250,
.sample_freq_hz = 10 * 1000,
.conv_mode = ADC_CONV_MODE,
.format = ADC_OUTPUT_TYPE,
};

conv_limit_en 和 conv_limit_num 到底是什么意思,为什么用ESP32必须设置conv_limit_en为1,按照源码的注释,达到conv_limit_num 就会停止ADC,这不是连续采集的例程吗,为什么不能永不停止的转换?
sample_freq_hz 指的就是实际的采样率吗?为什么我改为2000,读取结果时依然每次都是ESP_ERR_INVALID_STATE(数据溢出)

Who is online

Users browsing this forum: No registered users and 43 guests