chiark / gitweb /
added section to read out morse msg
authorceb <ceb>
Sun, 1 May 2005 22:35:48 +0000 (22:35 +0000)
committerceb <ceb>
Sun, 1 May 2005 22:35:48 +0000 (22:35 +0000)
cebpic/morsepanic.asm

index c4b6b69d36860512eb2cbdaad87d0d68460f93aa..629d9632f54dfd70aa1aae9db2e687c639744109 100644 (file)
@@ -101,30 +101,30 @@ vector_reset
 ;---------------------------------------------------------------------------
 
 ; write error code for SOS into flash memory (starting at 30 0000h)
-;       movlw   F_ERROR_H      ; set table pointer to point to
-;       movwf   TBLPTRU                ; start of flash p3
-;       movlw   F_SOS_H
-;       movwf   TBLPTRH
-;       movlw   F_SOS_L
-;       movwf   TBLPTRL
-;
+       movlw   F_ERROR_H       ; set table pointer to point to
+       movwf   TBLPTRU         ; start of flash p3
+       movlw   F_SOS_H
+       movwf   TBLPTRH
+       movlw   F_SOS_L
+       movwf   TBLPTRL
+
 ; write message into memory, incrementing tbl pointer each time
-;
-;      movlw   10101000b
-;      movwf   TABLAT
-;      tblwt*+
-;
-;      movlw   11101110b
-;      movwf   TABLAT
-;      tblwt*+
-;
-;      movlw   11100010b
-;      movwf   TABLAT
-;      tblwt*+
-;
-;      movlw   10100000b
-;      movwf   TABLAT
-;      tblwt*+
+
+       movlw   10101000b
+       movwf   TABLAT
+       tblwt*+
+
+       movlw   11101110b
+       movwf   TABLAT
+       tblwt*+
+
+       movlw   11100010b
+       movwf   TABLAT
+       tblwt*+
+
+       movlw   10100000b
+       movwf   TABLAT
+       tblwt*+
 
 ;---------------------------------------------------------------------------
 ; turn LED green if we have made it this far....
@@ -176,7 +176,25 @@ morsemsg
 ; wrapper round readout to flash the per-pic led red&blue for an 
 ; 8-byte msg
 
-       
+morse_msg_start
+       movlw   F_ERROR_H       ; set table pointer to point to
+       movwf   TBLPTRU         ; start of flash p3
+       movlw   F_SOS_H
+       movwf   TBLPTRH
+       movlw   F_SOS_L
+       movwf   TBLPTRL
+
+       clrf    WREG3,0         ; clear loop counter (WREG4)
+
+morse_loop
+       movlw   8
+       cpfslt  WREG3,0         ; if loop counter >=8, goto start of msg
+       goto    morse_msg_start
+       tblrd*+
+       movff   TABLAT,WREG2
+       call    readout
+       incf    WREG3
+       goto    morse_loop