In the Datasheet for the 8 bit AVR Microcontrollers ATmega328/P , page 148 it is written:
Bit 0 – TOV: Timer/Counter0, Overflow Flag
The bit TOV0 is set when an overflow occurs in Timer/Counter0. TOV0 is cleared by hardware when
executing the corresponding interrupt handling vector. Alternatively, TOV0 is cleared by writing a logic one
to the flag. When the SREG I-bit, TOIE0 (Timer/Counter0 Overflow Interrupt Enable), and TOV0 are set,
the Timer/Counter0 Overflow interrupt is executed.
I always thought that SETting a bit meant to make it a "1"
In the datasheet it is clearly indicated that "TOV0 is cleared by writing a logic 1" to the bit.
What's the catch ? SETting a bit is 0 or 1 ?
If I define TIFR0 ( the actual register ) equal to 1, isn't the first bit of that variable SET ?
Please, un-confuse me someone .