Skip to main content
WQ_it
Associate III
Aug 31, 2022 10:27 PM UTC
Question

How to change ADC's Number of Conversion?

Hi, there:

We need to change the Number of Conversion of the ADC during the run in STM32WB MCU. It is configured with multiple channels and with DMA.

(1) Can we just de-initialize the HADC and re-initialize a new one? Will it affect the interrupt and DMA?

(2) Can we just modify the SQR1 register as following (in stm32wbxx_hal_adc.c)?

MODIFY_REG(hadc->Instance->SQR1, ADC_SQR1_L, (hadc->Init.NbrOfConversion - (uint8_t)1));

Thanks for help in advance.

-WQ

This topic has been closed for replies.

1 reply

Piranha
Principal III
Sep 4, 2022 4:24 PM UTC

Read the reference manual.