2022-02-04 06:02 AM
Hi,
I'm almost new to the STM32 and have the following question:
I'm triggering multichannel ADC1 conversions using timer 1 and storing the readings in a buffer using the DMA. It works fine until I configure ADC2 (which doesn't support DMA) to be triggered by timer 2. The sole addition of HAL_ADC_Start(&hadc2); or HAL_ADC_Start_IT(&hadc2); at the beginning of the code causes corrupted readings from ADC1+DMA. What am I doing wrong? Is it possible to trigger other ADCs while using DMA with another channel?
Thanks in advance
2022-02-04 06:31 AM
Yes it's possible. Could be overloading DMA, what is your sample rate? What does "corrupted" mean exactly?
2022-02-04 07:30 AM
Hi, TDK
Thank you for the answer, The readings go from:
to only by adding HAL_ADC_Start(&hadc2);
the sample is triggered in the second event of a capture compare running at 20Khz, so I suppose the sample rate is 10Khz
Thanks in advance
2022-02-04 07:31 AM
Hi, TDK
Thank you for the answer, The readings go from:
to
only by adding HAL_ADC_Start(&hadc2);
the sample is triggered in the second event of a capture compare running at 20Khz, so I suppose the sample rate is 10Khz
Thanks in advance
2022-02-04 08:37 AM
Changing DMA to Half Word and, consequently, the buffer data type to 16 bits did the trick. Still don't know why Thanks!