Shop OBEX P1 Docs P2 Docs Learn Events
Radio Repeater Controller — Parallax Forums

Radio Repeater Controller

w1jeqw1jeq Posts: 1
edited 2007-06-09 07:46 in BASIC Stamp
I am trying to use a BS2 to control a radio Repeater system. I need to have the stamp do a 10 minute timer to trigger an ID over the air. while it is in operation. It would be initially triggered whenever someone access the repeater and go while it is in use, then afterwords it would ID about 2 minutes after the last transmission and go into standby untill it is next used. any help would be greatly appreciated.

Matthew A. Chambers, W1JEQ
Activities Director NEMO ARC
ARES OES - Amateur Extra

Comments

  • FranklinFranklin Posts: 4,747
    edited 2007-06-06 22:21
    What do you have on the repeater that you could use as a trigger? Relay contact, 5v power connection that switches when the repeater is in use, what? That is the first step the rest is just programming and outputting the contacts to initiate the ID.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • DaneDane Posts: 1
    edited 2007-06-09 07:46
    I did a repeater controller a while back·on Basic Stamp 1.

    It has an ID timer, timeout timer, Hang timer.

    The key is you have to program everything like a multi-tasking system.
    That is, you can never wait in a hard loop for COR, ID timer, etc. I always check timers when in the COR loop to see if I need to ID or timeout. Even while idle (standby), I am counting down an ID timer so within 8 mins of the last squelch tail, I do an ID then reset the pending ID flag.

    With a BS2 you would have enough space to add a DTMF decoder interface with commands.

    CW ID EncodingThe only trick is how to encode the CW ID. Brute force methods took too much program space. The method I use encodes a byte as a CW character by using the ones and zeros as dot-dash values. The byte is encoded from left to right (LSB to MSB) as a one bit for dash and zero bit for dit. You then put a single one bit at the end. This last bit will not be sent but is only used as a "stop bit". The routine plays a CW character by stripping all by the lower bit and·using it to determine if it's a dot (0) or dash (1). Then, the bits are shifted to the right by one bit with a divide by two. The routine stops when the CW character value is a one. For example, here are some characters:
    attachment.php?attachmentid=73779
    In the above example, the A is sent from right to left. "0" is sent as "DIT". Then the value is shifted right one to give "11". Since the value is not "1", the right digit is stripped "1" and sent (as a DASH). The value is again shifted right and now equals one (1). A value of one will cause the routine to stop.
    (Excuse the code formatting, I pasted it from elsewhere and did not make a good translation)

    Enjoy,
    Dane.


    ' rptctl.bas
    ' Simple Repeater Controller
    ' (c) 1999 by Dane Westvik /KO6YD, all rights reserved
    '
    '
    ' Pin Maps:
    ' pin0 = COR IN 
    ' pin1 = COR LED 
    ' pin2 = PTT OUT
    ' pin3 = SOUND/TONE OUT
    '
    symbol cor_in = pin0
    symbol ptt_out = 2
    symbol cor_led = 1
    symbol tone_out = 3
    
    ' CW ID Pitch
    symbol ID_Pitch = 117
    
    ' Timer Storage areas (ID = Idtimer, TO=Timeout Timer)
    symbol T_ID = w1
    symbol T_TO = w2
    
    ' Flags
    symbol FLG_ID = bit0
    symbol FLG_TIMEOUT = bit1
    
    ' Timers  (Aprox: 10 = 1 sec [noparse][[/noparse]900=90 sec])
    symbol TO_TIME = 900
    symbol ID_TIME = 5000
    symbol ID_TAIL = 4600
    
    ' Work Vars (Loops, etc)
    symbol x = b8
    symbol y = b9
    symbol  cwchr = b7
    
    ' Set pin directions
    dirs = %11111110 
    
    ' Set unit to ID first time
    t_id = ID_TAIL
    
    ' Main Loop
    ' Update ID timer and see if it's time to ID
    '
    main:
    T_ID = T_ID + 1
    if T_ID < ID_TIME then main_1
    gosub id : low ptt_out
    
    ' Wait a little 100ms then check for COR. If so, then xmit
    main_1:
    pause 100
    if cor_in = 0 then xmit
    low ptt_out : goto main
    
    
    ' COR sensed, activate xmit
    ' and indicate that we will need to ID.
    xmit:
    high ptt_out
    high cor_led
    flg_id = 1 ' Indicate an ID is required
    
    cor_loop:
    T_TO = T_TO + 1
    if T_TO > TO_TIME  then cor_to
    pause 100
    if cor_in = 1 then tail
    goto cor_loop
    
    tail:
    flg_id = 1
    low cor_led
    
    ' Un comment below for a tone at COR drop 
    ' sound tone_out,(118,3)
    for b10 = 1 to 10
    if cor_in = 0 then xmit
    pause 100
    T_ID = T_ID + 1
    next b10
    if T_ID < ID_TAIL then tail_1:
    gosub id : pause 200
    tail_1:
    ' Various C Tones
    ' sound tone_out,(115,10) 'Beep
    SOUND TONE_OUT,(108,9,112,9,118,9) 'Deedle-dee [noparse][[/noparse]aka: Stardust]
    ' sound tone_out,(110,10,112,10) 'Do - Loop
    ' sound tone_out,(116,8,112,8) 'BaLeep
    
    
    tail_2:
    T_TO = 0
    for b10 = 1 to 20
    if cor_in = 0 then xmit
    pause 100
    t_id = t_id + 1
    next b10
    low ptt_out
    goto main
    
    ' Timeout timer expired, Output tone and turn off xmit
    cor_to: 
    T_TO = 0
    low cor_led
    sound tone_out,(90,50,0,20)
    low ptt_out
    
    ' If COR high too long, you still need to ID
    cor_to1:
    T_ID = T_ID + 1
    if T_ID < ID_TIME then cor_to2
    gosub id : low ptt_out
    
    ' Keep waiting and checking for COR to drop
    cor_to2:
    pause 100
    if cor_in = 0 then cor_to1
    high ptt_out
    pause 500
    sound tone_out,(100,20,0,5,100,20)
    goto tail
    
    ' Send ID
    ' Called at ID TIME but only id if repeater active (flg_id)
    id:
    if flg_id = 1 then id_now
    t_id = ID_TIME
    return
    
    id_now:
    high ptt_out
    ' Id 5 chrs (KO6YD) plus "/R"
    for x= 0 to 6
    ' KO6YD/R
    lookup x,(13,15,33,29,9,41,10),cwchr
    cw_loop:
    y = cwchr & 1
    y = 10 * y + 7
    sound tone_out,(ID_Pitch,y,0,2)
    cwchr = cwchr / 2
    if cwchr <> 1 then cw_loop
    pause 50
    next x
    t_id = 0
    flg_id = 0
    return
    



    Post Edited (Dane) : 6/9/2007 7:52:30 AM GMT
    196 x 129 - 2K
Sign In or Register to comment.