SOFTWARE EXAMPLES
MOTOROLA
DSP56002 TIMER AND EVENT COUNTER
7 - 19
NOP
BCLR
#DO,X:TCSR
;set TIO to 0
This routine generates a pulse on the TIO pin with the duration equal to 8 CLK (assuming
no wait states, no external bus conflict, etc.)
7.8.3
Timer Mode 0, Input Clock, GPIO Output, and No Timer Output
The following program illustrates the standard timer mode with simultaneous GPIO. The
timer is used to activate an internal task after 65536 clocks; at the end of the task the TIO
pin is toggled to signal end of task.
ORG
P:$3C
;this is timer interrupt vector address
JSR
TASK
;go and execute task (long interrupt)
ORG
P:MAIN_BODY
TE
TCR
Write Preload (N)
TIO (Event)
N
Counter
N
0
N
Interrupt
First Event
Last Event
N-1
Figure 7-14 Standard Timer 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
.
..