1. If you need to clear the flag TOV1, then the rest of the flags are reset for one in the register TIFR1
2. Mode: WGMn3: 0 = 1110 - Fast PWM.
If the interrupt TOIE1 is turned off and then change ICR1, then the TOV1 flag is never set if it was previously reset,
even after the counter TCNT1 has overflowed and the count has gone back.
In ATmelStudio and on real hardware everything works fine.
mega328P, Timer1
mega328P, Timer1
- Attachments
-
- 2) all flags are reset in TIFR1
- 2.jpg (48.93 KiB) Viewed 7603 times
-
- 1) sbi TIFR1,TOV1
- 1.jpg (49.4 KiB) Viewed 7603 times