cancel
Showing results for 
Search instead for 
Did you mean: 

Timer control using ADC

abhishek2
Associate II
Posted on August 27, 2008 at 07:09

Timer control using ADC

3 REPLIES 3
abhishek2
Associate II
Posted on May 17, 2011 at 12:42

Hello everyone

I have a small doubt in implementing the TIM1 control using the ADC. I have modified the peripheral transfer example (ADC-DMA-TIM1) to my need. Here is my question. I should have a timer running 50% duty cycle (constant period) always and if my ADC value goes more than 7FF, the timer should immediately break and restart again after the set period. Anyone has an idea to implement this?

AR

abhishek2
Associate II
Posted on May 17, 2011 at 12:42

Thanks.. Thats a good idea.. I am a newbie to this controller. I checked the interrupt (using CRO) from the ADC and the output toggled as coded. How do i restart the timer from here (in the ADC interrupt routine)?

Thanks

AR

lanchon
Associate II
Posted on May 17, 2011 at 12:42

you could use the adc analog watchdog (the analog bounds checker, whatever the name is) and restart the timer from the watchdog ISR.