Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SPIslave:
- incf cnt, f
- btfsc status, z
- incf cnt_h, f
- ; skip
- movf cnt_h, w
- xorlw 0x00
- btfss status, z
- goto spiexit
- movf cnt, w
- xorlw 0x5
- btfsc status, z
- bsf flag, 0
- ;check skip
- btfss flag, 0
- goto spiexit
- incf cnt_byte, f
- ; overflow check
- MOVF cnt_byte, W
- XORLW 0x6A ; .106
- BTFSs STATUS, Z
- goto temp1
- bcf PIR1, SSPIF
- GOTO sendd
- temp1:
- ; simply counter
- ; bcf PIR1, SSPIF
- ; retfie
- ;
- movf SSPBUF, w
- movwf INDF
- INCF FSR, f
- ; additional address
- MOVF FSR, W
- XORLW 0x80
- BTFSS STATUS, Z
- GOTO NORMAL_OPERATION
- MOVLW 0xA0
- MOVWF FSR
- NORMAL_OPERATION:
- ;
- decfsz x5
- goto $+2
- call SPIReset
- ;
- spiexit:
- bcf PIR1, SSPIF
- ;decfsz cnt, f
- ;retfie
- ;else
- ;goto send
- retfie
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement