AnsweredAssumed Answered

Triggering ADC Sampling by Timer Events

Question asked by milutinovic.marko on Aug 29, 2014
Latest reply on Aug 30, 2014 by milutinovic.marko

I am trying to setup ADC sampling that is triggered by a Timer. Essentially I want to setup a 1 kHz timer that will trigger an ADC sample every 1 ms, and use DMA to transfer the sample data.

I have all the components working separately but I cannot get the ADC to sample on a timer event. In the ADC documentation it lists that events from TIM1 “Timer 1 CC1 event” can be used as triggers to initiate a sampling. I have setup the “EXTEN” and “EXTSEL” fields to use this event, but it does not get triggered by the timer.

I have verified that the timer is generating interrupts at 1Khz by setting up an interrupt handler that will manually initiate an ADC sampling via the “SWSTART” bit in the ADC->CR2 register. Using this method I can accomplish the task I want, but it adds delays which are causing me to miss samples.

The documentation is not very clear as to how the “Timer 1 CC1 event” event gets generated by TIM1. I’m using the “RM0090 Reference manual” for ST STM32F407IE. I’ve spent some time googling and I’ve found people having issues with this as well, with no solutions.

Are there any other documents that detail how this can be setup/used?

Outcomes