Changing Timer Clock Select Bits On the Fly?

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

ATMEGA644, GCC Compiler.

I need to change the Timer1 Clock Select Bits "on the fly" after certain events happen in my code. I assume that this is an OK thing to do?

Are there anything things in partiuclar that I need to be careful of when doing this? For instance, should I reset the timer value before or after I change the Clock Select Bits, should I wait any period of time before reading the new timer values? etc...

Thanks.

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

Not particularly, except be aware that the change itself might cause an incremental count.

If you are using the clock prescaler you have the option of resetting the prescaler whenever you like, so look into that as well.

If you think education is expensive, try ignorance.