; ; Automatic Transmitter ; Copyright (c) 2000 by (JM7OLW)Kousuke Matsumoto include 16f84.h .osc RC .pwrt on .wdt off .protect off org 0ch ;------------------------------------------------ MACHIJIKAN EQU 10 ;kono byousuu standby notoki sousin ;file register----------------------------------- poi EQU 21 wk EQU 22 tm1 EQU 23 tm2 EQU 24 busy EQU 25 ;------------------------------------------------ org 0 goto start org 4 goto start ;------------------------------------------------ start CLRF porta CLRF portb CLRF busy BSF status,5 MOVLW 00001111b ;set porta0,1,2,3 to INPUT MOVWF 85h ;85h=trisA MOVLW 00000000b ;set portb to OUTPUT MOVWF 86h ;86h=trisB BCF status,5 MOVLW MACHIJIKAN MOVWF poi main000 BTFSS porta,0 ;check stop switch GOTO main888 ;if RA0=0(Low) ,switch=on GOTO main050 ;if RA0=1(High),switch=off main050 CALL wait1sec BTFSS porta,2 ;check TX-standby GOTO main200 ;if RA2=0(Low) ,when buzzy GOTO main100 ;if RA2=1(High),when standby main100 BTFSS porta,1 ;check speaker level GOTO main400 ;if RA1=0(Low) ,when standby GOTO main150 ;if RA1=1(High),when buzzy main150 INCF busy,1 MOVLW 2 SUBWF busy,0 ;W=busy-W ; ;status0:1 if busy>=W, status0:0 if busy=2 main200 CLRF poi CLRF busy GOTO main000 main400 CLRF busy INCF poi,1 MOVLW MACHIJIKAN SUBWF poi,0 ;W=poi-W ; ;status0:1 if poi>=W, status0:0 if poi=MACHIJIKAN main500 CLRF poi BTFSS porta,3 ;check RA3(RITTY?) GOTO main510 ;if RA3=0(Low) ,when RITTY GOTO main520 ;if RA3=1(High),when PSK main510 MOVLW 00100000b ;set RB5=on MOVWF portb CALL wait0r1sec ;wait 0.1sec MOVLW 00000000b ;set RB5=off MOVWF portb CALL wait1sec ;wait 1.0sec main520 MOVLW 00010000b ;set RB4=on MOVWF portb CALL wait0r1sec ;wait 0.1sec MOVLW 00000000b ;set RB4=off MOVWF portb GOTO main000 main888 MOVLW 00001000b ;set RB4=on MOVWF portb main889 CALL wait1sec GOTO main889 ;------------------------------------------------ wait1sec MOVLW 130 MOVWF tm1 wait1sec0 MOVLW 0 MOVWF tm2 wait1sec1 DECFSZ tm2,1 GOTO wait1sec1 DECFSZ tm1,1 GOTO wait1sec0 RETURN ;------------------------------------------------ wait0r1sec MOVLW 13 MOVWF tm1 wait0r1sec0 MOVLW 0 MOVWF tm2 wait0r1sec1 DECFSZ tm2,1 GOTO wait0r1sec1 DECFSZ tm1,1 GOTO wait0r1sec0 RETURN