beautypg.com

10 register description, 1 tccr0a - timer/counter0 control register a – Rainbow Electronics ATtiny861_V User Manual

Page 84

background image

84

2588B–AVR–11/06

ATtiny261/461/861

14.10 Register Description

14.10.1

TCCR0A – Timer/Counter0 Control Register A

• Bit 7– TCW0: Timer/Counter0 Width

When this bit is written to one 16-bit mode is selected as described

Figure 14-5 on page 78

.

Timer/Counter0 width is set to 16-bits and the Output Compare Registers OCR0A and OCR0B
are combined to form one 16-bit Output Compare Register. Because the 16-bit registers
TCNT0H/L and OCR0B/A are accessed by the AVR CPU via the 8-bit data bus, special proce-
dures must be followed. These procedures are described in section

”Accessing Registers in 16-

bit Mode” on page 80

.

• Bit 6– ICEN0: Input Capture Mode Enable

When this bit is written to onem, the Input Capture Mode is enabled.

• Bit 5 – ICNC0: Input Capture Noise Canceler

Setting this bit activates the Input Capture Noise Canceler. When the noise canceler is acti-
vated, 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 System Clock cycles when the noise canceler is enabled.

• Bit 4 – 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 cap-
ture is triggered according to the ICES0 setting, the counter value is copied into the Input
Capture Register. 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.

• Bit 3 - ACIC0: Analog Comparator Input Capture Enable

When written logic one, this bit enables the input capture function in Timer/Counter0 to be trig-
gered by the Analog Comparator. The comparator output is in this case directly connected to the
input capture front-end logic, making the comparator utilize the noise canceler and edge select
features of the Timer/Counter0 Input Capture interrupt. When written logic zero, no connection
between the Analog Comparator and the input capture function exists. To make the comparator
trigger the Timer/Counter0 Input Capture interrupt, the TICIE0 bit in the Timer Interrupt Mask
Register (TIMSK) must be set.

• Bits 2:1 – Res: Reserved Bits

These bits are reserved bits in the ATtiny261/461/861 and will always read as zero.

• Bit 0 – WGM00: Waveform Generation Mode

This bit controls the counting sequence of the counter, the source for maximum (TOP) counter
value, see

Figure 14-5 on page 78

. Modes of operation supported by the Timer/Counter unit are:

Bit

7

6

5

4

3

2

1

0

0x15 (0x35)

TCW0

ICEN0

ICNC0

ICES0

ACIC0

WGM00

TCCR0A

Read/Write

R/W

R/W

R/W

R/W

R/W

R

R

R/W

Initial Value

0

0

0

0

0

0

0

0