summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@mur.at>2012-01-30 16:20:54 +0000
committerChristian Pointner <equinox@mur.at>2012-01-30 16:20:54 +0000
commit41667b2f3fb80a3b0c020727012d2946e9e5a367 (patch)
treebedf3615f5753b332084b2b966706feee4316ac4
parentfixed ack pulse (diff)
try slower mode for ihu-ttx communcation
git-svn-id: https://svn.spreadspace.org/mur.sat@242 7de4ea59-55d0-425e-a1af-a3118ea81d4c
-rw-r--r--software/ihu/ttx.inc72
-rw-r--r--software/ttx/ttx.asm21
2 files changed, 84 insertions, 9 deletions
diff --git a/software/ihu/ttx.inc b/software/ihu/ttx.inc
index 82b8d14..6c05672 100644
--- a/software/ihu/ttx.inc
+++ b/software/ihu/ttx.inc
@@ -46,11 +46,32 @@ ttx_send_next_bit
nop
nop
nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
bcf PORTD,TTX_SCL
nop
nop
nop
nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
rlf TTX_BYTE,f
decfsz TTX_BIT_CNT,f
goto ttx_send_next_bit
@@ -68,12 +89,36 @@ ttx_recv_next_bit
nop
nop
nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
bcf PORTD,TTX_SCL
nop
nop
nop
nop
nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
rlf TTX_BYTE,f
btfsc PORTD,TTX_SDA
bsf TTX_BYTE,0
@@ -135,23 +180,44 @@ ttx_csum_error
ttx_send
call ttx_send_frame
movwf TTX_BYTE
+ movwf TXREG
call ttx_break
+ bsf PORTD,TTX_SDA
bsf STATUS,RP0
bcf TRISD,TTX_SDA
bcf STATUS,RP0
- btfsc TTX_BYTE,0
- bcf PORTD,TTX_SDA
btfss TTX_BYTE,0
- bsf PORTD,TTX_SDA
+ bcf PORTD,TTX_SDA
bsf PORTD,TTX_SCL
nop
nop
nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
bcf PORTD,TTX_SCL
nop
nop
nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
bsf STATUS,RP0
bsf TRISD,TTX_SDA
bcf STATUS,RP0
diff --git a/software/ttx/ttx.asm b/software/ttx/ttx.asm
index e579a3b..1580f34 100644
--- a/software/ttx/ttx.asm
+++ b/software/ttx/ttx.asm
@@ -151,9 +151,12 @@ ext_int_send_csum
swapf RX_CMD,w
andlw b'00001111'
movwf RX_CMD
-ext_int_wait_ack
+ext_int_wait_ack_low
+ btfsc GPIO,SCLK
+ goto ext_int_wait_ack_low
+ext_int_wait_ack_high
btfss GPIO,SCLK
- goto ext_int_wait_ack
+ goto ext_int_wait_ack_high
btfss GPIO,SDAT
bsf RX_STATE,complete
bsf STATUS,RP0
@@ -423,6 +426,9 @@ rx_byte
movlw .8
movwf RX_BIT_CNT
clrf INDF
+rx_byte_clk_low
+ btfsc GPIO,SCLK
+ goto rx_byte_clk_low
rx_byte_clk_high
btfss GPIO,SCLK
goto rx_byte_clk_high
@@ -437,7 +443,7 @@ rx_byte_clk_high
rx_byte_next
rlf INDF,f
- goto rx_byte_clk_high
+ goto rx_byte_clk_low
;; -------------------------------------
rx_send_csum
@@ -446,6 +452,9 @@ rx_send_csum
bcf STATUS,RP0
movlw .8
movwf RX_BIT_CNT
+rx_send_clk_low
+ btfsc GPIO,SCLK
+ goto rx_send_clk_low
rx_send_clk_high
btfss GPIO,SCLK
goto rx_send_clk_high
@@ -463,7 +472,7 @@ rx_send_clk_high
rx_send_next
rlf RX_CSUM,f
- goto rx_send_clk_high
+ goto rx_send_clk_low
;; -------------------------------------
dottime
@@ -795,12 +804,12 @@ seccnt_zero
movf BEACON_INT,w
movwf SECCNT
btfss NVSTATE,safe
- call send_beacon
+ ;; call send_beacon
goto powerdown
;; this gets called whenever a message was received from ihu
msg_received
- call send_ack
+ ;; call send_ack
bcf RX_STATE,complete
clrf RX_STATE