From: ian Date: Mon, 14 Feb 2005 02:48:17 +0000 (+0000) Subject: die correctly if _lack_ of ack; debug values right way round X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=3bca88d90f9bddd36c16e8193bb574d51b087182;p=trains.git die correctly if _lack_ of ack; debug values right way round --- diff --git a/cebpic/i2c-test.asm b/cebpic/i2c-test.asm index 86f54c8..fa92b70 100644 --- a/cebpic/i2c-test.asm +++ b/cebpic/i2c-test.asm @@ -118,18 +118,18 @@ debughf macro register 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 @@ -263,11 +263,11 @@ serial_rx_isr 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