Datasheet

110
8006H–AVR–10/09
ATtiny24/44/84
Bit 1:0 – WGM11:0: 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 wave-
form generation to be used, see Table 12-5 on page 110. 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. (“Modes of Operation” on page 96).
12.11.2 TCCR1B – Timer/Counter1 Control Register B
Bit 7 – ICNC1: 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 (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 Oscillator cycles when the noise canceler is enabled.
Bit 6 – 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.
Table 12-5. W aveform Generation Modes
Mode
WGM
13:10
Mode of
Operation TOP
Update of
OCR1x at
TOV1 Flag
Set on
00000Normal 0xFFFF Immediate MAX
10001PWM, Phase Correct, 8-bit 0x00FF TOP BOTTOM
20010PWM, Phase Correct, 9-bit 0x01FF TOP BOTTOM
30011PWM, Phase Correct, 10-bit 0x03FF TOP BOTTOM
40100CTC (
Clear Timer on Compare) OCR1A Immediate MAX
50101Fast PWM, 8-bit 0x00FF TOP TOP
60110Fast PWM, 9-bit 0x01FF TOP TOP
70111Fast PWM, 10-bit 0x03FF TOP TOP
81000PWM, Phase & Freq. Correct ICR1 BOTTOM BOTTOM
91001PWM, Phase & Freq. Correct OCR1A BOTTOM BOTTOM
10 1010 PWM, Phase Correct ICR1 TOP BOTTOM
11 1011 PWM, Phase Correct OCR1A TOP BOTTOM
12 1100 CTC (
Clear Timer on Compare) ICR1 Immediate MAX
13 1101 (Reserved)
14 1110 Fast PWM ICR1 TOP TOP
15 1111 Fast PWMOCR1ATOPTOP
Bit 76543210
0x2E (0x4E) ICNC1 ICES1 WGM13 WGM12 CS12 CS11 CS10 TCCR1B
Read/Write R/W R/W RR/W R/W R/W R/W R/W
Initial Value 0 0 0 0 0 0 0 0