Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
34
Добавлен:
27.04.2015
Размер:
1.98 Mб
Скачать

Timer Programming Model

Table 9-5. ES[1:0] Bit Definition

ES[1:0]

Clock Selected

 

 

 

 

00

Internal Phi clock/4

 

 

01

Internal prescaler clock

 

 

10

Previous timer overflow

 

 

11

External event from TIO pin

 

 

NOTE:

For Timer 0, setting the ES[1:0] bits to 10 causes the clock source to be pulled low, and no signal is applied to the timer. This is because no previous timer is available.

When a timer is clocked using the slower clock from the prescaler divider, it can continue counting even when the DSP56800 core is in stop mode.

9.1.1.6 Reserved TCR Bits

Bits 14, 13, and 5 of TCR01 are reserved and are read as zero during read operations. These bits should be written with zero for future compatibility. Bits 15–8 and 5 of TCR2 are reserved and are read as zero during read operations. These bits should be written with zero for future compatibility.

9.1.2 Timer Preload Register (TPR)

The timer preload register (TPR) is a 16-bit write-only register that contains the value to be reloaded into the count register when a timer is enabled and when the (TCT) register has decremented to zero. Three preload registers are provided, one for each timer.

The timer must be disabled (its TE bit in TCR01 or TRC2 is cleared) when the user program writes a new value to its TPR. This new value transfers immediately into the TCT register (described in the following section) unless a direct write to the TCT register has already been performed.

NOTE:

The TPR can be written only when the corresponding timer is disabled (its

TE bit cleared) in the TCR.

Because the TPR is write-only and cannot be read, reading its value can be accomplished by writing the TPR with the TE bit cleared and then reading the corresponding count register (with the TE bit cleared). The TPRs are initialized to zero on reset.

9.1.3 Timer Count Register (TCT)

The timer count (TCT) register is a 16-bit read/write register that contains the count for a timer. Three count registers are provided, one for each timer.

When a timer is enabled (its TE bit in the TCR01 or TRC2 is set), its TCT register is decremented by one with each clock. On the next event after the count register reaches zero, an overflow interrupt is generated if the OIE bit is set in the timer control register. Also, the state of the TIO pin can then be affected according to the mode selected by the TO[1:0] bits of the timer control register. If n is the value stored in

Timers 9-7

Соседние файлы в папке DSP568xx