TIMER/EVENT COUNTER MODES OF OPERATION
7 - 12
DSP56002 TIMER AND EVENT COUNTER
MOTOROLA
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.
TE
TCR
Last Event
N
Counter
N
0
N
Interrupt
First Event
Last Event
N-1
TIO
New Event
N-1
0
Clock (CLK/2)
Figure 7-7 Standard Timer Mode, Internal Clock, Output Toggle Enable
F
re
e
sc
a
le
S
e
m
ic
o
n
d
u
c
to
r,
I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
c
.
..