Skip to main content
Hugues Libotte
Associate II
February 23, 2023
Question

Problem in getting periodically reading of ADC1 multiple channels using TIM3 interrupt and DMA

  • February 23, 2023
  • 2 replies
  • 2366 views

On my STM32F030, I need to read analog values from three channels of the ADC1. These readings need to be periodical and I am using the TIM3 interrupt to trig the ADC value capture. When do not using DMA and collecting only one ADC channel value, everything works fine. As I need the three channels, I have to use DMA and once I activate this, I properly get a first value of the three channels but the ADC interrupt is never triggered any more and no new data are collected.

Any advice about this ?

Thanks

This topic has been closed for replies.

2 replies

Javier1
Principal
February 23, 2023

>>TIM3 interrupt to trig the ADC value capture,

the interrupt doesnt need to be activated, just select the TIM update event .

But i dont think thats the cause of your problem

Similar question i had some time ago: https://community.st.com/s/question/0D53W00001AOJx3SAH/stm32f207-dmaadc-captures-only-one-channel-only-once

Video https://www.digikey.com/en/maker/projects/getting-started-with-stm32-working-with-adc-and-dma/f5009db3a3ed4370acaf545a3370c30c

hit me up in https://www.linkedin.com/in/javiermuñoz/
Hugues Libotte
Associate II
February 23, 2023

Thanks for answer but the problem onmy appears when DMA is used. In this case, even if TIM Update event is enable, I do not get periodic ADC capture. I only get once at startup of the uC

And if DMA is not used, everything works properly (on a single channel)

waclawek.jan
Super User
February 23, 2023

Read out and check the TIM, ADC and DMA regiseters' content.

If you've clicked the code in CubeMX, it may be the "incorrect DMA initialization order in CubeMX" problem. Search in this forum.

JW