74
ATtiny4/5/9/10 [DATASHEET]
8127F–AVR–02/2013
ported by the Timer/Counter unit are: Normal mode (counter), Clear Timer on Compare match (CTC) mode, and
11.11.2
TCCR0B – Timer/Counter0 Control Register B
Bit 7 – ICNC0: 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 (ICP0) is filtered. The filter function requires four successive equal valued samples of
the ICP0 pin for changing its output. The Input Capture is therefore delayed by four oscillator cycles when the noise
canceler is enabled.
Bit 6 – ICES0: Input Capture Edge Select
This bit selects which edge on the Input Capture pin (ICP0) that is used to trigger a capture event. When the ICES0
bit is written to zero, a falling (negative) edge is used as trigger, and when the ICES0 bit is written to one, a rising
(positive) edge will trigger the capture.
When a capture is triggered according to the ICES0 setting, the counter value is copied into the Input Capture Reg-
ister (ICR0). The event will also set the Input Capture Flag (ICF0), and this can be used to cause an Input Capture
Interrupt, if this interrupt is enabled.
Table 11-5.
Waveform Generation Modes
Mode
WGM
0
3:0
Mode of Operation
TOP
Update of
OCR0
x at
TOV0 Flag
Set on
0
0000
Normal
0xFFFF
Immediate
MAX
1
0001
PWM, Phase Correct, 8-bit
0x00FF
TOP
BOTTOM
2
0010
PWM, Phase Correct, 9-bit
0x01FF
TOP
BOTTOM
3
0011
PWM, Phase Correct, 10-bit
0x03FF
TOP
BOTTOM
40100
CTC (
Clear Timer on Compare)
OCR0A
Immediate
MAX
5
0101
Fast PWM, 8-bit
0x00FF
TOP
6
0110
Fast PWM, 9-bit
0x01FF
TOP
7
0111
Fast PWM, 10-bit
0x03FF
TOP
8
1000
PWM, Phase & Freq. Correct
ICR0
BOTTOM
9
1001
PWM, Phase & Freq. Correct
OCR0A
BOTTOM
10
1010
PWM, Phase Correct
ICR0
TOP
BOTTOM
11
1011
PWM, Phase Correct
OCR0A
TOP
BOTTOM
12
1100
CTC (
Clear Timer on Compare)
ICR0
Immediate
MAX
13
1101
(Reserved)
–
14
1110
Fast PWM
ICR0
TOP
15
1111
Fast PWM
OCR0A
TOP
Bit
765
4
3
2
1
0
ICNC0
ICES0
–
WGM03
WGM02
CS02
CS01
CS00
TCCR0B
Read/Write
R/W
R
R/W
Initial Value
0