debughf_subroutine
call debughf_digit
- swapf DEBUGHF_VALUE,1,0
call debughf_digit
return
;--------------------
debughf_digit
-; transmits bottom nybble of DEBUGHF_VALUE in hex
-; through serial port, as above
+; transmits top nybble of DEBUGHF_VALUE in hex
+; through serial port, as above, and swaps nybbles
; Before After
; W any undefined
-; DEBUGHF_VALUE xxxxDDDD preserved
+; DEBUGHF_VALUE BBBBaaaa aaaaBBBB (BBBB was sent)
+ swapf DEBUGHF_VALUE,1,0
movf DEBUGHF_VALUE,0,0
andlw 0x0f
sublw 10
debug 'f'
- btfss SSPCON2,ACKSTAT,0 ; check for ack from slave (=0), if no
+ btfsc SSPCON2,ACKSTAT,0 ; check for ack from slave (=0), if no
goto panic ; then panic, else
movff RCREG,SSPBUF ; copy byte from serial to i2c buffer
call wait_for_i2c_interrupt
- btfss SSPCON2,ACKSTAT,0 ; check for ack from slave (=0), if no
+ btfsc SSPCON2,ACKSTAT,0 ; check for ack from slave (=0), if no
goto panic ; then panic, else
bsf SSPCON2,PEN,0 ; i2c STOP
call wait_for_i2c_interrupt