Associate III
January 26, 2022
Solved
TIM-triggered periodic ADC capture w/ DMA
- 9 replies
- 4556 views
I'm trying to do a periodic ADC capture on 2 channels, triggered by TIM5. ADC should output to memory via DMA, with a DMA interrupt upon each completion to read the data from each scan.
So far, the DMA interrupts aren't hitting, and the ADC doesn't even appear to be reading anything. Any ideas what I'm missing?
TIM5_CC4 outputs on a GPIO. ADC captures should be synced with that, so I'm trying to use TIM5_CC3 to trigger the ADC.
Code was generated by STM32CubeMX 6.1.1, with STM32F4 package 1.25.2. (MX_DMA_Init() is called before MX_ADC1_Init().)
CubeMX Project Screenshots
Code Excerpts
Order of some relevant function calls:
// in main():
HAL_Init();
SystemClock_Config();
MX_GPIO_Init();
MX_DMA_Init();
// elsewhere, after OS starts:
MX_ADC1_Init();EDIT: Added relevant code excerpts as attachments.
