From: ceb Date: Sun, 1 May 2005 22:35:48 +0000 (+0000) Subject: added section to read out morse msg X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=2ba075744ea8ec8b0ec6fb7d38c43f5a778ee071;p=trains.git added section to read out morse msg --- diff --git a/cebpic/morsepanic.asm b/cebpic/morsepanic.asm index c4b6b69..629d963 100644 --- a/cebpic/morsepanic.asm +++ b/cebpic/morsepanic.asm @@ -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