
357
42073A-MCU Wireless-02/13
ATmega2564/1284/644RFR2
The FOC2A bit is only active when the WGM bits specify a non-PWM mode. However,
for ensuring compatibility with future devices, this bit must be set to zero when TCCR2B
is written in PWM mode operation. When writing a logical one to the FOC2A bit, an
immediate Compare Match is forced on the Waveform Generation unit. The OC2A
output is changed according to its COM2A1:0 bits setting. Note that the FOC2A bit is
implemented as a strobe. Therefore it is the value present in the COM2A1:0 bits that
determines the effect of the forced compare. A FOC2A strobe will not generate any
interrupt, nor will it clear the timer in CTC mode using OCR2A as TOP. The FOC2A bit
is always read as zero.
Bit 6 – FOC2B - Force Output Compare B
The FOC2B bit is only active when the WGM bits specify a non-PWM mode. However,
for ensuring compatibility with future devices, this bit must be set to zero when TCCR2B
is written in PWM mode operation. When writing a logical one to the FOC2B bit, an
immediate Compare Match is forced on the Waveform Generation unit. The OC2B
output is changed according to its COM2B1:0 bits setting. Note that the FOC2B bit is
implemented as a strobe. Therefore it is the value present in the COM2B1:0 bits that
determines the effect of the forced compare. A FOC2B strobe will not generate any
interrupt, nor will it clear the timer in CTC mode using OCR2B as TOP. The FOC2B bit
is always read as zero.
Bit 5:4 – Res1:0 - Reserved
Bit 3 – WGM22 - Waveform Generation Mode
Combined with the WGM21:20 bits found in the TCCR2A Register, this bit controls the
counting sequence of the counter, the source for maximum (TOP) counter value, and
what type of waveform generation to be used. See description of "TCCR2A -
Timer/Counter2 Control Register A" for details.
Bit 2:0 – CS22:20 - Clock Select
The three Clock Select bits select the clock source to be used by the Timer/Counter2. If
external pin modes are used for the Timer/Counter2, transitions on the T2 pin will clock
the counter even if the pin is configured as an output. This feature allows software
control of the counting.
Table 21-10 CS2 Register Bits
Register Bits
Value
Description
CS22:20
0x00
No clock source (Timer/Counter2 stopped)
0x01
clkT2S/1 (no prescaling)
0x02
clkT2S/8 (from prescaler)
0x03
clkT2S/32 (from prescaler)
0x04
clkT2S/64 (from prescaler)
0x05
clkT2S/128 (from prescaler)
0x06
clkT2S/256 (from prescaler)
0x07
clkT2S/1024 (from prescaler)
21.11.5 TCNT2 – Timer/Counter2
Bit
7
6
5
4
3
2
1
0
NA ($B2)
TCNT27:20
TCNT2
Read/Write
RW
Initial Value
0