cancel
Showing results for 
Search instead for 
Did you mean: 

How to change ADC's Number of Conversion?

WQ
Associate III

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

1 REPLY 1
Piranha
Chief II

Read the reference manual.