Shop OBEX P1 Docs P2 Docs Learn Events
BS2px and Parallax 433MHz Tranceiver package — Parallax Forums

BS2px and Parallax 433MHz Tranceiver package

Hammer32Hammer32 Posts: 5
edited 2007-05-25 06:45 in BASIC Stamp
Hi all

I am brand new to BS and am having a few troubles getting my new RF Transceiver package to talk to each other.

I am using a BS2px24 with the modules seen here www.parallax.com/html_pages/products/communication/rf_modules.asp

I thought the best thing to do first was to copy the BS2 code into the two stamps I have and see if it works.

I did this and it didn't work. I tried changing a few things with the code but it didnt seem to make a difference so I am thinking something else is wrong that I am not aware.

Currently the TX code loops through but the Rx code just sits there waiting like it is receiving no data?

Also could running this next to a laptop using wireless cause problems?

here is the code I am using it is basically straight from the manual.

the Transmit code I have is

' {$STAMP BS2px}
 ' {$PBASIC 2.5}



x VAR Word
y VAR Word
DO


  PULSOUT 12, 3000 'Sync pulse for the receiver
  SEROUT 12, 16468, [noparse][[/noparse] "!", x.HIGHBYTE, x.LOWBYTE, y.HIGHBYTE, y.LOWBYTE ]

  x = x + 1
  y = y + 1
  PAUSE 10
LOOP





Then the code for RX

' {$STAMP BS2px}
' {$PBASIC 2.5}


x VAR Word
y VAR Word
DO

    LOW 0
    SERIN 13, 16468, [noparse][[/noparse]WAIT("!"), x.HIGHBYTE, x.LOWBYTE, y.HIGHBYTE, y.LOWBYTE]
    HIGH 0
    DEBUG ? x
    DEBUG ? y
    LOOP





Is there some sort of conversions i need to make because the example code is for BS2 and not 2px?

If anyone can set me on the right path I would be very grateful.

Thanks

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-05-24 13:46
    Hammer,

    The BS2 uses a different baud value for 9600bps. On the BS2px that translates to 38.4kbps due to timing differences. This is way too fast for the transceiver to operate. For 9600bps on the BS2px use a baud value of 16780. I hope this helps. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • stamptrolstamptrol Posts: 1,731
    edited 2007-05-24 14:01
    Hammer,

    As a first change, the baud mode parameter (ie 16468) should be changed to correspond to the BS2px. See the Help file under SERIN.

    Unless your laptop's wireless radio is way out of whack, there should be no interference.

    I'm not trying to be funny, but you're sure you've got one transmitter and one receiver being used? One has 5 pins, the other has 4 pins.

    Cheers,

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Sisk

    http://www.siskconsult.com
    ·
  • Hammer32Hammer32 Posts: 5
    edited 2007-05-24 23:18
    Thanks for that. I changed the baud rate and at least got an indication that there was data coming through. However it was displayed as gibberish in the debug screen.

    This is a small example of what came through.

    [code]
    oW%oU%oU%oW%oW
  • FranklinFranklin Posts: 4,747
    edited 2007-05-25 00:30
    First off you are not initializing x and y so they have no known value (unless pbasic assigns one) and then on your debug statements you are not formatting the output so those values may be correct just not displayed in the form you want for instance a decimal 10 is an ascii CR.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • Hammer32Hammer32 Posts: 5
    edited 2007-05-25 06:45
    Thanks stephen I was just going with the parallax example for simplicity. Still seem to be having the usb issue, which makes it really hard to debug the results.
Sign In or Register to comment.