13.10.2 Timer/Counter1 Control Register B – TCCR1B
Bit
7
ICNC1
R/W
0
6
ICES1
R/W
0
5
4
3
2
CS12
R/W
0
1
CS11
R/W
0
0
CS10
R/W
0
RTGEN WGM13 WGM12
TCCR1B
Read/Write
Initial Value
R
0
R/W
0
R/W
0
• Bit 7 – ICNCn: Input Capture Noise Canceler
Setting this bit (to one) activates the input capture noise canceler. When the noise canceler is activated, the input from the
input capture pin (ICPn) is filtered. The filter function requires four successive equal valued samples of the ICPn pin for
changing its output. The input capture is therefore delayed by four oscillator cycles when the noise canceler is enabled.
• Bit 6 – ICESn: Input Capture Edge Select
This bit selects which edge on the input capture pin (ICPn) that is used to trigger a capture event. When the ICESn bit is
written to zero, a falling (negative) edge is used as trigger, and when the ICESn bit is written to one, a rising (positive) edge
will trigger the capture.
When a capture is triggered according to the ICESn setting, the counter value is copied into the input capture register
(ICRn). The event will also set the input capture flag (ICFn), and this can be used to cause an input capture interrupt, if this
interrupt is enabled.
When the ICRn is used as TOP value (see description of the WGMn3:0 bits located in the TCCRnA and the TCCRnB
register), the ICPn is disconnected and consequently the input capture function is disabled.
• Bit 5 – RTGEN
Set this bit to enable the ICP1A as a Timer/Counter retrigger input.
(This bit is reserved for future use. For ensuring compatibility with future devices, this bit must be written to zero when
TCCRnB is written.)
• Bit 4:3 – WGMn3:2: Waveform Generation Mode
See TCCRnA register description.
• Bit 2:0 – CSn2:0: Clock Select
The three clock select bits select the clock source to be used by the Timer/Counter, see Figure 13-10 and Figure 13-11.
Table 13-5. Clock Select Bit Description
CSn2
CSn1
CSn0
Description
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
No clock source (Timer/Counter stopped).
clkI/O/1 (no prescaling)
clkI/O/8 (from prescaler)
clkI/O/64 (from prescaler)
clkI/O/256 (from prescaler)
clkI/O/1024 (from prescaler)
External clock source on Tn pin. Clock on falling edge.
External clock source on Tn pin. Clock on rising edge.
If external pin modes are used for the Timer/Countern, transitions on the Tn pin will clock the counter even if the pin is
configured as an output. This feature allows software control of the counting.
112
ATmega16/32/64/M1/C1 [DATASHEET]
7647O–AVR–01/15