cancel
Showing results for 
Search instead for 
Did you mean: 

Timer2-CC2 auto trigger ADC

picguy
Associate II
Posted on August 05, 2008 at 23:44

Timer2-CC2 auto trigger ADC

1 REPLY 1
picguy
Associate II
Posted on May 17, 2011 at 12:41

I have spent entirely too much time on this. The STM32 examples cover some of this. I built the example code and ran it. And looked hard at what it was doing. Nothing helped with my simple needs.

All I want is to convert two channels from a timer trigger. The ADC should then interrupt and will pick up the conversions and do my thing.

What works

Timer 2 runs at my correct rate. Timer 2 interrupt is set for CC2. Interrupts occur at the right rate. (I used it to play A=440 and listened with headphones.)

What does not work -

I get at most only one ADC EOC interrupt. On that interrupt I zero ADC_SR. I also read the data register.

A little more info -

Please note I have yet to setup DMA for the conversion results. If I can not get a proper EOC interrupt I don’t wish to complicate things with DMA.

I would rather not use DMA for this. I need to store both ADC results in two different formats. I am better off doing this in my ADC ISR. Would injected channels work for this?