Shop OBEX P1 Docs P2 Docs Learn Events
XBEE Communication Help — Parallax Forums

XBEE Communication Help

BKaneBKane Posts: 9
edited 2010-04-27 17:59 in BASIC Stamp
I posted earlier about communicating between two XBEE pros. I am a Tx/Rx setup and I am only communicating one way. I am not using flow control and I did not configure my XBEEs because I am working at 9600 baud. I am going from a BS2 module to a BS2p module.

On the Tx end: I have an XBEE pro placed on an adapter board. I am working with a BS2 module. I have a 9V DC source connected to my education board. I have a 3.3 voltage regulator that drops the voltage going into Vcc of the XBEE. I have DOUT going to pin 2 of the BS2. For DIN, I have a 4.7k resistor from pin 1 to DIN and a 10k resistor from DIN going into ground. I was told that DIN also needed to have 3.3V so this drops the voltage while also communicating the information.

On the Rx end: I have an XBEE pro placed on a USB adapter board. I have a BS2p module on this end, with a 9V source connected to the education board. I also have a 3.3 voltage regulator for the Vcc of the XBEE. And I have DOUT going to pin 2 and DIN going to pin 1.

This is my whole setup. I'm pretty sure I have everything setup correctly. Here is the simple program I am trying to run:

' {$STAMP BS2}
' {$PBASIC 2.5}
'***********************
' Simple_tx.bs2
' ***********************
RX PIN 2
TX PIN 1
X VAR Byte

HIGH TX
X = 25
DO
SEROUT TX,84, [noparse][[/noparse]X]
DEBUG DEC X
PAUSE 2500
LOOP
END

' {$STAMP BS2p}
' {$PBASIC 2.5}
' ***************************
' simple_rx.bs2
' ***************************
RX PIN 2
TX PIN 1
X VAR Byte

HIGH RX
DO
SERIN RX,240, [noparse][[/noparse]X ]
DEBUG DEC X
PAUSE 1000
LOOP
END

I tried to run this program but didn't get the desired results.
I am getting weird numbers like : 302553625502550255025502550255
Also, it is weird because in order to get an output I have to physically touch the XBEE on the receiving end. When it just stands alone, no numbers are output. Only when my finger gets close to the XBEE the numbers are output.
I was told that this problem is being caused by something in my code, but can someone check my setup and my code. The pictures of my Tx and Rx are attached.
3072 x 2304 - 2M
3072 x 2304 - 2M

Comments

  • WildatheartWildatheart Posts: 195
    edited 2010-04-26 23:47
    Start with using the simple RX and TX programs found at http://www.selmaware.com/appbee/AppBee_Doc.PDF

    Modify the PIN designations, stamp designation, and baud setting to accomodate your setup.

    A successful data exchange will confirm your hardware connections, and you can then taylor your program according to your needs.
  • FranklinFranklin Posts: 4,747
    edited 2010-04-27 02:11
    You probably have not configured your xbees for transparent mode and are in api mode that sends packets rather than plain serial. You need to be in AT mode. You can Google 'xbee at mode' for more info.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • tomalgajatomalgaja Posts: 1
    edited 2010-04-27 06:22
    XBee modems are one of the easiest ways to create a wireless point-to-point or mesh network. They have error correction, are configured with AT commands, come in multiple flavors and can create a wireless serial link out of the box! I wanted to make a wireless Arduino project but all the adapter boards on the market made me unhappy. So I designed what I think is an excellent low-cost adapter board.

    * Yes it can act as a breakout board, but it also has....
    * Onboard 3.3V regulator to cleanly power your XBee, up to 250mA
    * Level shifting circuitry means that its trivial to connect it to 5V circuitry such as an Arduino without risk of damage
    * Two LEDs, one for activity (RSSI), the other for power (Associate)
    * 10-pin 2mm sockets included to protect the modem and allow easy swapping, upgrading or recycling


    Post Edited By Moderator (Dave Andreae (Parallax)) : 4/27/2010 1:13:09 PM GMT
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2010-04-27 17:59
    You should also remove the PAUSE from the RX side. It is possible in your current configuration that at some point the RX side will be in PAUSE mode when the data is received.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Parallax Engineering
    ·
Sign In or Register to comment.