56
ATmega161(L)
1228B–09/01
Note:
1. X = A or B
Note that in the PWM mode, the 8, 9 or 10 least significant OCR1A/OCR1B bits
(depends of resolution), when written, are transferred to a temporary location. They are
latched when Timer/Counter1 reaches the value TOP. This prevents the occurrence of
odd-length PWM pulses (glitches) in the event of an unsynchronized OCR1A/OCR1B
write. See Figure 38 and Figure 39 for an example in each mode.
Figure 38.
Effects on Unsynchronized OCR1 Latching
Note:
1. Note: X = A or B
Figure 39.
Effects of Unsynchronized OCR1 Latching in Overflow Mode
1
Note:
1. Note: X = A or B
During the time between the write and the latch operation, a read from OCR1A or
OCR1B will read the contents of the temporary location. This means that the most
recently written value always will read out of OCR1A/B.
When the OCR1X contains $0000 or TOP, and the up/down PWM mode is selected, the
output OC1A/OC1B is updated to low or high on the next compare match according to
the settings of COM1A1/COM1A0 or COM1B1/COM1B0. This is shown in Table 19. In
Counter Value
Compare Value
PWM Output OC1X
Synchronized
OCR1X Latch
Counter Value
Compare Value
PWM Output OC1X
Unsynchronized
OCR1X Latch
Glitch
Compare Value changes
Compare Value changes
PWM Output OC1x
PWM Output OC1x
Unsynchronized OC1x Latch
Synchronized OC1x Latch