SOFTWARE EXAMPLES
MOTOROLA
DSP56002 TIMER AND EVENT COUNTER
7 - 17
•
If the TCR is loaded with 0, and the counter contained a zero value prior to loading,
then after the timer is enabled, it will generate an interrupt for every event.
•
If the TCR is loaded with 0 after the timer has been enabled, the timer will be loaded
with 0 when the current count is completed and then generate an interrupt for every
new event.
7.8
SOFTWARE EXAMPLES
7.8.1
General Purpose I/O Input
The following routine can be used to read the TIO input pin:
MOVEP
#$000040,X:TCSR
;clear TC2-TC0, set GPIO
;and clear INV for GPIO input here
TE
TCR
Write Preload (N)
TIO (Event)
N
Counter
N
FFFF
0
Interrupt
First Event
Last Event
N+1
N+1
FFFF
0
Figure 7-12 Standard Time Counter Mode, External Clock (INV=0)
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
.
..