
88
ATtiny40 [DATASHEET]
8263B–AVR–01/2013
12.10 Register Description
12.10.1
TCCR1A – Timer/Counter1 Control Register A
Bit 7 – TCW1: Timer/Counter1 Width
is set to 16-bits and the Output Compare Registers OCR1A and OCR1B are combined to form one 16-bit Output
Compare Register. Because the 16-bit registers TCNT1H/L and OCR1B/A are accessed by the AVR CPU via the
8-bit data bus, special procedures must be followed. These procedures are described in section
“Accessing Regis- Bit 6 – ICEN1: Input Capture Mode Enable
When this bit is written to one, the Input Capture Mode is enabled.
Bit 5 – ICNC1: Input Capture Noise Canceler
Setting this bit activates the Input Capture Noise Canceler. When the noise canceler is activated, the input from the
Input Capture Pin (ICP1) is filtered. The filter function requires four successive equal valued samples of the ICP1
pin for changing its output. The Input Capture is therefore delayed by four System Clock cycles when the noise
canceler is enabled.
Bit 4 – ICES1: Input Capture Edge Select
This bit selects which edge on the Input Capture Pin (ICP1) that is used to trigger a capture event. When the
ICES1 bit is written to zero, a falling (negative) edge is used as trigger, and when the ICES1 bit is written to one, a
rising (positive) edge will trigger the capture. When a capture is triggered according to the ICES1 setting, the coun-
ter value is copied into the Input Capture Register. The event will also set the Input Capture Flag (ICF1), and this
can be used to cause an Input Capture Interrupt, if this interrupt is enabled.
Bit 3 – CTC1: Waveform Generation Mode
This bit controls the counting sequence of the counter, the source for maximum (TOP) counter value, see
Figure12-5 on page 83. Modes of operation supported by the Timer/Counter unit are: Normal mode (counter) and Clear
Bits 2:0 – CS1[2:0]: Clock Select1, Bits 2, 1, and 0
The Clock Select1 bits 2, 1, and 0 define the prescaling source of Timer1.
Bit
76543210
TCW1
ICEN1
ICNC1
ICES1
CTC1
CS12
CS11
CS10
TCCR1A
Read/Write
R/W
Initial Value
00000000
Table 12-4.
Clock Select Bit Description
CS12
CS11
CS10
Description
0
No clock source (Timer/Counter stopped)
001
clkI/O/(No prescaling)
010
clkI/O/8 (From prescaler)
011
clkI/O/64 (From prescaler)
100
clkI/O/256 (From prescaler)