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

Timers

Example 9-3. Timer Using 25% Duty Cycle (Continued)

;**********************

 

;* Timer Module setup *

 

;**********************

 

MOVEP

#$0C0C,X:TCR01

; Configure:

 

 

; Timer 0 & 1 disabled

 

 

; Timer 0 & 1

 

 

; -- don’t Invert TIO input: detect rising edges

 

 

; (irrelevant but mentioned for completeness)

 

 

; -- Overflow Interrupt disabled

 

 

; -- Timer Output toggles TIO pin on overflow

 

 

; -- timer clock Event source is Phi Clock /4

MOVEP

#$0000,X:TCR2

; Timer 2 disabled

 

 

; Setup Timer 0 & 1 for 25% duty cycle:

 

 

; high for first 25 of 100 events

MOVEP

#00,X:TCT0

; Set Timer 0 Count Register to 00.

MOVEP

#99,X:TPR0

; Set Timer 0 Preload Register to 99.

MOVEP

#25,X:TCT1

; Set Timer 1 Count Register to 25.

MOVEP

#99,X:TPR1

; Set Timer 1 Preload Register to 99.

BFCLR

#$0800,X:IPR

; Disable Timer Module interrupts.

 

 

; (superfluous but done for thoroughness)

 

 

; ...

BFSET

#$8080,X:TCR01

; Enable Timer 0 & 1

;****************

 

;* Main routine *

 

;****************

; ...

 

 

TEST

 

; Test Loop

BRA

TEST

 

 

 

 

9.5 Timer Module Low-Power Operation

In applications requiring minimum power consumption, there are several options for lowering the power consumption of the chip using the timer module:

Turn off the entire timer module.

Turn off timers not in use.

Lower the timer frequency.

Run a timer in wait mode.

Run a timer in stop mode.

The following sections discuss these options individually.

9.5.1 Turning Off the Entire Timer Module

If the timer module is not required by an application, it is possible to shut off the entire module for the lowest power consumption by clearing all the TE bits in TCR01 and TCR2 and setting all the ES[1:0] bits to 01 in these same registers. This provides the prescaler clock to the timers, which is the lowest power setting possible when using the ES bits.

If no other module on the DSP56824 is using the prescaler clock, it is possible to further reduce the overall power consumption by shutting down the prescaler divider that generates this clock. See Section 10.2.1.6, “Prescaler Divider (PS[2:0])—Bits 10–8,” on page 10-6 for more information.

9-14

DSP56824 User’s Manual

 

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