diff options
Diffstat (limited to 'software/ttx/ttx.asm')
-rw-r--r-- | software/ttx/ttx.asm | 96 |
1 files changed, 59 insertions, 37 deletions
diff --git a/software/ttx/ttx.asm b/software/ttx/ttx.asm index abfd472..c9826c7 100644 --- a/software/ttx/ttx.asm +++ b/software/ttx/ttx.asm @@ -10,7 +10,7 @@ ;; Please visit the project hompage at sat.mur.at for further information. ;; ;; - ;; Copyright (C) 2011 Christian Pointner <equinox@spreadspace.org> + ;; Copyright (C) 2011 Christian Pointner <equinox@mur.at> ;; ;; This file is part of mur.sat. ;; @@ -36,17 +36,21 @@ ;; ------------------------------------- ;; DEFINES -BEACON_INT EQU .60 +BEACON_INT EQU .5 SECCNT EQU H'0008' -DOT EQU .36 -DASH EQU .108 -ESPACE EQU .36 -CSPACE EQU .108 -WSPACE EQU .252 -CWSPEED EQU .192 -DOTCNT0 EQU H'000A' -DOTCNT1 EQU H'000B' +CHAR EQU H'0009' +CHARCNT EQU H'000A' +ELEMENT EQU H'000B' +ELECNT EQU H'000C' + +DOT EQU .85 +DASH EQU .255 +ESPACE EQU .85 +CSPACE EQU .255 +CWSPEED EQU .168 +DOTCNT0 EQU H'0010' +DOTCNT1 EQU H'0011' CWOUT EQU GP0 @@ -62,7 +66,7 @@ init option movlw b'11111110' tris GPIO - bcf GPIO,CWOUT + bsf GPIO,CWOUT clrf TMR0 movlw BEACON_INT movwf SECCNT @@ -74,7 +78,7 @@ init ;; Morse Codes: 0=dot, 1=dash getcw addwf PCL,f - retlw b'00000000' ; SPACE + nop retlw b'00010000' ; ! retlw b'01001000' ; " retlw b'00000000' ; # @@ -137,7 +141,7 @@ getcw ;; Morse Code Length getcwlen addwf PCL,f - retlw .0 ; SPACE + nop retlw .5 ; ! retlw .6 ; " retlw .0 ; # @@ -196,6 +200,18 @@ getcwlen retlw .4 ; X retlw .4 ; Y retlw .4 ; Z + + ;; test string +string + addwf PCL,f + nop + retlw 'T' - ' ' + retlw 'A' - ' ' + retlw 'S' - ' ' + retlw '.' - ' ' + retlw 'R' - ' ' + retlw 'U' - ' ' + retlw 'M' - ' ' ;; ------------------------------------- ;; SUBROUTINES @@ -214,41 +230,47 @@ dot_inner decfsz DOTCNT1,f goto dot_outer return - + + ;; ------------------------------------- send_beacon - ;; test send out: - ;; .- . - - bsf GPIO,CWOUT - movlw DOT - call dottime - bcf GPIO,CWOUT + movlw .7 + movwf CHARCNT - movlw ESPACE - call dottime +beacon_next_char + movf CHARCNT,w + call string + call getcw + movwf ELEMENT + movf CHARCNT,w + call string + call getcwlen + movwf ELECNT - bsf GPIO,CWOUT - movlw DASH - call dottime +beacon_next_element bcf GPIO,CWOUT - - movlw CSPACE - call dottime - - bsf GPIO,CWOUT + btfss ELEMENT,7 movlw DOT + btfsc ELEMENT,7 + movlw DASH call dottime - bcf GPIO,CWOUT + bsf GPIO,CWOUT - movlw WSPACE - call dottime + rlf ELEMENT,f + + decfsz ELECNT,f + goto beacon_element_space - bsf GPIO,CWOUT - movlw DASH + movlw CSPACE call dottime - bcf GPIO,CWOUT - + decfsz CHARCNT,f + goto beacon_next_char return +beacon_element_space + movlw ESPACE + call dottime + goto beacon_next_element + ;; ------------------------------------- ;; MAINLOOP main |