summaryrefslogtreecommitdiff
path: root/software/ttx/ttx.asm
diff options
context:
space:
mode:
Diffstat (limited to 'software/ttx/ttx.asm')
-rw-r--r--software/ttx/ttx.asm71
1 files changed, 43 insertions, 28 deletions
diff --git a/software/ttx/ttx.asm b/software/ttx/ttx.asm
index e01374c..fcffa42 100644
--- a/software/ttx/ttx.asm
+++ b/software/ttx/ttx.asm
@@ -38,12 +38,10 @@
;; DEFINES
;; constants
-DOT EQU .256 - .21 ; .29
-DASH EQU .256 - .63 ; .87
-ESPACE EQU DOT
-CSPACE EQU DASH
-WSPACE EQU .256 - .147 ; .203
-ENABLE_TIME EQU DOT
+DOT_DEF EQU .256 - .21 ; .29
+DASH_DEF EQU .256 - .63 ; .87
+WSPACE_DEF EQU .256 - .147 ; .203
+TUNE_DEF EQU DOT_DEF
BCONINT_DEF EQU .42
START_CHAR EQU 'A'
ACK_CHAR EQU 'A'
@@ -74,8 +72,15 @@ RX_BYTE EQU H'004F'
BUF EQU H'0050'
;; all pages
-STATE EQU H'0078'
-BEACON_INT EQU H'0079'
+BEACON_INT EQU H'0070'
+DOT EQU H'0071'
+ESPACE EQU DOT
+DASH EQU H'0072'
+CSPACE EQU DASH
+WSPACE EQU H'0073'
+TUNE EQU H'0074'
+
+STATE EQU H'0079'
NVSTATE EQU H'007A'
BEACONCNTH EQU H'007B'
BEACONCNTL EQU H'007C'
@@ -377,6 +382,15 @@ init
movlw BCONINT_DEF ; TODO: read Beacon Interval from EEPROM
movwf BEACON_INT
+ movlw DOT_DEF ; TODO: read cw timings from EEPROM
+ movwf DOT
+ movlw DASH_DEF
+ movwf DASH
+ movlw WSPACE_DEF
+ movwf WSPACE
+ movlw TUNE_DEF
+ movwf TUNE
+
movf BEACON_INT,w
movwf SECCNT
@@ -425,9 +439,9 @@ send_char
char_next_element
bsf GPIO,CWOUT
btfss ELEMENT,7
- movlw DOT
+ movf DOT,w
btfsc ELEMENT,7
- movlw DASH
+ movf DASH,w
call dottime
bcf GPIO,CWOUT
@@ -438,7 +452,7 @@ char_next_element
return
char_espace
- movlw ESPACE
+ movf ESPACE,f
call dottime
goto char_next_element
@@ -455,7 +469,7 @@ callsign_next_char
return
callsign_cspace
- movlw CSPACE
+ movf CSPACE,w
call dottime
movf CHARCNT,w
goto callsign_next_char
@@ -477,7 +491,7 @@ case0
return
case1
- movlw CSPACE
+ movf CSPACE,w
call dottime
rlf INDF,w
movwf PENTLE0
@@ -498,7 +512,7 @@ case1
return
case2
- movlw CSPACE
+ movf CSPACE,w
call dottime
rrf INDF,w
andlw b'00011111'
@@ -509,7 +523,7 @@ case2
return
case3
- movlw CSPACE
+ movf CSPACE,w
call dottime
swapf INDF,w
andlw b'00010000'
@@ -525,7 +539,7 @@ case3
return
case4
- movlw CSPACE
+ movf CSPACE,w
call dottime
rlf INDF,w
andlw b'00011110'
@@ -541,7 +555,7 @@ case4
return
case5
- movlw CSPACE
+ movf CSPACE,w
call dottime
rrf INDF,w
movwf PENTLE0
@@ -554,7 +568,7 @@ case5
return
case6
- movlw CSPACE
+ movf CSPACE,w
call dottime
swapf INDF,w
movwf PENTLE0
@@ -574,7 +588,7 @@ case6
return
case7
- movlw CSPACE
+ movf CSPACE,w
call dottime
movf INDF,w
andlw b'00011111'
@@ -585,7 +599,7 @@ case7
return
caseend
- movlw CSPACE
+ movf CSPACE,w
call dottime
incf FSR,f
goto case0
@@ -610,31 +624,32 @@ send_parity
andlw b'00011111'
call base32
call send_char
- movlw WSPACE
+
+ movf WSPACE,w
call dottime
return
;; -------------------------------------
send_beacon
bsf GPIO,CWENABLE
- movlw ENABLE_TIME
+ movf TUNE,w
call dottime
clrf PARITY
movlw START_CHAR
call send_char
- movlw WSPACE
+ movf WSPACE,w
call dottime
call send_callsign
- movlw WSPACE
+ movf WSPACE,w
call dottime
call send_cnt
- movlw WSPACE
+ movf WSPACE,w
call dottime
call send_parity
@@ -652,20 +667,20 @@ beacon_end
send_ack
movwf ACK_DATA
bsf GPIO,CWENABLE
- movlw ENABLE_TIME
+ movf TUNE,w
call dottime
clrf PARITY
movlw ACK_CHAR
call send_char
- movlw CSPACE
+ movf CSPACE,w
call dottime
movf ACK_DATA,w
call send_char
- movlw CSPACE
+ movf CSPACE,w
call dottime
call send_parity