cancel
Showing results for 
Search instead for 
Did you mean: 

NUCLEO-L452RE: ADC with DMA: Problems with more than 5 channels

MMuel.1861
Associate II

If I use

HAL_ADC_Start_DMA(&hadc1, (uint32_t*)uiAdcResults, ADC_NUMBER_OF_CHANNELS);

it only works with up to 5 channels. With more channels there are problems with some channels in the DAM result array. For example with 7 channels, only channel 2...5 are OK. Values of channel 1, 6 und 7 are not OK at all.

I have no idea what the problem is. Cube parameters or source code can not be totally wrong because I tried it with 3...5 channels and this was OK, If I increase the number of channels (>5) the problem occurs.

4 REPLIES 4
TDK
Guru

What does "OK" and "not OK" mean, precisely? Did you try using max sampling time?

If you feel a post has answered your question, please click "Accept as Solution".
MMuel.1861
Associate II

Not OK for example on channel 1:

Value in watch window it is always about 470 (460...480), even if there ist GND or 3,3V on the port pin. It seems that a totally wrong register is copied to the array.

I also tried now with maximum sampling time (640.5 Cycles). No change.

MMuel.1861
Associate II

I attached the copmplete project. I have used an old Cube (version 4.23.0). But I do not think that this is the problem.

I use Segger compiler V4.30C.

MMuel.1861
Associate II

and here the watch window with remarks.

Strange, because I also tried with 3...5 channels. All was OK then, also channel 1 (Array 0).