Motorola DSP96002 User Manual page 826

32-bit digital signal processor
Table of Contents

Advertisement

6.7.2
General purpose IO output
The following routine can be used to write the TIO1 output pin:
movep #$02800000,x:TCSR1
movep #$02a00000,x:TCSR1
movep #$02800000,x:TCSR1
This routine generates a pulse on the TIO1 pin with the duration equal to 8 CLK (assuming
no wait states, no external bus conflict etc.)
6.7.3
Standard timer mode (mode 0), input clock, no output and GPIO 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 TIO0
pin is toggled to signal end of task.
org p:$14
jsr task
....
org p:main_body
.....
movep #$42000000,x:TCSR0
movep #$42800000,x:TCSR0
movep #$0000ffff,x:TCR0
bset #24,x:IPR
andi #$cf,mr
bset #31,x:TCSR0
......
; application program
.....
task
.....
; task instructions
....
end_of_task
bset #22,x:TCSR0
bclr #22,x:TCSR0
rti
44
;clear TC2-TC0, set GPIO
;and set DIR for GPIO output, set TIO1 to 0
; set TIO1 to 1
; set TIO1 to 0
; this is timer 0 interrupt vector address
; go and execute task (long interrupt)
; enable timer interrupts and enable GPIO
; (input!) and set DO =0 to have stable data
; change DIR to output (clean 0, no spikes)
; load 64k -1 into the counter
; enable IPL for timer 0
; remove interrupt masking in status register
; timer enable
; set TIO0 to signal end of task
; clear TIO0
; return to main program
MOTOROLA

Advertisement

Table of Contents
loading

Table of Contents