AnsweredAssumed Answered

STM32L476 ADC Dual regular simultaneous, Multichannel (scan), single conversion mode

Question asked by raron on Jun 5, 2016
Latest reply on Jun 8, 2016 by ForumSTM32.ForumSTM3

I would like to use the uC to measure three-phase power. I have six analog channels (3 for the voltages, and 3 for the currents). I would like to use the ADC1 and ADC2 to simultaneously sample the voltage and the current of each of the phases.

Based on the AN3116 I need to use the dual regular simultaneous, multichannel (scan), single conversion mode of the ADC.

I would like to start the conversation of the three phase with a timer interrupt to set the sampling frequency.

I have set up the three channels per ADC in the STM32CubeMX, but I don't get real results.
I tried to copy the results with DMA to a buffer of uint32, but only the lower half of the words were actual ADC values (the three samples of the same ADC), the upper half was static random value (changed only at reset).
I started the conversation with the HAL_ADCEx_MultiModeStart_DMA function with the master (ADC1) as argument.

After that I tried the interrupt config, I start the conversation with HAL_ADC_Start_IT(slaveADC); HAL_ADC_Start_IT(masterADC);
It works fine if I only use one (pair) channel, but if set up three channels for scanning, I only get two interrupt / callback (HAL_ADC_ConvCpltCallback).
The attached the STM32CubeMX config was used in this configuration.

Have anybody met some problem like this?

How can I correctly set up the ADC for this operation?

uC: STM32L476RG
board: Nucleo-L476RG
STM32CubeMX version: 4.15
stm32l4xx_hal_adc version: V1.4.0