XBee Problem
ryfitzger227
Posts: 99
Hi everyone.
I'm trying to get a propeller to send a string to the computer via XBee. I have one XBee plugged into a USB Adapter Board and then connected to the computer. No other connections are made on that. The other XBee is just plugged into a regular adapter board. It has +3.3V from the QuickStart board going to VCC and VSS is connected to VSS on the QuickStart board also. I have DOUT going to P0 and DIN going to P1. All of the XBee settings have been set to default with X-CTU. Here's my code:
When I open up the Parallax Serial Terminal and set it to COM11 (the Serial Port of the XBee in the USB Adapter Board) with 9600 baud, nothing comes up. Any ideas on what I'm doing wrong?
I'm trying to get a propeller to send a string to the computer via XBee. I have one XBee plugged into a USB Adapter Board and then connected to the computer. No other connections are made on that. The other XBee is just plugged into a regular adapter board. It has +3.3V from the QuickStart board going to VCC and VSS is connected to VSS on the QuickStart board also. I have DOUT going to P0 and DIN going to P1. All of the XBee settings have been set to default with X-CTU. Here's my code:
OBJ XB : "Extended_FDSerial" CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 VAR long count Pub Go XB.start(0, 1, 0, 9600) ' Initialize comms for XBee repeat XB.str(string("Hello"))
When I open up the Parallax Serial Terminal and set it to COM11 (the Serial Port of the XBee in the USB Adapter Board) with 9600 baud, nothing comes up. Any ideas on what I'm doing wrong?
Comments
You might want to put a pause of about 5 milliseconds between the "hello"s. The default "packetization timeout" is 3 character widths, about 3ms at 9600 baud. If there isn't a pause, it will continue to accept characters until it has 100 in its transmit buffer.
On the bottom of the module, you can find the model number that probably starts with XBP9B-D, and the 16 digit hex MAC address that will be used as the device specific network address.
I like to start off with a simple terminal loop on the Prop: A full object is attached. (it uses fullDuplexSerial4port, one port for the debug terminal and one for the XBee.) What you type at the terminal is sent out through the XBee to another XBee, and vice versa. You can also enter "+++" at the debug terminal in and enter commands such as ATVL to see the firmware version, or ATDL to read or set the destination address.