Figure428 receive data from host—main program, Figure 4-28, Receive data from host—main program -53 – Motorola DSP56012 User Manual
Page 133: Figure 4-29, Receive data from host interrupt routine -53, The receive routine in
Parallel Host Interface
Host Interface (HI)
MOTOROLA
DSP56012 User’s Manual
4-53
The process to execute an HC (see
1. The host processor writes the CVR with the desired HV (the HV is the DSP’s
interrupt vector (IV) location divided by two, i.e., if HV = $17, IV = $34).
2. The HC bit is then set.
3. The HCP bit in the HSR is set when the HC bit is set.
4. If the HCIE bit in the HCR has been set by the DSP, the HC interrupt
processing will start. The HV is multiplied by 2 and the result is used by the
DSP as the interrupt vector.
5. When the HC interrupt is acknowledged, the HC bit (and therefore the HCP
bit) is cleared by the HC logic. HC can be read by the host processor as a status
bit to determine when the command is accepted. Similarly, the HCP bit can be
read by the DSP CPU to determine if an HC is pending.
To guarantee a stable interrupt vector, write HV only when HC is clear. The HC bit
and HV can be written simultaneously. The host processor can clear the HC bit to
cancel a host command at any time before the DSP interrupt is accepted. Although
the HV can be programmed to any interrupt vector, it is not recommended that
HV = 0 (RESET) be used because it does not reset the DSP hardware. DMA must be
disabled to use the host interrupt.
Figure 4-28 Receive Data from Host—Main Program
Figure 4-29 Receive Data from Host Interrupt Routine
;****************************************
; MAIN PROGRAM... receive data from host
;****************************************
ORG
P:$80
MOVE
#0,R0
MOVE
#3,M0
MOVEP
#1,X:PBC
;Enable HI
MOVEP
#0,X:HCR
;Turn off XMT and RCV interrupts
MOVEP
#$0C00,X:IPR
;Turn on host interrupt
MOVE
#0,SR
;Unmask interrupts
JCLR
#3,X:HSR,*
;Wait for HF0 (from host) set
MOVEP
#$1,X:HGR
;Enable host receive interrupt
JMP
*
;Now wait for interrupt
;************************************
; Receive from Host Interrupt Routine
;************************************
MOVEP
X:HORX,X:(R0)+;Receive data.
RTI
END