Timer help

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Freaks,
I am trying to stop timer 1 in the ISR, do some work and then start timer 1 again at the end of ISR; something along these lines:

ISR(TIMER1_COMPA_vect)

   {  
          //disable timer 1
          do_some_work();      
          //enable timer 1
   }

I want the timer to resume counting only after the do_some_work() function has finished. How can I disable and then re-enable the timer?
Thanks

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I just answered an almost identical question of yours here:

https://www.avrfreaks.net/index.p...

Please don't start multiple threads about what's effectively the same question.

(you start a timer by setting CS?? bits and you stop it by setting them all back to 0)

As this is a cross-post I'm going to lock this thread.

Topic locked