Datasheet
75
7701F–AVR–10/12
Atmel ATtiny24/44/84 [Preliminary]
Figure 13-3. Output Compare Unit, Block Diagram
The OCR0x registers are double buffered when using any of the pulse width modulation
(PWM) modes. For the normal and clear timer on compare (CTC) modes of operation, the
double buffering is disabled. The double buffering synchronizes the update of the OCR0x
compare registers to either top or bottom of the counting sequence. The synchronization pre-
vents the occurrence of odd-length, non-symmetrical PWM pulses, thereby making the output
glitch-free.
The OCR0x register access may seem complex, but this is not the case. When the double
buffering is enabled, the CPU has access to the OCR0x buffer register, and if double buffering
is disabled the CPU will access the OCR0x directly.
13.5.1 Force Output Compare
In non-PWM waveform generation modes, the match output of the comparator can be forced
by writing a logical one to the force output compare (0x) bit. Forcing compare match will not
set the OCF0x flag or reload/clear the timer, but the OC0x pin will be updated as if a real com-
pare match had occurred (the COM0x1:0 bits settings define whether the OC0x pin is set,
cleared, or toggled).
13.5.2 Compare Match Blocking by TCNT0 Write
All CPU write operations to the TCNT0 Register will block any Compare Match that occur in
the next timer clock cycle, even when the timer is stopped. This feature allows OCR0x to be
initialized to the same value as TCNT0 without triggering an interrupt when the Timer/Counter
clock is enabled.
OCFnx (Int.Req.)
= (8-bit Comparator )
OCRnx
OCnx
DATA BUS
TCNTn
WGMn1:0
Waveform Generator
top
FOCn
COMnX1:0
bottom