Datasheet

Table Of Contents
105
ATmega32A [DATASHEET]
Atmel-8155D-AVR-ATmega32A-Datasheet_02/2014
The COM1A1:0 and COM1B1:0 control the Output Compare pins (OC1A and OC1B respectively) behavior. If one
or both of the COM1A1:0 bits are written to one, the OC1A output overrides the normal port functionality of the I/O
pin it is connected to. If one or both of the COM1B1:0 bit are written to one, the OC1B output overrides the normal
port functionality of the I/O pin it is connected to. However, note that the Data Direction Register (DDR) bit corre-
sponding to the OC1A or OC1B pin must be set in order to enable the output driver.
When the OC1A or OC1B is connected to the pin, the function of the COM1x1:0 bits is dependent of the WGM13:0
bits setting. Table 16-2 shows the COM1x1:0 bit functionality when the WGM13:0 bits are set to a normal or a CTC
mode (non-PWM).
Table 16-3 shows the COM1x1:0 bit functionality when the WGM13:0 bits are set to the fast PWM mode.
Note: 1. A special case occurs when OCR1A/OCR1B equals TOP and COM1A1/COM1B1 is set. In this case the compare
match is ignored, but the set or clear is done at BOTTOM. See “Fast PWM Mode” on page 104. for more details.
Table 17-2. Compare Output Mode, non-PWM
COM1A1/COM1B1 COM1A0/COM1B0 Description
0 0 Normal port operation, OC1A/OC1B disconnected.
0 1 Toggle OC1A/OC1B on compare match
1 0 Clear OC1A/OC1B on compare match (Set output
to low level)
1 1 Set OC1A/OC1B on compare match (Set output to
high level)
Table 17-3. Compare Output Mode, Fast PWM
(1)
COM1A1/COM1B1 COM1A0/COM1B0 Description
0 0 Normal port operation, OC1A/OC1B
disconnected.
0 1 WGM13:0 = 15: Toggle OC1A on Compare
Match, OC1B disconnected (normal port
operation).
For all other WGM13:0 settings, normal port
operation, OC1A/OC1B disconnected.
1 0 Clear OC1A/OC1B on compare match, set
OC1A/OC1B at BOTTOM,
(non-inverting mode)
1 1 Set OC1A/OC1B on compare match, clear
OC1A/OC1B at BOTTOM,
(inverting mode)