beautypg.com

Timer/counter interrupt flag register – tifr, Atmega8515(l) – Rainbow Electronics ATmega8515L User Manual

Page 91

background image

91

ATmega8515(L)

2512A–AVR–04/02

Timer/Counter Interrupt Flag
Register – TIFR

• Bit 1 – TOV0: Timer/Counter0 Overflow Flag

The bit TOV0 is set (one) 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
( T im er /Co u nte r0 O v er flo w In ter ru p t En ab l e ), a n d TO V 0 ar e se t (o n e) , th e
Timer/Counter0 Overflow interrupt is executed. In phase correct PWM mode, this bit is
set when Timer/Counter0 changes counting direction at $00.

• Bit 0 – OCF0: Output Compare Flag 0

The OCF0 bit is set (one) when a compare match occurs between the Timer/Counter0
and the data in OCR0 – Output Compare Register0. OCF0 is cleared by hardware when
executing the corresponding interrupt handling vector. Alternatively, OCF0 is cleared by
writing a logic one to the flag. When the I-bit in SREG, OCIE0 (Timer/Counter0 Com-
pare match Interrupt Enable), and OCF0 are set (one), the Timer/Counter0 Compare
match Interrupt is executed.

Bit

7

6

5

4

3

2

1

0

TOV1

OCF1A

OCF1B

ICF1

TOV0

OCF0

TIFR

Read/Write

R/W

R/W

R/W

R/W

R/W

R/W

R/W

R/W

Initial Value

0

0

0

0

0

0

0

0