;**** Built Thu Oct 28 11:29:05 2004 ;**** VERSION CWT-2222, 2-23-97 ***** ;**** VERSION CWT-2223, 10-15-2004 **** ;**** CW IDER BY B. ANDING ********* ; *************************************************************** ; * This program is free software. Licensed for private use only ; * Permission is granted to use, copy, or redistribute this program ; * so long as it is not sold for profit. ; * THIS PROGRAM IS PROVIDED AS IS AND WITHOUT WARRANTY OF ANY KIND, ; * EITHER EXPRESSED OR IMPLIED. This notice must follow program listing. ; *************************************************************** ; Description of pin usage for CW IDer Bob Anding ; ; PIC16F84 ; +---\__/---+ ; ---------------------RA2 |1 18| RA1----------------CAS ; ---------------------RA3 |2 17| RA0------------------- ; ---------------------RA4 |3 16| OSC1---------------XTAL ; +5v-->10kOhm--------MCLR |4 15| OSC2---------------XTAL ; GROUND---------------Vss |5 14| VDD-----------------+5v ; ---------------------RB0 |6 13| RB7-----------------LED ; MO-&AUDIO FLTR-------RB1 |7 12| RB6------------------- ; PTT------------------RB2 |8 11| RB5------------------- ; ---------------------RB3 |9 10| RB4------------------- ; +----------+ ; MO = Morse Output ; ; LIST P=16F84 radix hex ;======================================= w equ 0 f equ 1 ;======================================= tmr0 equ 0x01 pc equ 0x02 status equ 0x03 porta equ 0x05 portb equ 0x06 shift equ 0x0c tcount equ 0x0d count equ 0x0e ;======================================= START org 0x00 movlw 0x00 tris portb ;set portb write movlw 0xff tris porta ;set porta read clrf portb ;------------------------------------- WAIT clrf count bcf portb,2 ;clear PTT pin ;-------------------------------------- ; Bila menggunakan rangkaian “ Optional CAS Circuit “ yang terhubung ; ke pin 18 ,command line ini disertakan. PIC Ider akan mulai bekerja ; bila ada sinyal CAS ke R10, pin 18 menjadi low dan timer mulai ; bekerja dan akan terulang bila ada sinyal CAS kembali. ; Bila dikehendaki timer rangkaian otomatis bekerja ketika power di- ; masukkan dan akan terulang secara periodic, hapus atau matikan ; command line ini dengan memberi karakter ; di depan btfss ;--------------------------------------- btfss porta,1 ;check CAS for 1-> sesuaikan dengan keperluan goto TIMER goto WAIT ;------------------------------------- LTRSPC movlw 0xae ;letter space = 174 equal to DAH movwf tcount ;set count goto SPC return WDSPC movlw 0xcb ;word space = 203 movwf tcount ;set count call SPC movlw 0xcb ;word space = 203 -->total 406 equal 7*DIT movwf tcount ;set count call SPC goto GETLTR ;------------------------------------- ; Morse table, gunakan tabel ini untuk menuliskan kode Morse yang ; dikehendaki ;------------------------------------- ;retlw 0x06 ;a ;retlw 0x11 ;b ;retlw 0x15 ;c ;retlw 0x09 ;d ;retlw 0x02 ;e ;retlw 0x14 ;f ;retlw 0x0b ;g ;retlw 0x10 ;h ;retlw 0x04 ;i ;retlw 0x1e ;j ;retlw 0x0d ;k ;retlw 0x12 ;l ;retlw 0x07 ;m ;retlw 0x05 ;n ;retlw 0x0f ;o ;retlw 0x16 ;p ;retlw 0x1b ;q ;retlw 0x0a ;r ;retlw 0x08 ;s ;retlw 0x03 ;t ;retlw 0x0c ;u ;retlw 0x18 ;v ;retlw 0x0e ;w ;retlw 0x19 ;x ;retlw 0x1d ;y ;retlw 0x13 ;z ;retlw 0x3e ;1 ;retlw 0x3c ;2 ;retlw 0x38 ;3 ;retlw 0x30 ;4 ;retlw 0x20 ;5 ;retlw 0x21 ;6 ;retlw 0x23 ;7 ;retlw 0x27 ;8 ;retlw 0x2f ;9 ;retlw 0x3f ;0 ;retlw 0x00 ;Word Space ;retlw 0x29 ;/ ;retlw 0x68 ;SK ;retlw 0x2a ;AR ;retlw 0x31 ;BT ;retlw 0x4c ;? ;retlw 0xff ;EOM ;------------------------------------- ; ID message block, max. char. length 50 incl. EOM ;------------------------------------- ID addwf pc,f retlw 0x00 ; word space u/ stabilkan PTT-> tanpa ini satu ; karakter pertama huruf pertama akan hilang retlw 0x09 ; D retlw 0x02 ; E retlw`0x00 ; word space retlw 0x1d ; Y retlw 0x15 ; C retlw 0x3e ; 1 retlw 0x13 ; Z retlw 0x02 ; E retlw 0x07 ; M retlw 0x29 ; / retlw 0x0a ; R ? untuk repeater retlw 0x00 ; word space retlw 0x0f ; O retlw 0x04 ; I retlw 0x38 ; 3 retlw 0x38 ; 3 retlw 0x03 ; T retlw 0x0b ; G ? Maidenhead locator repeater retlw 0xff ; EOM ? blok kode harus ditutup dengan EndOfFile ;------------------------------------- ; Tone freq, to change freq. change last three digit b'11010xxx' ; 110 = 114 Hz 101 = 238 Hz 100 = 446 Hz 011 = 893 Hz ; 010 = 1724 Hz 001 = 3333 Hz ; Paling baik diset pada 893 Hz ;------------------------------------- DELAY clrf tmr0 ;set timer clrwdt ; clear watch dog timer movlw b'11010011' ;tone freq. 893hz. option ; load reg AGAIN btfss tmr0,5 ; delay goto AGAIN return ;------------------------------------- GETLTR nop movf count,w call ID ;get next letter incf count,f ;move count to next letter movwf shift ;move letter to shift reg movlw 0x00 ;Word Space = 00 subwf shift,w btfsc status,2 goto WDSPC movlw 0xff ;EOM = 256 subwf shift,w btfsc status,2 goto WAIT ;-------------------------------------- LOOP movf shift,w ;get bit pattern btfsc shift,0 movlw 0xae ;get DAH length = 174 equal 3*DIT btfss shift,0 movlw 0x3a ;get DIT length = 58 movwf tcount call PULSE rrf shift,f ;ROTATE BIT to LSB bcf shift,7 ;clear MSB movlw 0x01 ;Check for end bit subwf shift,w btfss status,2 ;if end break loop goto LOOP call LTRSPC ; letter spacing goto GETLTR ;get next letter ;---------------------------------- PULSE bsf portb,1 ;set port b call DELAY ; delay bcf portb,1 ; clear port b call DELAY ; delay decfsz tcount,f goto PULSE movlw 0x3a ;element space equal DIT movwf tcount ;set count SPC nop call DELAY ; delay nop ; silent call DELAY ; delay decfsz tcount,f goto SPC return ;------------------------------------------- ;------------------------------------------- ; The 10 min. timer block. ; Each time through the loop is equal to delay of approx. 4.16 second ; Sesuaikan timer sesuai keperluan dengan mengubah hex (0x90) ; Misal 5 menit = 300 dt = 300/4.16 = 72 ? 0x48 ;------------------------------------------- TIMER movlw 0x90 ;u/ PIC 16C84 =(.8) * 16F84 movwf count ;set count to 144 --->144*4.16 sec. = 9.9 min clrwdt movlw b'11011111' ; set 256 option ; load prescaler in reg. REPT bsf portb,7 ;signal active timer sleep ; delay 2.3 sec. bcf portb,7 ;signal active timer sleep ; delay 2.3 sec. decfsz count,f goto REPT clrwdt clrf count bsf portb,2 ;set PTT pin goto GETLTR ;start IDer ;---------------------------- end