Skip to main content
abhishek2
Associate II
August 27, 2008
Question

Timer control using ADC

  • August 27, 2008
  • 3 replies
  • 936 views
Posted on August 27, 2008 at 07:09

Timer control using ADC

    This topic has been closed for replies.

    3 replies

    abhishek2
    abhishek2Author
    Associate II
    May 17, 2011
    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

    lanchon
    Associate III
    May 17, 2011
    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.

    abhishek2
    abhishek2Author
    Associate II
    May 17, 2011
    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