Search
Sunday, February 05, 2012 ..:: Home » Radio Communication ::.. Register  Login
Site Navigation

 RF Communication Between BASIC Stamps Using 2-meter HT Radios Minimize

The Tigertronics (www.tigertronics.com) RTX-12 Radio Modem and a set of 2-meter handheld radio transceivers are a really simple and functional solution for long-range data transmission between microcontrollers. With 5W power on standard 2-meter handheld radios I've sent data several miles or more with line-of-sight, and further when I've used antennas. 

This example uses the Parallax BASIC Stamp 2, though it may be substituted with any microcontroller. The example includes two sets of programs: a simple version that lacks error checking and a more complete example with checksums. All of these programs are available for download at the bottom of this page.  

Required Parts

  • (2) RTX-12OEM Radio Modems (Tigertronics #RTX-12OEM)
  • (2) BASIC Stamp 2 Modules (Parallax #BS2-IC)
  • (2) Super Carrier Boards (Parallax #27130)
  • (2) Amateur Handheld Transceivers (Yaesu #VX-6R used in this example though a variety of HT models are suitable)
  • (2) Radio Adapter Cables (Yausu #CT-91 for the above radio)


Use the same schematic for transmitter and receiver. The receiver BASIC Stamp will be connected to your PC for DEBUG. 

Hardware Setup

  • Two duplicate setups are required to run the sample programs; the schematic is the same for the transmitter and receiver. The receiver will remain connected to the PC via serial or USB cable to display data from the transmitter.  
  • Tigertronics offers a ribbon cable to easily connect to their RTX-12. We suggest you purchase this cable since connecting to the RTX-12’s individual pins can be difficult without it. Tigertronics provides only one end of this cable terminated with the connector. You will need to locate some female 2x5 IDC connectors to wire the cable to your microcontroller.
  • 2-meter HT radio manufacturers have vendor-specific cables to connect the mic and speaker port. The mic is commonly a 2.5mm cable and the speaker is 3.5mm. These are often joined for a single connection to the radio. 
  • You will need to make a cable to connect the radio’s mic and speaker cable to the microcontroller project board. These are both mono cables, available from RadioShack and other electronic suppliers. 
  • Critical attention should be paid to wiring. Diagnosing problems between the modem, radio and BASIC Stamp can be quite tedious if mistakes are made to the wiring. 
  • Tune both of your radios to the ARRL’s 2-meter “miscellaneous and experimental modes” of 145.50-145.80 (MHz). Set your radios to the lowest power mode necessary for transmitting and receiving.

Simple Transmit Programs

RTX-12 Simple Transmit.bs2 and RTX-12 Simple Receive.bs2 are simple programs that have no error checking and are intended only to get your hardware up and running.

Program the transmitting BASIC Stamp with this code:

' RTX-12 Simple Transmit.bs2
' {$STAMP BS2}
' {$PBASIC 2.5}

' I/O Pin Definitions
TXD             PIN     0               ' --> RTX-12.5 (Transmit Data)
RTS             PIN     1               ' --> RTX-12.6 (Negative In/PTT)
DSR             PIN     2               ' <-- RTX-12.4 (Carrier Detect)
RXD             PIN     3               ' <-- RTX-12.3 (Receive Data)

' Constants and Variables
Baud            CON      813            ' 1200 bps, no parity, true, two stop bits
loopCounter     VAR      Nib

                                        ' Enter transmit mode
sendCallsign:                           ' Send call sign as string
  HIGH RTS
  PAUSE 300
  SEROUT TXD, Baud,["KI6HBT"]

sendNumbers:                            ' Send numbers
  FOR loopCounter = 0 TO 15
    SEROUT TXD, Baud,[loopCounter]
    NEXT
  PAUSE 300
  LOW RTS                               ' End transmit mode
END

Program the receiving BASIC Stamp with this code:

' RTX-12 Modem Receive Example.BS2
' RTX-12 Simple Receive.bs2
' {$STAMP BS2}
' {$PBASIC 2.5}

' I/O Pin Definitions
TXD             PIN     0               ' --> RTX-12.5 (Transmit Data)
RTS             PIN     1               ' --> RTX-12.6 (Negative In/PTT)
DSR             PIN     2               ' <-- RTX-12.4 (Carrier Detect)
RXD             PIN     3               ' <-- RTX-12.3 (Receive Data)

' Constants and Variables
Baud            CON      813            ' 1200 bps, no parity, true
loopCounter     VAR      Nib            ' For numbers
callSign        VAR      Byte(6)        ' String for amateur call sign
number          VAR      Byte(16)

IF DSR = 1 THEN receiveCallSign         ' Wait For Carrier Detect
STOP

receiveCallSign:                        ' Receive call sign
  LOW RTS
  SERIN RXD, Baud, [STR callSign\6]

receiveNumbers:                         ' Receive some numbers
  FOR loopCounter = 0 TO 15
    SERIN RXD, Baud, [number(loopCounter)]
    NEXT

displayData:
  DEBUG CLS, HOME, "Amateur call sign: ",STR callSign\6, CR
  DEBUG "Numbers: "
  FOR loopcounter = 0 TO 15
    DEBUG DEC number(loopCounter), " "
    NEXT
  HIGH RTS
END

With the receiver connected to the PC, press reset on the transmitter. You should see the following in the DEBUG terminal:

Full Transmit Programs

RTX-12 Transmit.bs2 and RTX-12 Receive.bs2 (available for download below) have a 16-bit checksum to verify the data packet integrity. The BASIC Stamp debug window will show your results each time the transmitter is reset:

Resources and Downloads

- Full demo source code RTX-12 Transmit.bs2 and RTX-12 Receive.bs2
- Simple demo source code RTX-12 Simple Transmit.bs2 and Simple Receive.bs2


 Print   

Copyright 2008 by Ken Gracey   Terms Of Use  Privacy Statement
DotNetNuke® is copyright 2002-2012 by DotNetNuke Corporation