xbee comm problem

Greetings,

I recently purchased 2 Xbee series 1 modules. I am currently interfacing two PIC18F452 MCUs sending data back and forth from one another.

I have tested numerous serial interface (hard line) programs I’ve created for both the two pics via UART and have never had any issues, therefore I can rule out my coding for both transmit & receive side of my two PICs are in good standing. I can verify through output of the receiving end and as well as on my oscope.

when I substitute the (hard line) connecting the two PICs with the xbee modules. *Note only connections I have utilized on the xbees are VCC, DOUT, DIN, and GND. I have a green led indicator on pin 6 (RX Sig Strength), a yellow led on pin 13 (module status indicator), and a red led on pin 15 (Associated indicator).

I am providing 3.3V to the xbee modules accordingly and I also use sparkfun’s logic level converter (3.3 to 5, 5 to 3.3).

TRANSMITTER Side

When I send data out from the transmitter side, I can verify that data is being sent to the transmitter xbee via oscope. Yellow indicator stays on and red led blinks every .7 of a second, and green led is off.

RECEVER Side

When I transmit my data to the receiver the green led of the receiver xbee turns however, the data sent from my transmitter is not present on DOUT of the receiver xbee. My transmitter appears to be communicating to the receiver xbee as everytime I send out data the receiver’s green led turns on. Issue is that not data is not present at DOUT of the receiver for my MCU to read and process. What am I doing wrong?

I was told that the xbee modules require no additional code modifications, it should send and receiver signals as if the PICs were connected by invisiable wires. Is there any other configs I am required to perform on my xbees to get a my signal out of the DOUT of the receiver?

Also, I am not using API or any other modes. I would like to just work in transparent mode and avoid any other configurations.

TIA

-Ron

Correct firmware in the Xbees? There are different functional versions.

Xbee’s configured correctly- - SRC, DST addresses? Baud rates?

Is the serial out or in on the PIC inverted polarity versus what the XBee’s use? This is a common problem.

Hi stevech,

check source address of two xbees, then set as destination address of each other.

And baud rate should be the same.

Is there anything else?

stevech:
Correct firmware in the Xbees? There are different functional versions.

Xbee’s configured correctly- - SRC, DST addresses? Baud rates?

Is the serial out or in on the PIC inverted polarity versus what the XBee’s use? This is a common problem.

If you have not changed any of the XBee settings, they should work “like wires” right out of the box. You don’t have to pay attention to source and destination addresses, or anything like that, again, as long as they’re using the default settings. Per the manual

2.1.2. Transparent Operation

By default, XBee/XBee-PRO RF Modules operate in Transparent Mode. When operating in this mode, the modules act as a serial line replacement - all UART data received through the DI pin is queued up for RF transmission. When RF data is received, the data is sent out the DO pin.

For this to work, you have to of course communicate with the units correctly at both ends. I believe they default to 9600 8N1 (later: confirmed). Do you have the ability to connect to the modules using a terminal program or their X-CTU software? You can use that to check and reset the settings.

There’s also quite a bit of useful information here

http://www.selmaware.com/appbee/AppBee_Doc.PDF

about how to use the settings and so on.

I don’t agree to you all the words.

First because I need two xbee communicate each other, so I must set MY,DL each other. In default setting, it means that one xbee communicate to multiple xbees not one xbee.

And I saw your recommended link, it is truly useful.

thanks a lot. I will tell you if I get any progress.

good day.

sylvie369:
If you have not changed any of the XBee settings, they should work “like wires” right out of the box. You don’t have to pay attention to source and destination addresses, or anything like that, again, as long as they’re using the default settings. Per the manual

2.1.2. Transparent Operation

By default, XBee/XBee-PRO RF Modules operate in Transparent Mode. When operating in this mode, the modules act as a serial line replacement - all UART data received through the DI pin is queued up for RF transmission. When RF data is received, the data is sent out the DO pin.

For this to work, you have to of course communicate with the units correctly at both ends. I believe they default to 9600 8N1 (later: confirmed). Do you have the ability to connect to the modules using a terminal program or their X-CTU software? You can use that to check and reset the settings.

There’s also quite a bit of useful information here

http://www.selmaware.com/appbee/AppBee_Doc.PDF

about how to use the settings and so on.

ceibawx:
I don’t agree to you all the words.

First because I need two xbee communicate each other, so I must set MY,DL each other. In default setting, it means that one xbee communicate to multiple xbees not one xbee.

Well, it’ll work without setting those, if you’re just trying to get one XBee to talk to another one. You only need to worry about MY and DL if you’re setting things up specifically for point-to-point communications. If you only have two XBees, it doesn’t make any difference - except that setting those addresses also enables error checking, acknowledgement, and retries.

You can set MY and DL either through a terminal program (or X-CTU), or in software as shown in the examples on that Selmaware page I gave the link to:

SEROUT TX, Baud, [“+++”] ’ Enter command mode

PAUSE 2000 ’ Guard time for command sequence

SEROUT TX, Baud, [“ATNI BS2 Test Node”, CR, ’ Set description

"ATMY ", HEX myAddr, CR, ’ Set node address

"ATDL ", HEX DestAddr, CR, ’ Set destination address

“ATD6 1”, CR, ’ Use RTS for flow control

“ATCN”, CR] ’ Exit command mode

(of course you’ll have to adjust this to whatever language you’re using)

sylvie369:

ceibawx:
. If you only have two XBees, it doesn’t make any difference - except that setting those addresses also enables error checking, acknowledgement, and retries.

Using a destination address = all ones for broadcast does indeed disable error correction ACKs, and that is of course important if your application does no error checking or lost-frame detection.

stevech:
Using a destination address = all ones for broadcast does indeed disable error correction ACKs, and that is of course important if your application does no error checking or lost-frame detection.

Correct. Obviously working with ACKs in broadcast mode would raise some real messes. Per the manual:

2.4.2. Broadcast Mode

Any RF module within range will accept a packet that contains a broadcast address. When configured

to operate in Broadcast Mode, receiving modules do not send ACKs (Acknowledgements) and

transmitting modules do not automatically re-send packets as is the case in Unicast Mode.

To send a broadcast packet to all modules regardless of 16-bit or 64-bit addressing, set the destination

addresses of all the modules as shown below.

Sample Network Configuration (All modules in the network):

• DL (Destination Low Address) = 0x0000FFFF

• DH (Destination High Address) = 0x00000000 (default value)

stevech:
Using a destination address = all ones for broadcast does indeed disable error correction ACKs, and that is of course important if your application does no error checking or lost-frame detection.

Correct. Obviously working with ACKs in broadcast mode would raise some real messes. Per the manual:

You mean that I should use broadcast mode!

The reason is to disable ACK for making sure data received quality.

Can you think like this?

Your reply is expected.

I’d like to bring this thread back from the dead. After searching all over the place, this seemed to be the most relevant thread available so I didn’t want to create a new one.

I’ve got (2) XBee Pro series 2 modules, connected to a single PC via adafruit’s XBee adapter, and FTDI’s TTL-232R-3V3 cable. Both modules were recognized in Windows 7, and I was able to verify their firmware and serial number in X-CTU. I successfully changed the baud rate to 19.2k, and I also set them to the same PAN ID (1111).

From the posts here, and elsewhere on the web, I understand that as-is, these two XBee boards should work together like a virtual serial cable. In other words, if I launch two instances of X-CTU, I should be able to go to the terminal tab in each instance and whatever I type into one terminal should appear in the other. However, when I type, nothing goes across. I have all of the other settings left at their default values.

Can anyone shed some light on my problem, or offer some suggestions? I read the previous posts regarding MY and DL, and thought that maybe I’d try changing those through X-CTU, but they are read-only for some reason. I have tried selecting different function sets, but they are still grayed out.

Is “ZNET 2.5 ROUTER/END DEVICE AT” the right function set to start with if I just want to pass through serial data, and not mess with DIO and other features?

I believe series 1 does this “right out of the box” but is more involved with series 2.

See this thread for discussion about the different firmware for series 2 -

viewtopic.php?f=13&t=17215&hilit=multiple+xbees

robins:
I believe series 1 does this “right out of the box” but is more involved with series 2.

See this thread for discussion about the different firmware for series 2 -

viewtopic.php?f=13&t=17215&hilit=multiple+xbees

Great tip, thanks! That thread seems to address my problem directly. I’ll start reading the documentation that was referenced there. :slight_smile: