Hardware Reference
In-Depth Information
Und weil es einfacher zu programmieren ist, wird der zweite Term noch unter
Anwendung des De Morgan-Gesetzes umgeformt. Damit ergibt sich:
RQS = (SRE
STB)
¬( STBp
SREp)
Diese Regel gilt für alle Bits innerhalb der Register, weswegen die vollständigen
Registerinhalte gemeinsam bearbeitet werden können. Im Folgenden ist die Bear-
beitung in der Software des Beispielgeräts mithilfe des Unterprogramms „compu-
teRQS“ dargestellt.
; check if a „new reason for service“ has occurred
computeRQS
movff SREp,WREG
andwf STBp,0
comf WREG
andwf STB,0
andwf SRE,0
bz RQSzero
; set RQS means: insert a request for service into the interrupt IN endpoint
call
TransmitSRQ
return
RQSzero
; do nothing
return
;******************************************************************************
; Transmit the Status Byte at a service request via Interrupt IN endpoint
;******************************************************************************
TransmitSRQ
call
computeMSS
;actualize mss bit in STB
movlw 0x80
movff WREG,FSR0L
movlw 0x05
movff WREG,FSR0H
movwf 0x01 ;this is the bTag due to an SRQ condition
bsf WREG,07
movff WREG,POSTINC0
movff STB,INDF0
movlw 0x1D
movff WREG,FSR0L
movlw 0x04
movff WREG,FSR0H
movlw 0x02
movff WREG,POSTDEC0
movlw 0x00
cpfseq INTR_IN
bra
srqpacket1
bra
srqpacket0
srqpacket1
movlw B'11000000'
Search WWH ::




Custom Search