Motorola 009 User Manual Page 21

  • Download
  • Add to my manuals
  • Print
  • Page
    / 26
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 20
System Overview
DSP Subsystem Code
MOTOROLA
SHI Port Usage
2-9
with the data for the pins. Next, the accumulator is ORed with register x0
,
thus
combining the GPIO port data with the GPIO port settings. The fully constructed GPIO
port word is moved to the GPIO register and the external signals respond accordingly.
Finally, an RTI instruction is executed and program flow returns to the main program.
Example 2-2
DSP Application Software
page 132,66,3,3
opt cex,mex,cc,mu
title 'main'
section main
nolist
include 'ioequ.asm'
list
comment ~
********************************************************************************
Start of assembly code
********************************************************************************
~
org p:0
jmp <main ; jmp to main out of reset
org p:$24 ; receive FIFO not empty
jsr SHI_ISR ; jsr to SHI_ISR
org p:$2a ; receive FIFO overrun
jsr SHI_ISR ; jsr to SHI_ISR
org p:$80
main
movep #$000f00,x:<<GPIOR ; set all GPIO to outputs
bset #HRIE0,x:HCSR ; enab intrpt for FIFO not empty
movep #$003000,x:IPR ; set interrupt priority for SHI
andi #$fc,mr ; enable interrupts
jmp * ; idle state for main program
SHI_ISR
movep x:<<HRX,x0 ; get new received data
move #$000f00,a ; GPIO port val
or x0,a ; update data portion
movep a1,x:<<GPIOR ; output new GPIOR val
rti
endsec
Page view 20
1 2 ... 16 17 18 19 20 21 22 23 24 25 26

Comments to this Manuals

No comments