Atmega128rfa1 – Rainbow Electronics ATmega128RFA1 User Manual
Page 267

267
8266A-MCU Wireless-12/09
ATmega128RFA1
The COM1B1:0 bits control the output compare behavior of pin OC1B. If one or both of
the COM1B1:0 bits 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 corresponding to the OC1B pin must be set in order to enable the
output driver. When the OC1A is connected to the pin, the function of the COM1B1:0
bits is dependent of the WGM13:0 bits setting. The following table shows the
COM1B1:0 bit functionality when the WGM13:0 bits are set to a normal or a CTC mode
(non-PWM). For the other functionality refer to section "Modes of Operation".
Table 18-7 COM1B Register Bits
Register Bits
Value
Description
0
Normal port operation, OCnA/OCnB/OCnC
disconnected.
1
Toggle OCnA/OCnB/OCnC on Compare
Match.
2
Clear OCnA/OCnB/OCnC on Compare
Match (set output to low level).
COM1B1:0
3
Set OCnA/OCnB/OCnC on Compare Match
(set output to high level).
•
Bit 3:2 – COM1C1:0 - Compare Output Mode for Channel C
The COM1C1:0 bits control the output compare behavior of pin OC1C. If one or both of
the COM1C1:0 bits are written to one, the OC1C output overrides the normal port
functionality of the I/O pin it is connected to. However note that the Data Direction
Register (DDR) bit corresponding to the OC1C pin must be set in order to enable the
output driver. When the OC1A is connected to the pin, the function of the COM1C1:0
bits is dependent of the WGM13:0 bits setting. The following table shows the
COM1C1:0 bit functionality when the WGM13:0 bits are set to a normal or a CTC mode
(non-PWM). For the other functionality refer to section "Modes of Operation".
Table 18-8 COM1C Register Bits
Register Bits
Value
Description
0
Normal port operation, OCnA/OCnB/OCnC
disconnected.
1
Toggle OCnA/OCnB/OCnC on Compare
Match.
2
Clear OCnA/OCnB/OCnC on Compare
Match (set output to low level).
COM1C1:0
3
Set OCnA/OCnB/OCnC on Compare Match
(set output to high level).
•
Bit 1:0 – WGM11:10 - Waveform Generation Mode
Combined with the WGM13:2 bits found in the TCCR1B Register, these bits control the
counting sequence of the counter, the source for maximum (TOP) counter value, and
what type of waveform generation to be used. Modes of operation supported by the
Timer/Counter unit are: Normal mode (counter), Clear Timer on Compare match (CTC)
mode, and three types of Pulse Width Modulation (PWM) modes. For more information
on the different modes see section "Modes of Operation".
Table 18-9 WGM1 Register Bits
Register Bits
Value
Description
0x0
Normal mode of operation
WGM11:10
0x1
PWM, phase correct, 8-bit