11 register description, 1 tccr1a - timer/counter1 control register a – Rainbow Electronics ATtiny861_V User Manual
Page 113

113
2588B–AVR–11/06
ATtiny261/461/861
16.11 Register Description
16.11.1
TCCR1A – Timer/Counter1 Control Register A
• Bits 7,6 - COM1A1, COM1A0: Comparator A Output Mode, Bits 1 and 0
These bits control the behaviour of the Waveform Output (OCW1A) and the connection of the
Output Compare pin (OC1A). If one or both of the COM1A1:0 bits are set, the OC1A output
overrides the normal port functionality of the I/O pin it is connected to. The complementary
OC1B output is connected only in PWM modes when the COM1A1:0 bits are set to “01”. Note
that the Data Direction Register (DDR) bit corresponding to the OC1A and OC1A pins must be
set in order to enable the output driver.
The function of the COM1A1:0 bits depends on the PWM1A, WGM10 and WGM11 bit settings.
Table 16-6
shows the COM1A1:0 bit functionality when the PWM1A bit is set to Normal Mode
(non-PWM).
Table 16-7
shows the COM1A1:0 bit functionality when the PWM1A, WGM10 and WGM11 bits
are set to fast PWM mode.
Bit
7
6
5
4
3
2
1
0
0x30 (0x50)
COM1A1
COM1A0
COM1B1
COM1B0
FOC1A
FOC1B
PWM1A
PWM1B
TCCR1A
Read/Write
R/W
R/W
R/W
R/W
W
W
R/W
R/W
Initial value
0
0
0
0
0
0
0
0
Table 16-6.
Compare Output Mode, Normal Mode (non-PWM)
COM1A1..0
OCW1A Behaviour
OC1A Pin
OC1A Pin
00
Normal port operation.
Disconnected
Disconnected
01
Toggle on Compare Match.
Connected
Disconnected
10
Clear on Compare Match.
Connected
Disconnected
11
Set on Compare Match.
Connected
Disconnected
Table 16-7.
Compare Output Mode, Fast PWM Mode
COM1A1..0
OCW1A Behaviour
OC1A
OC1A
00
Normal port operation.
Disconnected
Disconnected
01
Cleared on Compare Match.
Set when TCNT1 = 0x000.
Connected
Connected
10
Cleared on Compare Match.
Set when TCNT1 = 0x000.
Connected
Disconnected
11
Set on Compare Match.
Cleared when TCNT1 = 0x000.
Connected
Disconnected