1
完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
今天在使用ESP32-S3的ADC时,需要高速ADC采样,参考example中的持续采样代码设定了ADC,调用adc_digi_controller_configure(&digi_cfg)提示ADC bitwidth not supported。
调用部分代码如下: [Codebox] void ESP32ADC::setHighSpeedADC() { // adc_digi初始化 // controller初始化 adc_digi_init_config_t adc_dma_config = { .max_store_buf_size = 1024, .conv_num_each_intr = 256, .adc1_chan_mask = 0, .adc2_chan_mask = 0 }; uint32_t freq = US_PER_S / _period_us; serialLog.log(ESP32LogLevel::Info,"freq:%d",freq); adc_digi_pattern_config_t adc_pattern[SOC_ADC_PATT_LEN_MAX] = {0}; uint8_t channel1 = ADC_CHANNEL_3; uint8_t channel2 = ADC_CHANNEL_4; adc_dma_config.adc1_chan_mask |= BIT(channel1); uint8_t activeEADC = getActiveEADCChannel() == ECG_ADC_CHANNEL ? ADC_CHANNEL_3 : ADC_CHANNEL_5; adc_dma_config.adc1_chan_mask |= BIT(channel2); adc_pattern[0] = { .atten = ADC_ATTEN_DB_11, .channel = channel1, .unit = ADC_UNIT_1, .bit_width = ADC_WIDTH_12Bit }; adc_pattern[1] = { .atten = ADC_ATTEN_DB_11, .channel = channel2, .unit = ADC_UNIT_1, .bit_width = ADC_WIDTH_12Bit }; adc_digi_configuration_t digi_cfg = { .conv_limit_en = false, .conv_limit_num = 512, .pattern_num = 2, .sample_freq_hz = freq, //换算成采样频率 .conv_mode = ADC_CONV_SINGLE_UNIT_1, // 只使用ADC1 .format = ADC_DIGI_OUTPUT_FORMAT_TYPE2 }; digi_cfg.adc_pattern = adc_pattern; ESP_ERROR_CHECK(adc_digi_initialize(&adc_dma_config)); ESP_ERROR_CHECK(adc_digi_controller_configure(&digi_cfg)); } [/Codebox] 请问,以上使用方法是否有问题? 详细是错误输出为: E (37732) ADC: adc_digi_controller_configure(571): ADC bitwidth not supported ESP_ERROR_CHECK failed: esp_err_t 0x102 (ESP_ERR_INVALID_ARG) at 0x4037d7f8 file: "src/ESP32ADC.cpp" line 108 func: void ESP32ADC::setHighSpeedADC() expression: adc_digi_controller_configure(&digi_cfg) abort() was called at PC 0x4037d7fb on core 0 Backtrace:0x4037768e:0x3fcb6c300x4037d805:0x3fcb6c50 0x40382f0d:0x3fcb6c70 0x4037d7fb:0x3fcb6cf0 0x42005af4:0x3fcb6d10 0x42005fcf:0x3fcb6dc0 0x4200330b:0x3fcb6de0 0x42003c11:0x3fcb6e00 0x42005331:0x3fcb6e60 0x42005340:0x3fcb6e90 |
|
相关推荐
|
|
只有小组成员才能发言,加入小组>>
1140 浏览 1 评论
577浏览 6评论
478浏览 5评论
有没有办法在不使用混杂模式的情况下实现Wifi驱动程序接收缓冲区访问中断呢?
462浏览 5评论
463浏览 4评论
438浏览 4评论
小黑屋| 手机版| Archiver| 德赢Vwin官网 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-22 20:33 , Processed in 0.692106 second(s), Total 73, Slave 57 queries .
Powered by 德赢Vwin官网 网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
德赢Vwin官网 观察
版权所有 © 湖南华秋数字科技有限公司
德赢Vwin官网 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号