OCR1A in simulator 2

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

The OCR1A sometimes fails to update in the simulator 2 display (at least with the mega168p). This appears to happen when the timer is in one of the fixed TOP PWM modes. When setting OCR1A when in one of these modes, the display shows no change, though reading from OCR1A returns the proper value.

Edit: This is in the 4.14 beta. I don't know if it happens in the current release version.

Regards,
Steve A.

The Board helps those that help themselves.

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

Koshchi wrote:
The OCR1A sometimes fails to update in the simulator 2 display (at least with the mega168p). This appears to happen when the timer is in one of the fixed TOP PWM modes. When setting OCR1A when in one of these modes, the display shows no change, though reading from OCR1A returns the proper value.

Edit: This is in the 4.14 beta. I don't know if it happens in the current release version.


This is probably caused by double buffering of OCR registers in PWM modes (see data sheet). Try running your program until the timer hits TOP and see if the OCR display in AVR Studio is updated then.

There is no reason to expect this behaviour to be any different between 4.13.SP2 and 4.14.BETA, as this aspect of the simulator is not changed between these releases.

- roland