SBI simulation bug

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

Hi.
I have just discovered a simulation bug in version 4.12.462. I don't know if it is in older versions as well, but I would think so.
I am simulating a Mega88, and am trying to manually clear the Timer2 overflow flag (not letting an interrupt do it by itself). This I do by setting the overflow flag to 1 with sbi, like this:

sbi TIFR2, TOV2

However, the simulator clears all three flags in TIFR2. I think this is the expected behaviour of older AVR's, but as far as I can read in the datasheet, this does not apply in the Mega48/88/168 case.

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

My reading of the datasheet, esp. note 3 of the Register Summary on page 338, seems to confirm your suspicion of a bug in the simulator.