Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Сигнальный МП Motorola DSP56002.pdf
Скачиваний:
22
Добавлен:
26.05.2014
Размер:
2 Мб
Скачать
☆

Freescale Semiconductor, Inc.

Freescale Semiconductor, Inc.

TIMER/EVENT COUNTER MODES OF OPERATION

7.5.5 Timer Mode 5 (Period Measurement Mode)

Timer Mode 5 is defined by TC2-TC0 equal 101.

In Timer Mode 5, the counter is driven by a clock derived from the DSP’s internal clock divided by 2 (CLK/2). With the timer enabled (TE=1), the counter is loaded with the value contained by the TCR and starts incrementing. On each transition of the same polarity that occurs on TIO, the TS bit in TCSR is set and, if TIE is set, an interrupt is generated. The contents of the counter is loaded in the TCR. The user’s program can read the TCR and subtract consecutive values of the counter to determine the distance between TIO edges. The counter is not stopped and it continues to increment. The INV bit determines whether the period is measured between 0-to-1 transitions of TIO (INV=0), or between

1-to-0 transitions of TIO (INV=1). Figure 7-10 illustrates Timer Mode 5 when INV=0, and Figure 7-11 illustrates this mode with INV=1.

Last Event

First Event

Last Event New Event

TE

Clock (CLK/2)

TCR N

Counter 0 N N-1 0 N N-1

Interrupt

TIO

Figure 7-7 Standard Timer Mode, Internal Clock, Output Toggle Enable

7 - 12 DSP56002 TIMER AND EVENT COUNTER MOTOROLA

For More Information On This Product, Go to: www.freescale.com

Freescale Semiconductor, Inc.

Freescale Semiconductor, Inc.

TIMER/EVENT COUNTER MODES OF OPERATION

7.5.6 Timer Mode 6 (Standard Time Counter Mode, External Clock)

Time Mode 6 is defined by TC2-TC0 equal 110.

With the timer enabled (TE=1) the counter is loaded with the 1’s complement of the value contained by the TCR. The counter is incremented by the transitions on the incoming signal on the TIO input pin. After each increment, the counter value is loaded into the TCR. Thus, reading the TCR will give the value of the counter at any given moment. At the transition following the point where the counter reaches 0, the TS bit in TCSR is set and, if the TIE is set, an interrupt is generated.The counter will wrap around and the process is repeated until the timer is disabled (TE=0). The INV bit determines whether 0-to-1 transitions (INV=0) or 1-to-0 transitions (INV=1) will increment the counter. Figure 7-12 illustrates Timer Mode 6 when INV=0. Figure 7-13 illustrates Timer Mode 7 when INV=1.

Start Event

Stop Event

Start Event

TE

Clock

TCR

 

 

 

 

N

Counter

0

1

N-1

N

0

Interrupt

TIO

Figure 7-8 Pulse Width Measurement Mode (INV=0)

MOTOROLA DSP56002 TIMER AND EVENT COUNTER 7 - 13

For More Information On This Product, Go to: www.freescale.com

Соседние файлы в предмете Радиоприемные устройства