Datasheet

ATmega164A/PA/324A/PA/644A/PA/1284/P
2018 Microchip Technology Inc. Data Sheet Complete DS40002070A-page 164
Bit 2 – OCR2BUB: Output Compare Register2 Update Busy
When Timer/Counter2 operates asynchronously and OCR2B is written, this bit becomes set. When OCR2B has
been updated from the temporary storage register, this bit is cleared by hardware. A logical zero in this bit
indicates that OCR2B is ready to be updated with a new value.
Bit 1 – TCR2AUB: Timer/Counter Control Register2 Update Busy
When Timer/Counter2 operates asynchronously and TCCR2A is written, this bit becomes set. When TCCR2A
has been updated from the temporary storage register, this bit is cleared by hardware. A logical zero in this bit
indicates that TCCR2A is ready to be updated with a new value.
Bit 0 – TCR2BUB: Timer/Counter Control Register2 Update Busy
When Timer/Counter2 operates asynchronously and TCCR2B is written, this bit becomes set. When TCCR2B
has been updated from the temporary storage register, this bit is cleared by hardware. A logical zero in this bit
indicates that TCCR2B is ready to be updated with a new value.
If a write is performed to any of the five Timer/Counter2 Registers while its update busy flag is set, the updated
value might get corrupted and cause an unintentional interrupt to occur.
The mechanisms for reading TCNT2, OCR2A, OCR2B, TCCR2A and TCCR2B are different. When reading
TCNT2, the actual timer value is read. When reading OCR2A, OCR2B, TCCR2A and TCCR2B the value in the
temporary storage register is read.
17.11.7 TIMSK2 – Timer/Counter2
Interrupt Mask Register
Bit 2 – OCIE2B: Timer/Counter2 Output Compare Match B Interrupt Enable
When the OCIE2B bit is written to one and the I-bit in the Status Register is set (one), the Timer/Counter2
Compare Match B interrupt is enabled. The corresponding interrupt is executed if a compare match in
Timer/Counter2 occurs, that is, when the OCF2B bit is set in the Timer/Counter 2 Interrupt Flag Register –
TIFR2.
Bit 1 – OCIE2A: Timer/Counter2 Output Compare Match A Interrupt Enable
When the OCIE2A bit is written to one and the I-bit in the Status Register is set (one), the Timer/Counter2
Compare Match A interrupt is enabled. The corresponding interrupt is executed if a compare match in
Timer/Counter2 occurs, that is, when the OCF2A bit is set in the Timer/Counter 2 Interrupt Flag Register –
TIFR2.
Bit 0 – TOIE2: Timer/Counter2 Overflow Interrupt Enable
When the TOIE2 bit is written to one and the I-bit in the Status Register is set (one), the Timer/Counter2
Overflow interrupt is enabled. The corresponding interrupt is executed if an overflow in Timer/Counter2 occurs,
that is, when the TOV2 bit is set in the Timer/Counter2 Interrupt Flag Register – TIFR2.
17.11.8 TIFR2 – Timer/Counter2 Interrupt Flag Register
Bit 76543 2 1 0
(0x70)
OCIE2B OCIE2A TOIE2 TIMSK2
Read/Write RRRRR R/WR/WR/W
Initial Value 00000 0 0 0
Bit 76543210
0x17 (0x37)
OCF2B OCF2A TOV2 TIFR2
Read/Write RRRRRR/WR/WR/W
Initial Value00000000