Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
ATtiny2313A ATtiny4313.pdf
Скачиваний:
41
Добавлен:
11.05.2015
Размер:
6.13 Mб
Скачать

ATtiny2313A/4313

12.2.3Compatibility

The 16-bit Timer/Counter has been updated and improved from previous versions of the 16-bit AVR Timer/Counter. This 16-bit Timer/Counter is fully compatible with the earlier version regarding:

All 16-bit Timer/Counter related I/O Register address locations, including Timer Interrupt Registers.

Bit locations inside all 16-bit Timer/Counter Registers, including Timer Interrupt Registers.

Interrupt Vectors.

The following control bits have changed name, but have same functionality and register location:

PWM10 is changed to WGM10.

PWM11 is changed to WGM11.

CTC1 is changed to WGM12.

The following bits are added to the 16-bit Timer/Counter Control Registers:

FOC1A and FOC1B are added to TCCR1A.

WGM13 is added to TCCR1B.

The 16-bit Timer/Counter has improvements that will affect the compatibility in some special cases.

12.3Timer/Counter Clock Sources

The Timer/Counter can be clocked by an internal or an external clock source. The clock source is selected by the Clock Select logic which is controlled by the Clock Select (CS12:0) bits located in the Timer/Counter control Register B (TCCR1B). For details on clock sources and prescaler, see “Timer/Counter0 and Timer/Counter1 Prescalers” on page 118.

12.4Counter Unit

The main part of the 16-bit Timer/Counter is the programmable 16-bit bi-directional counter unit. Figure 12-2 shows a block diagram of the counter and its surroundings.

Figure 12-2. Counter Unit Block Diagram

DATA BUS (8-bit)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

TOVn

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(Int.Req.)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

TEMP (8-bit)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Clock Select

 

 

 

 

 

 

 

 

 

 

 

Count

 

 

 

 

 

 

 

 

 

 

Edge

 

 

 

 

Tn

 

TCNTnH (8-bit)

TCNTnL (8-bit)

 

 

 

Clear

Control Logic

clkTn

 

 

 

Detector

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

TCNTn (16-bit Counter)

 

 

 

Direction

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

( From Prescaler )

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

TOP

BOTTOM

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Signal description (internal signals):

Count

Increment or decrement TCNT1 by 1.

Direction

Select between increment and decrement.

Clear

Clear TCNT1 (set all bits to zero).

91

8246B–AVR–09/11

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]