

           list         p=16f84
	   radix	hex
           __config     0x3FF1
dahlen    equ           d'99'     ;<==controls code speed.. increase
ditlen    equ           d'33'     ;<==(though not over 255) for
          org           0x000     ;slower code, decrease for
          MOVLW         00        ;faster code. Make sure the top
          MOVWF         0A        ;number is three times the bottom.
	  GOTO   	start
	  NOP
	  NOP
time      MOVF          10,W
	  BTFSC  	03,2
	  GOTO   	endtime
uptop  	  MOVLW  	01
	  MOVWF  	0D
upagn  	  CLRF   	0C
doagn	  DECFSZ 	0C,F
	  GOTO   	doagn
	  DECFSZ 	0D,F
	  GOTO   	upagn
	  MOVLW  	4A
	  MOVWF  	0C
upone  	  DECFSZ 	0C,F
	  GOTO   	upone	
	  DECFSZ 	10,F
	  GOTO   	uptop
endtime   RETLW         00

dah       MOVLW         01        ;subroutine to do a dah
	  MOVWF  	0E
agn3dah   MOVLW         dahlen
	  SUBWF  	0E,W
	  BTFSC  	03,0
	  GOTO   	enddah
          BSF           06,1      ;turn on pin B1
	  MOVLW  	01
	  MOVWF  	10
          CALL          time      ;wait 1 millisecond
          BCF           06,1      ;turn off pin B1
	  MOVLW  	01
	  MOVWF  	10
          CALL          time      ;wait 1 millisecond
	  MOVF   	0E,W
	  INCF   	0E,F
          GOTO          agn3dah   ;loop up to do it again.
enddah    MOVLW         3C        ;add a small delay
	  MOVWF  	10
	  CALL   	time
	  RETLW  	00

dit       MOVLW         01        ;subroutine to do a dit
	  MOVWF  	0E
agn3dit	  MOVLW  	ditlen
	  SUBWF  	0E,W
	  BTFSC  	03,0
	  GOTO   	enddit
          BSF           06,1      ;turn on pin B1
	  MOVLW  	01
	  MOVWF  	10
          CALL          time      ; wait 1 millisecond
          BCF           06,1      ;turn off pin B1
	  MOVLW  	01
	  MOVWF  	10
          CALL          time      ; wait 1 millisecond
	  MOVF   	0E,W
	  INCF   	0E,F
          GOTO          agn3dit   ;loop up and do it again.
enddit    MOVLW         3C        ;add a small delay
	  MOVWF  	10
	  CALL   	time
	  RETLW  	00

lspace    MOVLW          0xB4     ;subroutine to make a letter space
          MOVWF          10
          CALL           time
          RETLW          00

start     CLRF           04       ;MAIN PROGRAM STARTS HERE
          MOVLW          0xFD
          TRIS           6

top       CALL           dit      ; modify this code to xmit the 
          CALL           dah      ; CW you want to send
          CALL           dah
          CALL           lspace   ;lspace is a pause for the space between
          CALL           dit      ;letters. Include it after each letter.
          CALL           dit      ;As it appears here, the IDer will 
          CALL           dah      ;transmit W2FS
          CALL           dah
          CALL           dah
          CALL           lspace
          CALL           dit
          CALL           dit
          CALL           dah
          CALL           dit
          CALL           lspace
          CALL           dit
          CALL           dit
          CALL           dit

          MOVLW          01
          MOVWF          0E
                                  ;this code programs the delay between IDs.
loop      MOVLW          d'150'   ;<= 4  this number = number of seconds
          SUBWF          0E,W     ; between IDs when using a 4 MHz resonator.
          BTFSC          03,0 
          GOTO           bottom
          MOVLW          10 
          MOVWF          0F
again     MOVLW          0xFA
          MOVWF          10
          CALL           time
          DECFSZ         0F,F
          GOTO           again
          MOVF           0E,W
          INCF           0E,F
          GOTO           loop
bottom    GOTO           top
          END

 

