Rem ********************************************************************** Rem * * Rem * PICAXE 08-M Repeater Controller by VK6HV * REM * * Rem * Feel free to change anything as you require! * Rem * * Rem * 2008, 2009, 2011 * Rem * * Rem ********************************************************************** Rem Latest changes 20 - 5 - 08 Added more comments. Rem Latest changes 23 - 5 - 08 Changed clock pulse to 100mS. Rem Latest changes 8 - 6 - 08 Changed out Morse Code routine to a better one. But requires a cheat sheet at the bottom of this program. Rem Latest changes 5 - 10 - 08 Just a tidy up & fixed a bug on an Output for the LED. Rem Latest changes 7 - 3 - 09 Changed Morse Code routine. It can now bang out all punctuation! Even a 7 element "$" sign Rem dit dit dit dah dit dit dah. Many thanks go to Stan ZL2APS & Wolfgang DL8UAD for their help with the Rem Morse routine. Rem Latest changes 4 - 6 - 11 Fixed a few bugs. Thanks for the help Tony VK6YAG Rem ********************************************************************** Rem * * Rem * Your more then welcome to change, add or modify! * Rem * * Rem * * Rem * PIN# Project Use PICAXE Pin Definition * Rem * * Rem * Pin #1 +5 Volts [+5 Volts Power] * Rem * Pin #2 Serial In [Programming] * Rem * Pin #3 Beep - IDing [Out4/In4 Analog In4] * Rem * Pin #4 COR [In3] * Rem * Pin #5 LED [Out2 In2 Analog In2] * Rem * Pin #6 PTT [Out1 In1 Analog IN1] * Rem * Pin #7 Serial Out [Programming] * Rem * Pin #8 0 Volts [0 Volts] * Rem * * Rem * * Rem ********************************************************************** Symbol COR = Input3 'input to sense the COR or CAS from the receiving radio Symbol PTT = Output1 'output to switch on the Mosfet and key up the transmitting radio Symbol IDLed = Output2 'flashes when ID'ing in Morse Code Symbol TOTimer = W5 '2 minute "Time Out"timer Symbol IDTimer = W6 '10 minute "ID" timer Symbol Tone = 112 '112 is about about 1000 Hz.??? Symbol Quiet = 0 'silent, no sound Symbol Dit_Length = 6 'dit length set for around 15 words per minute? Symbol Dah_Length = 18 'dah length = dit length x 3 Symbol Word_length = 30 'word length = dit length x 5 Symbol Character = b0 'encoded character number from the cheat sheet at the end of the program. Symbol Even_Or_Odd_Character = b1 'result of the modulus divide by 2, checks to see if it's odd or even Symbol Index = b2 'just a variable to count as the encoded characters are indexed through EEPROM 0, (9,2,0,24,13,33,10,14,10) 'ID's "DE_VK6RWR", change the call sign here. Cheat sheet is at the end of the program. 'Maximum 9 character call sign. Example: DE_XX#XXX. Use a "0" for a space if required. EEPROM 9, (3,0,15) '"T_O" (You Timed Out!!!) PowerUp: 'Only executes on power up. TOTimer = 0 IDTimer = 0 CWID: Do High PTT Pause 100 TOTimer = TOTimer + 1 If TOTimer >1150 Then Goto TimeOutID Loop until COR = 1 'Wait until the COR is 1 before IDing. So it doesn't ID over the top of someone. For Index = 0 to 8 '>it will escape this loop if someone keys down to long and "times out" Read Index, Character Gosub Morse Next IDTimer = 0 Pause 1500 '**Change this PAUSE to the same value as the Hang Timer value in block UnKeyRepeater** If COR = 0 Then Goto KeyUpRepeater 'If the COR is 0 Goto KeyUpRepeater, if it's 1 then move onto the next block '>of code below CWID, which is TenMinuteIdleLoop TenMinuteIdleLoop: Do Low PTT Pause 100 '100 mS. clock the IDTimer. IDTimer = IDTimer + 1 If IDTimer >5800 Then Goto IdleLoop If COR = 0 Then Goto KeyUpRepeater Loop IdleLoop: Do 'Loop here and do nothing until the repeater is keyed up. If COR = 0 Then Goto CWID Loop KeyUpRepeater: 'Main "radio keyed up" loop when someone is using the repeater. Do High Ptt TOTimer = TOTimer + 1 IDTimer = IDTimer + 1 Pause 100 '100 mS. clock pulse for both TOTimer and IDTimer. If TOTimer >1150 Then Goto TimeOutID 'Set for N minutes before "Time Out". Theoretical 1200, use 1150. If IDTimer >5800 Then Goto CWID 'Set for a 10 minute delay for "IDing". Theoritical 6000, use 5800 If COR = 1 Then Goto UnKeyRepeater Loop UnKeyRepeater: Sound 4, (112, 20) 'This line is the over to you "Roger Beep". Pause 1500 'This PAUSE in mS. is the ***"Hang Timer"***, a pause to keep the repeater keyed and TOTimer = 0 '>give the other station a chance to talk before the repeater drops out. If COR = 0 Then Goto KeyUpRepeater 'If COR = 0 Then Goto KeyUpRepeater, if it's 1 then move to the next block of code Low Ptt '>below UnKeyRepeater, which is TenMinuteLoop. TenMinuteLoop: '10 minute counting loop, then gets out to ID or earlier if the radio is keyed up. Do IDTimer = IDTimer + 1 Pause 100 '100 mS Clock pulse for IDTimer. If COR = 0 Then Goto KeyUpRepeater If IDTimer >5800 Then Goto CWID Loop TimeoutID: TOTimer = 0 'Sends T_O in Morse Code over the offending station. For Index = 9 To 11 '**** These numbers may need to be changed after you change the call sign **** Read Index, Character Gosub Morse Next Low Ptt TimedOutStayOff: 'Loops here until the offending station unkeys and then sends T_O again in Morse Do '>Code to let them know they Timed Out!!! Pause 100 '100 mS. clock pulse is for the IDTimer. IDTimer = IDTimer + 1 Loop until COR = 1 High Ptt For Index = 9 To 11 '**** These numbers may need to be changed after you change the call sign **** Read Index, Character Gosub Morse Next Pause 1500 '**Change this PAUSE to the same value as the Hang Timer value in block UnKeyRepeater** If COR = 0 Then Goto KeyUpRepeater Low Ptt Goto TenMinuteLoop Morse: If Character = 0 then Word_sp Do Even_Or_Odd_Character = Character // 2 'returns remainder, odd or even, (dit or dah) Character = Character / 2 'shift right If Even_Or_Odd_Character = 0 then Gosub Dit If Even_Or_Odd_Character = 1 then Gosub Dah Loop until Character = 1 Gosub Char_sp Return Dit: High 2 Sound 4, (Tone,Dit_Length) Low 2 Sound 4, (Quiet,Dit_Length) Return Dah: High 2 Sound 4, (Tone,Dah_Length) Low 2 Sound 4, (Quiet,Dit_Length) Return Char_sp: Sound 4, (Quiet,Dah_length) Return Word_sp: Sound 4, (Quiet,Word_length) Return REM FOR THOSE WHO DON'T KNOW MORSE CODE:) REM A .- B -... C -.-. D -.. E . F ..-. REM G --. H .... I .. J .--- K -.- L .-.. REM M -- N -. O --- P .--. Q --.- R .-. REM S ... T - U ..- V ...- W .-- X -..- REM Y -.-- Z --.. REM 1 .---- 2 ..--- 3 ...-- 4 ....- 5 ..... REM 6 -.... 7 --... 8 ---.. 9 ----. 0 ----- REM SOME PUNCTUATION THAT WILL WORK WITH THIS REPEATER CONTROLLER REM FULL STOP [.] .-.-.- COLON [:] ---... REM COMMA [,] --..-- SEMICOLON [;] -.-.-. REM QUESTION MARK [?] ..--.. EQUAL SIGN double dash [=] -...- REM APOSTROPHE ['] .----. PLUS [+] .-.-. REM EXCLAMATION MARK [!] -.-.-- HYPHEN minus [-] -....- REM FWD SLASH [/] -..-. UNDERSCORE [_] ..--.- REM PARENTHESIS open [(] -.--. QUOTATION MARK ["] .-..-. REM PARENTHESIS closed [)] -.--.- DOLLAR SIGN [$] ...-..- REM AMPERSAND [&] .-... AT SIGN [@] .--.-. REM *** ENCODED CHARACTER NUMBERS *** REM NUMBERS USED TO PROGRAM YOUR MESSAGE IN THE "CONTROLLER" REM A 6, B 17, C 21, D 9, E 2, F 20, REM G 11, H 16, I 4, J 30, K 13, L 18, REM M 7, N 5, O 15, P 22, Q 27, R 10, REM S 8, T 3, U 12, V 24, W 14, X 25, REM Y 29, Z 19, REM 1 62, 2 60, 3 56, 4 48, 5 32, REM 6 33, 7 35, 8 39, 9 47, 0 63, REM ALL PUNCTUATION SHOULD WORK WITH THIS REPEATER CONTROLLER REM FULL STOP [.] 106 COLON [:] 71 REM COMMA [,] 115 SEMICOLON [;] 85 REM QUESTION MARK [?] 76 EQUAL SIGN double dash [=] 49 REM APOSTROPHE ['] 94 PLUS [+] 42 REM EXCLAMATION MARK [!] 117 HYPHEN minus [-] 97 REM FWD SLASH [/] 41 UNDERSCORE [_] 108 REM PARENTHESIS open [(] 45 QUOTATION MARK ["] 82 REM PARENTHESIS closed [)] 109 DOLLAR SIGN [$] 200 REM AMPERSAND [&] 34 AT SIGN [@] 86