summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@mur.at>2011-07-27 00:39:07 +0000
committerChristian Pointner <equinox@mur.at>2011-07-27 00:39:07 +0000
commite34f4cef5b441e5c4d69404e78166355a78e6162 (patch)
treedc119b8b9ade4e8910fb3ad0f4c0aa55bbf05473
parentihu-ttx implement read of csum @ihu (not yet tested) (diff)
ttx <-> ihu communication include checksum/ack works now
git-svn-id: https://svn.spreadspace.org/mur.sat@64 7de4ea59-55d0-425e-a1af-a3118ea81d4c
-rw-r--r--doc/protocols/ihu-ttx.txt6
-rw-r--r--software/ihu/ihu.asm17
-rw-r--r--software/ttx/ttx.asm28
3 files changed, 40 insertions, 11 deletions
diff --git a/doc/protocols/ihu-ttx.txt b/doc/protocols/ihu-ttx.txt
index 9eb46e9..cde59d7 100644
--- a/doc/protocols/ihu-ttx.txt
+++ b/doc/protocols/ihu-ttx.txt
@@ -47,13 +47,15 @@ Commands
~~~~~~~
This tells the TTX to shut up. The TTX will send out one aknowledge over cw and after
- that disables any further broadcasts.
+ that disables any further broadcasts. The 1 octet of data contains the ASCII code to
+ use for the CW aknowledge.
Hex '1'
~~~~~~~
This is the reverse of the '0' command. The TTX will send out an aknowledge over cw
- and reenables broadcasting of beacons.
+ and reenables broadcasting of beacons. The 1 octet of data contains the ASCII code to
+ use for the CW aknowledge.
Hex '2'
~~~~~~~
diff --git a/software/ihu/ihu.asm b/software/ihu/ihu.asm
index 8951980..848b25e 100644
--- a/software/ihu/ihu.asm
+++ b/software/ihu/ihu.asm
@@ -225,6 +225,7 @@ ttx_recv_byte
movlw .8
movwf TTX_BIT_CNT
ttx_recv_next_bit
+ rlf TTX_BYTE,f
bsf PORTD,TTX_SCL
nop
nop
@@ -232,17 +233,17 @@ ttx_recv_next_bit
bcf PORTD,TTX_SCL
nop
nop
+ nop
+ nop
+ nop
btfsc PORTD,TTX_SDA
bsf TTX_BYTE,0
btfss PORTD,TTX_SDA
bcf TTX_BYTE,0
- nop
- nop
- rlf TTX_BYTE,f
decfsz TTX_BIT_CNT,f
goto ttx_recv_next_bit
return
-
+
;; -------------------------------------
ttx_break
movlw .13
@@ -285,13 +286,13 @@ ttx_next_byte
xorwf TTX_CSUM,w
btfss STATUS,Z
goto ttx_csum_error
+ movlw '.'
+ movwf TXREG
return
ttx_csum_error
- bcf PORTD,TTX_RESET ;reset TTX
- nop
- nop
- bsf PORTD,TTX_RESET
+ movlw 'E'
+ movwf TXREG
return
;; -------------------------------------
diff --git a/software/ttx/ttx.asm b/software/ttx/ttx.asm
index 2fe0268..260314d 100644
--- a/software/ttx/ttx.asm
+++ b/software/ttx/ttx.asm
@@ -141,7 +141,7 @@ ext_int_next
goto ext_int_next
ext_int_send_csum
- ;; TODO: send out csum
+ call rx_send_csum
movf RX_FSR_TMP,w
movwf FSR
swapf RX_CMD,w
@@ -442,6 +442,32 @@ rx_byte_next
goto rx_byte_clk_high
;; -------------------------------------
+rx_send_csum
+ bsf STATUS,RP0
+ bcf TRISIO,SDAT
+ bcf STATUS,RP0
+ movlw .8
+ movwf RX_BIT_CNT
+rx_send_clk_high
+ btfss GPIO,SCLK
+ goto rx_send_clk_high
+ btfss RX_CSUM,7
+ bcf GPIO,SDAT
+ btfsc RX_CSUM,7
+ bsf GPIO,SDAT
+ decfsz RX_BIT_CNT,f
+ goto rx_send_next
+
+ bsf STATUS,RP0
+ bsf TRISIO,SDAT
+ bcf STATUS,RP0
+ return
+
+rx_send_next
+ rlf RX_CSUM,f
+ goto rx_send_clk_high
+
+ ;; -------------------------------------
dottime
movwf TMR0
bcf INTCON,T0IF