Changing Values of OCR0A for Phase Correct PWM

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

I have been looking through the data sheet for my ATMega 88PA and haven't been able to find any information on when OCR0A can be change. Do I need to stop the timer, change the value in OCR0A or can I simply change the value in OCR0A while the timer is running thus on the next period the wave form will be of the updated duty cycle?

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

Quote:
haven't been able to find any information on when OCR0A can be change

Change it anytime you like. The register is double buffered so that the new value will take effect when the timer reaches TOP. Do not stop the timer.

Regards,
Steve A.

The Board helps those that help themselves.

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

That's great, and makes things much more simple. Two thumbs up for Atmel for their engineering on this. Thanks for the information.