用了 ADC1_IN10 ADC1_IN11 ADC1_IN15 只有10 和11 的adc值正确 IN15的值不正确, 模式选择的是 sequencer set to not fully configurable 求大佬看看 void MX_ADC1_Init(void) { ADC_ChannelConfTypeDef sConfig = {0}; /** Configure the global features of the ADC (Clock, Resolution, Data Alignment and number of conversion) */ hadc1.Instance = ADC1; hadc1.Init.ClockPrescaler = ADC_CLOCK_SYNC_PCLK_DIV2; hadc1.Init.Resolution = ADC_RESOLUTION_12B; hadc1.Init.DataAlign = ADC_DATAALIGN_RIGHT; hadc1.Init.ScanConvMode = ADC_SCAN_DISABLE; hadc1.Init.EOCSelection = ADC_EOC_SINGLE_CONV; hadc1.Init.LowPowerAutoWait = DISABLE; hadc1.Init.LowPowerAutoPowerOff = DISABLE; hadc1.Init.ContinuousConvMode = DISABLE; hadc1.Init.NbrOfConversion =3; hadc1.Init.ExternalTrigConv = ADC_SOFTWARE_START; hadc1.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE; hadc1.Init.DMAContinuousRequests = DISABLE; hadc1.Init.Overrun = ADC_OVR_DATA_PRESERVED; hadc1.Init.SamplingTimeCommon1 = ADC_SAMPLETIME_12CYCLES_5; hadc1.Init.OversamplingMode = DISABLE; hadc1.Init.TriggerFrequencyMode = ADC_TRIGGER_FREQ_HIGH; sConfig.Channel = ADC_CHANNEL_10; sConfig.Rank = ADC_RANK_CHANNEL_NUMBER; if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK) { Error_Handler(); } sConfig.Channel = ADC_CHANNEL_11; sConfig.Rank = ADC_RANK_CHANNEL_NUMBER; if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK) { Error_Handler(); } sConfig.Channel = ADC_CHANNEL_15; sConfig.Rank = ADC_RANK_CHANNEL_NUMBER; if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK) { Error_Handler(); } } |
STM32G0B1CC单片机多个从板使用CAN链接,CAN接收帧和发送帧丢失的问题。
STM32G0B1adc+dma采样数据错位
cube stm32g030f6p6 adc analog watchdog1 无法配置
STM32G070使用HAL_SPI_Receive函数疑问
stm32g030j6m6如何使用串口烧录程序?NRST引脚能否作为普通输入IO口用?
STM32的H5/U5系列处理器内置运放支持负压运算吗?比如输入-1V,放大倍数为2时输出-2V
stm32G030C8T6 官方例程库
STM32G070 调用HAL_I2C_Mem_Read_IT测试疑问
STM32G030F6P6中的3种睡眠模式的功耗分别是多少
STM32G030F6 ADC+DMA多通道非连续采样无法正常工作?
谢谢 我去看看
而3个通道都使用:sConfig.Rank = ADC_RANK_CHANNEL_NUMBER;
结果就只转换1个通道而已