Using XBee As Serial Cable Replacement

Hello all! I’ve been following the tutorials and made it to the basic serial input/output using an atmega168. I’m new to electronics so I was pretty excited when I was able to get the basic-in-atmega168 program working. Here’s proof that the program works …

I had purchased a couple of XBees a while back in hopes I’d be able to do something cool with them once I learned some more. Well this seemed like a good opportunity to use them. The model is XBee 1mW Wire Antennas (sku: WRL-08665) and I have two of them. The goal was to use them as a direct replacement of the serial cable. I read the manual along with some tutorials about setting them up. Pretty simple to do. I was able to use X-CTU to configure the XBees and plugged them in and tried the program again …

So it kinda works. Each time I typed a character I would get a response, but the text was messed up. I tried over and over and the same problem happens consistently. I get a response but in that garbled text. I figured that I had a setting wrong so I started to Google my issue. And then I Google’d some more … and more … Let’s just say that I’ve configured the heck out of these things without any luck. I tried configuring them through a serial connection with ‘+++’ but the same problem persisted. Different baud rates didn’t help either. The manual says they’re pretty much setup to work out of the box as a serial cable replacement. At this point I figure I’m overlooking something so simple that I should just ask here.

Here’s how they’re setup:

XBee 1 (connected to computer)
ATMY 1
ATDL 2
ATID 1313
XBee 2 (connected to atmega168)
ATMY 2
ATDL 1
ATID 1313

And I have the pictures of them so I figured I’d add it too …

I did read through these forums but I couldn’t find any posts with this specific issue. I did see discussions of “Better XBee Documentation” but a search for those terms didn’t provide anything of use. So, any ideas?

process of elimination…

  1. Are you using the Sparkfun breakout board with the infamous diode in series with the data line as a failed design attempt to convert 5V to 3.3V logic levels? If so, there are fixes for that.

  2. Remove the AVR from the question - disconnect it. Jumper that XBee’s RXD and TXD in loopback. Then have the PC send to its XBee via USB, then that XBee sends over the air to the remote XBee, loops back, and sends over the air back to the PC. Confirm this runs correctly.

  3. Now get the AVR code to talk to the PC’s serial port without the XBees. You may need a logic level to RS232 adapter on the AVR. OR! Connect the AVR’s TXD and RXD together in loopback and have your AVR program send to itself and blink an LED or some such if data matches.

Of course, you’ve confirmed all the baud rates are correct. It’s easy to make an error on the AVR baud rate programming - send details on that if you wish: internal/external oscillator choice, frequency, baud rate constant used, etc.

EDIT 0: I had success removing the XBee Explorer Regulated from the remote XBee. Still need help finding out how to fix it.

EDIT 1: Modified the XBee Explorer Regulated to bypass that diode. Please scroll down to my next post to view pictures of my solution.

stevech thanks for the reply! I’ll address each of your suggestions one at a time …

  1. Are you using the Sparkfun breakout board with the infamous diode in series with the data line as a failed design attempt to convert 5V to 3.3V logic levels? If so, there are fixes for that.
I'm not sure. Here's a closeup of my XBee Explorer Regulated. I purchased it fairly recently and the date on the back of it is 8-7-09. I've done a ton of research on the issue and I think the solution you mentioned is to jump over the diode and build a voltage divider. I'd be more than happy to do that, I'm just not sure if it's applicable in my situation.
  1. Remove the AVR from the question - disconnect it. Jumper that XBee’s RXD and TXD in loopback. Then have the PC send to its XBee via USB, then that XBee sends over the air to the remote XBee, loops back, and sends over the air back to the PC. Confirm this runs correctly.
I'm guessing this means that if I turn off local echo in my terminal then each character I type will still be repeated because the remote XBee will send it back, right? If that's the case then it didn't work. I added the jumper on the remote XBee Explorer Regulated's DIN and DOUT pins. I powered up everything and started typing away in the terminal. The TX light on the sending XBee Explorer USB blinked each time, but on the remote XBee Explorer Regulated the DIN hardly blinked and the DOUT blinked almost every time, but not 100%. Occasionally the RSSI light would stay on for a number of seconds and then shut off.

I was wondering if you meant to remove the XBee Explorer Regulated from the remote XBee instead of the AVR. I tried that and i started seeing the characters as I typed them!!! Woohoo! I pulled the remote XBee from the XBee Explorer Regulated and connected pin 1 to 3.3V, pin 10 to GND and then jumped pins 2 & 3 (DOUT & DIN). The manual says “Minimum connections: VCC, GND, DOUT & DIN” so I tried it and it’s working. Looks like the XBee Explorer Regulated is the cause. Any idea where I can find a picture of exactly what needs to be done to it?

… other content removed since I had success above …

Is this the matching schematic?

http://www.sparkfun.com/datasheets/Wire … ed-v10.pdf

If you search the forums, I think you’ll find people that say that this diode in series with the data is a problem. As any greenhorn engineer would know- the forward voltage drop on the diode doesn’t meet the reliable logic level for a “0”. It was a too-cheap attempt to do 3.3V to 5V interfacing. There are cures posted here.

Customers need to really get on SFE’s case - they know about this defect but they keep selling it with no caveat. That’s irresponsible and out of character for the SFE staff.

The loopback idea was: Remote XBee’s DIN/DOUT jumpered together. Nothing else connected. The PC-attached XBee should send the PC’s data to the remote and see it returned. Keystroke by keystroke using a terminal program. If the Xbee’s are configured correctly.

This test would be after dealing with the diode issue.

Consider case gotten on. An older design when we were quicker and dirtier, as it were :oops: . I’ll get this in the project queue and we’ll make it right.

Pete

Pete-O:
Consider case gotten on. An older design when we were quicker and dirtier, as it were :oops: . I’ll get this in the project queue and we’ll make it right.

Pete

Great. But please do something to inform - there are several a week who fall into the mire.

I was able to solve the issue by removing the diode from the DIN and bridging the connection with a wire. I’m aware that this exposed my XBee to possible 5V damage so I created a separate 3.3V supply and everything seems to be working correctly. I also switched the Max232 over to 3.3V. I’m not sure if that was necessary, but I was concerned that the “data” lines would still have enough power to fry something on the XBee.

SparkFun: glad to hear you’re addressing the issue, but like stevech mentioned, please post something on the product page to help others in a similar situation. Sure did frustrate me to say the least.