'This code is copyright (c) 1999-2000 by Kenneth A Arck, AH6LE, all 'rights reserved. It may be used by individual amateur radio 'operators for their own private use. Commercial users should 'contact the author at ah6le@ah6le.net. 'This program will read an ACC-850/85/96/ITC-32 remote base serial 'stream and drives a Kenwood mobile with the DTMF (mic) input. '***DECLARE VARIABLES USED*** rb1 var nib 'Remote Base #1 MEGS - 4 bits rb2a var byte 'Remote Base #1 +/- - 1 bit rb2b var byte 'Remote Base #1 S/D - 1 bit rb2c var byte 'Remote Base #1 0/5 - 1 bit rb2d var byte 'Remote Base #1 on/off - 1 bit rb3 var nib 'Remote Base #1 10KHz - 4 bits rb4 var nib 'Remote Base #1 100KHz - 4 bits rb5 var nib 'Remote Base #2 MEGS - 4 bits rb6a var byte 'Remote Base #2 +/- - 1 bit rb6b var byte 'Remote Base #2 S/D - 1 bit rb6c var byte 'Remote Base #2 0/5 - 1 bit rb6d var byte 'Remote Base #2 on/off - 1 bit rb7 var nib 'Remote Base #2 10KHz - 4 bits rb8 var nib 'Remote Base #2 100KHz - 4 bits pl1 var bit 'PL on/off bit - 1 bit pl2 var byte 'PL program - 5 bits bs var nib 'Band select info - 3 bits dir var byte 'Rotator direction - 7 bits clk var byte 'Clock pulse sample prefix var nib '144,220,440 prefix T1 var byte 'PL digit 1 T2 var byte 'PL digit 2 times var nib simcount1 var nib 'variables to keep track of offset selection pluscount1 var nib minuscount1 var nib simcount2 var nib pluscount2 var nib minuscount2 var nib '***Initialize radio(s) on powerup*** prefix = 4 'Set band to "two" rb1 = 6 'Remote 1 - 146.46 simplex, PL off rb4 = 4 rb3 = 6 rb2c =0 rb2b =1 rb5 = 6 'Remote 2 - 146.46 simplex, PL off rb8 = 4 rb7 = 6 rb6c =0 rb6b =1 pl1 = 0 'Turn PL encode off pl2 = %00000 'Set to tone "1" Gosub SetRadFreq Gosub SendPlOn '***Look for clock activity from ACC serial stream*** INPUT 7 Clock: 'Clock activity? IF IN7 = 0 THEN Clock 'If no clock, sample again PAUSE 10 'If clock, delay enough time for ACC to stop 'sending it's serial stream '****Select ACC type**** INPUT 3 if IN3 = 0 then ReadLongSerial 'if 850 get longer stream if IN3 = 1 then ReadShortSerial 'if not 850 get shorter stream '***Read in 850 stream*** ReadLongSerial: SHIFTIN 9,8,lsbpre,[rb1\4,rb2a\1,rb2b\1,rb2c\1,rb2d\1,rb3\4,rb4\4,rb5\4,rb6a\1,rb6b\1,rb6c\1,rb6d\1,rb7\4,rb8\4,pl1\1,pl2\6,bs\3,dir\7] if rb2c = 1 then otherfiveconvert if rb6c = 1 then bigfiveconvert '***Determine band select bits*** Band: if bs = 1 then two if bs = 2 then twotwenty if bs = 3 then two two: prefix = 4 Goto PlSelect twotwenty: prefix = 2 '***Send PL info to radio*** PlSelect: pl2 = pl2 + 1 T1 = pl2/10 T2 = pl2//10 Gosub SendPlOn Goto Clock '***Read in other stream*** ReadShortSerial: SHIFTIN 10,8,lsbpre,[rb1\4,rb2a\1,rb2b\1,rb2c\1,rb2d\1,rb3\4,rb4\4] if rb2c = 1 then otherfiveconvert '***Figure offset for radio 1*** FigOffsetone: if rb2b = 1 then simplex1 'decode bits into offset selection if rb2b = 0 and rb2a = 1 then plus1 if rb2b = 0 and rb2a = 0 then minus1 simplex1: pluscount1 = 1 minuscount1 = 2 if simcount1 = 0 then Clock for times = 1 to simcount1 DTMFOUT 2,100,100,[1] next simcount1 = 0 return plus1: minuscount1 = 1 simcount1 = 2 if pluscount1 = 0 then Clock for times = 1 to pluscount1 DTMFOUT 4,100,100,[1] next pluscount1 = 0 return minus1: simcount1 = 1 pluscount1 = 2 if minuscount1 = 0 then Clock for times = 1 to minuscount1 DTMFOUT 4,100,100,[1] next minuscount1 = 0 return '***Figure offset for radio 2**** FigOffsettwo: if rb6b = 1 then simplex2 'decode bits into offset selection if rb6b = 0 and rb6a = 1 then plus2 if rb6b = 0 and rb6a = 0 then minus2 simplex2: pluscount2 = 1 minuscount2 = 2 if simcount2 = 0 then Clock for times = 1 to simcount2 DTMFOUT 5,100,100,[1] next simcount2 = 0 return plus2: minuscount2 = 1 simcount2 = 2 if pluscount2 = 0 then Clock for times = 1 to pluscount2 DTMFOUT 5,100,100,[1] next pluscount2 = 0 return minus2: simcount2 = 1 pluscount2 = 2 if minuscount2 = 0 then Clock for times = 1 to minuscount2 DTMFOUT 5,100,100,[1] next minuscount2 = 0 return '***Send output to radios*** SetRadFreq: DTMFOUT 4,100,100,[12,prefix,rb1,rb4,rb3,rb2c] 'radio one gosub FigOffsetone pause 100 DTMFOUT 5,100,100,[12,prefix,rb5,rb8,rb7,rb6c] 'radio two gosub FigOffSettwo return SendPlOn: DTMFOUT 4,100,100,[15,2,12,T1,T2] 'send pl info to radio one pause 100 DTMFOUT 5,100,100,[15,2,12,T1,T2] 'send pl info to radio two return bigfiveconvert: 'converts the single 1 bit to "5" rb6c = 5 Gosub SetRadFreq Goto Clock otherfiveconvert: 'converts the single 1 bit to "5" rb2c = 5 Gosub SetRadFreq Goto Clock