XBEE Communication Help
BKane
Posts: 9
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.
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.
Comments
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.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
* 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 Savage
Parallax Engineering
·