From 37b5fe39f23067e6a3fc0beb9e40457298bfcba0 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sat, 28 Jan 2012 15:44:06 +0000 Subject: added aknowledge pulse to ihu-ttx communication git-svn-id: https://svn.spreadspace.org/mur.sat@239 7de4ea59-55d0-425e-a1af-a3118ea81d4c --- software/ihu/ttx.inc | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'software/ihu/ttx.inc') diff --git a/software/ihu/ttx.inc b/software/ihu/ttx.inc index b9f45e7..2098340 100644 --- a/software/ihu/ttx.inc +++ b/software/ihu/ttx.inc @@ -108,7 +108,7 @@ ttx_send_frame movf TTX_BYTE_CNT,f btfsc STATUS,Z - return + goto ttx_get_csum ttx_next_byte call ttx_break @@ -119,16 +119,31 @@ ttx_next_byte decfsz TTX_BYTE_CNT,f goto ttx_next_byte +ttx_get_csum call ttx_break call ttx_recv_byte movf TTX_BYTE,w xorwf TTX_CSUM,w btfss STATUS,Z goto ttx_csum_error - return + retlw .0 ttx_csum_error - ;; TODO: react to comm error - return + retlw .1 ;; ------------------------------------- +ttx_send + call ttx_send_frame + movwf TTX_BYTE + call ttx_break + btfsc TTX_BYTE,0 + bcf PORTD,TTX_SDA + btfss TTX_BYTE,0 + bsf PORTD,TTX_SDA + bsf PORTD,TTX_SCL + nop + nop + nop + bcf PORTD,TTX_SCL + return + ;; ------------------------------------- -- cgit v1.2.3