We saw something odd when we were trying to clear a specific flag(OCF3A) in the ETIFR in ATmega128.
We wanted to discharge this flag in order to destroy any floating interrupt caused by this flag, so we were writing logic 1 whatever the flag was. In AVRStudio ver4.07 build240 it seems that when the flag is cleared(0) and we write a logic 1 to it, it becomes 1.
Normally, it should stay logic 0, right?
In the datasheet(page 139) it says that when is set, it can be cleared by writing a logic 1 but what happens when it was clear before the writing(1)?
Do we have to check first if it is set and then try to clear it or else do nothing?
It's possibly another AVR Studio bug but it might be because of the oddity of the ETIFR since it's in SRAM address $7C and needs to be accessed as SRAM with "sts", "lds" and their 'relatives'.
If it's because of the SRAM addressing, do the other 'SRAM' registers have the same problem?
So what's going on?