Society of Robots
     | Robot Forum | Robot Tutorials | Robot FAQ |
September 08, 2010, 12:55:35 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: SoR Robot Chat every friday night. Join us! (forum integration fix coming when I have time)
http://www.societyofrobots.com/robotforum/chat/

Robot Forum
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Connecting an Xbee to the Axon  (Read 927 times)
0 Members and 1 Guest are viewing this topic.
adastaTopic starter
Beginner
*

Helpful? 1
Offline Offline

Posts: 5


View Profile
« on: December 10, 2009, 05:36:09 PM »

Hello Folks,

I have used the Axon board quite successfully on several projects, but each time I that I need to connect it to an Xbee I have quite a bit of trouble. 

The different voltage levels for each chip (3.3V on the Xbee) and 5 volts on the Axon Atmega640 means that you can't connect them directly.  I have tried using a sparkfun level converter :
http://www.sparkfun.com/commerce/product_info.php?products_id=8745

along with a sparkfun Xbee explorer regulated board :

http://www.sparkfun.com/commerce/product_info.php?products_id=9132

to connect the chips.  This produces a clean looking transmission on my oscilloscope, but the Axon cannot receive or transmit any data. 

The only solution that I have found is to use a inverter (7404) to buffer the signal between the axon and the Xbee explorer board.  This works well with Series 1 Xbees, but fails with Series 2.5 Xbees.   

Can anyone think of  an  electrical reason for the atmega640 finicky UART port?   How do you all connect your Xbee to your Axon?  Is there a good board that I can purchase?

Thanks for the help.
Logged
Admin
Administrator
Supreme Robot
*****

Helpful? 110
Offline Offline

Posts: 9,846



View Profile WWW
« Reply #1 on: December 11, 2009, 03:33:54 AM »

The Axon UART Rx will work fine getting 3.3V logic, no problem. Built-in resistors protect it from damage.

The Xbee however is a different story, as a 5V signal might damage the 3.3V tolerant Rx pin. If you look at the schematic of your converter:
http://www.sparkfun.com/datasheets/BreakoutBoards/Level-Converter-v10.pdf
you'll see its just a simple two resistor voltage divider for Rx - the *simplest* circuit in the world. But its quickly obvious why it isn't working - SparkFun chose the wrong resistors! Shocking!

That voltage divider they chose results in a 1/2 voltage output (two 10k resistors). So if you feed it 5V signal, it outputs a 2.5V signal - thats too low (what voltage does your oscope say?). You need ~3.3V. Sooooo doing the math:

(5V-3.3V)/10k = (3.3V-0V)/X
X = 3.3V*10k/1.7V
X = 19.4kohm resistor

Unsolder and replace the resistor connected to ground to be around 19.4k-ish ohms or less (doesn't need to be exact).

It also drains current according to a quickie Google search at about ~180mA during xmit, meaning you can't use the Axon 3.3V regulator (as you probably already know). An external 3.3V regulator is all you need.

Now looking at that XBee Explorer datasheet:
http://www.sparkfun.com/datasheets/Wireless/Zigbee/XBee-Regulated-v10.pdf

It appears they are using a diode to drop the signal by ~1.2V on the DIN pin, and a 1k resistor to absorb some current. Except there are two problems:
5V-1.2V is 3.8V - still too high!
and they have the diode backwards, at least in the schematic (so it won't work)

There you have it, SparkFun can't even get a voltage divider or a diode correct Tongue
Logged

waltr
Supreme Robot
*****

Helpful? 30
Offline Offline

Posts: 714


View Profile
« Reply #2 on: December 11, 2009, 08:43:42 AM »


Now looking at that XBee Explorer datasheet:
http://www.sparkfun.com/datasheets/Wireless/Zigbee/XBee-Regulated-v10.pdf

It appears they are using a diode to drop the signal by ~1.2V on the DIN pin, and a 1k resistor to absorb some current. Except there are two problems:
5V-1.2V is 3.8V - still too high!
and they have the diode backwards, at least in the schematic (so it won't work)

There you have it, SparkFun can't even get a voltage divider or a diode correct Tongue

You have misinterpreted the SparkFun schematic. Take another look at that schematic.
The diode functions by blocking a positive voltage to the XBee. The DIN line is pulled up with a internal resistor (see AT command PR) for a logic high but allows an external signal to pull it to logic low. Kind of like an Open Collector circuit. This works perfectly on the Series 2 XBee modules I have with a 5V PIC but have heard problems with the 900MHz XBee Pro modules.
This may be due to the voltage drop across the diode with a logic low signal. The DIN pin would be a diode drop above ground. If this is not low enough then the XBee's DIN doesn't see a logic low.
Logged
Admin
Administrator
Supreme Robot
*****

Helpful? 110
Offline Offline

Posts: 9,846



View Profile WWW
« Reply #3 on: December 11, 2009, 05:43:52 PM »

Ah yes, I didn't realize that other LED is also connected with the 3.3V pull-up. I take back my diode comment Grin

What voltages does your oscope read on that DIN pin? I'm curious what the diode voltage drops are.
Logged

waltr
Supreme Robot
*****

Helpful? 30
Offline Offline

Posts: 714


View Profile
« Reply #4 on: December 11, 2009, 10:37:34 PM »

Good question. I'll have to measure the voltage and report back.
Logged
madsci1016
Supreme Robot
*****

Helpful? 25
Online Online

Posts: 931



View Profile WWW
« Reply #5 on: December 12, 2009, 12:06:35 AM »

I use an 900 pro Xbee on a regulated board connected directly to an Axon Uart and have no issues at all. It has worked for a few months now.
Logged

waltr
Supreme Robot
*****

Helpful? 30
Offline Offline

Posts: 714


View Profile
« Reply #6 on: December 14, 2009, 03:25:01 PM »

Ok, I measured the DIN pin on the XBee with the diode in series from the PIC's Dout line.
The low level signal is 0.52 Volt.
« Last Edit: December 14, 2009, 04:42:38 PM by waltr » Logged
Admin
Administrator
Supreme Robot
*****

Helpful? 110
Offline Offline

Posts: 9,846



View Profile WWW
« Reply #7 on: December 14, 2009, 07:04:13 PM »

The low is fine. Whats the high level signal?
Logged

waltr
Supreme Robot
*****

Helpful? 30
Offline Offline

Posts: 714


View Profile
« Reply #8 on: December 16, 2009, 05:08:32 PM »

Ok, charged the battery and re-measured the serial signal levels.

PIC output to XBee regulator board: High = 4.65V, low = 0.14V
DIN on XBee pin: High = 3.20V, low = 0.50V

Logged
bonzo
Beginner
*

Helpful? 0
Offline Offline

Posts: 1


View Profile
« Reply #9 on: December 23, 2009, 01:33:44 PM »

I too am using the sparkfun regulated explorer and am receiving commands just fine, but transmitting does not seem to work.

I have used the same combination of xbee / regulator with an arduino and have not problems transmitting and receiving.

With the axon, I have tried UART2 and UART0 and have tried baud rates of 9600 and 19200 with the same behavior.

Here is the really weird thing : when trying to transmit from the axon, the little green led on the xbee regulator lights up, but nothing is received on the computer and the corresponding green light on the USB explorer does not light up. BUT when I then send more commands from the computer, they are received by the AXON and the green transmit lights up on the AXON and the computer, but what comes across is just gibberish (on the computer). I have tried sending both single bytes and rprintf strings.

Again the thing that is odd is that when the AXON is just sending, the computer does not receive anything, but when the computer sends information to the AXON, the computer does receive information from the xbee, but it is just gibberish.

I have also tried two separate regulated explorers and xbees with exactly the same behavior and both work with arduino.

Any thoughts on this? I am kind of stuck any ideas would be appreciated.
Logged
waltr
Supreme Robot
*****

Helpful? 30
Offline Offline

Posts: 714


View Profile
« Reply #10 on: December 23, 2009, 02:32:43 PM »

You may need to look at the XBee's DIN pin with an O'scope to measure the logic low voltage level. A DVM may be good enough if you can set the Axon's output low.
The XBees docs say a logic low is less than 0.6V when Vcc is 3.3V. The Axon's output may not be pulling the DIN input low enough with the series diode. Note in my post above the PIC's low output is 0.14V and the XBee's DIN is 0.50V, the Axon's may be a little higher therefore the XBee's DIN may not be pulled low enough to be detected as a valid logic low.
This logic low threshold may shift slightly when the XBee is receiving data therefore making the DIN kinda working but misses a few low bits that shows as garbage on the PC.

I don't know what type of diode Sparkfun has on the board but from my measurements I suspect its a Schottky so replacing the diode won't help.
Another way is to short out the series diode and place a 5V to 3.3V level shifter between the Axon's serial output and the XBee's DIN. Alternately, replacing the series diode with a resistor voltage divider may also work. Lastly, replace the series diode with a series resistor and then clamp the XBee's DIN pin with several series diodes from ground to 3.3V max.

Logged
KurtEck
Full Member
***

Helpful? 5
Offline Offline

Posts: 98


View Profile
« Reply #11 on: December 30, 2009, 12:13:38 PM »

Have you had any more luck with this?

I am hooking up an XBEE to the Axon2 with the sparkfun regulated explorer and it appeared like I was not having any luck getting it to communicate.

So I grabbed one of my APPBee-Sip boards from Selmaware.com (which is twice the price and probably twice as big as it has a full built in voltage regulator and an IC that does voltage conditioning...  Will use the Sparkfun version with one of my BAP28 based robots or test board...
Logged
webgeek
Jr. Member
**

Helpful? 0
Offline Offline

Posts: 32


View Profile
« Reply #12 on: January 06, 2010, 09:45:33 AM »

Quote
So I grabbed one of my APPBee-Sip boards from Selmaware.com (which is twice the price and probably twice as big as it has a full built in voltage regulator and an IC that does voltage conditioning...
And did it work? Thanks!

-Mike
Logged
KurtEck
Full Member
***

Helpful? 5
Offline Offline

Posts: 98


View Profile
« Reply #13 on: January 06, 2010, 03:41:23 PM »

Quote
So I grabbed one of my APPBee-Sip boards from Selmaware.com (which is twice the price and probably twice as big as it has a full built in voltage regulator and an IC that does voltage conditioning...
And did it work? Thanks!

Yep it works like champ.  Note it is a lot larger than the sparkfun one and twice the price.


Also note I have been experimenting using the RTS signal of XBEES, which why there is an extra wire soldered into the sprkfun one.  On Basic Atom Pro there are a couple of IO pins which do not output the full 5V so I can get awy with connecting it directly...  Otherwise sparkfun does sell a board that can convert Two input and Two outputs between two voltages.
Kurt

Logged
Pages: [1]
  Print  
 
Jump to:  


Related Topics
Subject Started by Replies Views Last post
Problems connecting PS2 controller to Axon
Electronics
JadeKnight 6 863 Last post September 26, 2009, 01:09:36 AM
by JadeKnight
Axon II and Xbee Connectivity
Electronics
webgeek 11 568 Last post January 06, 2010, 11:07:18 AM
by KurtEck
Axon II and XBee Trouble
Electronics
webgeek 10 699 Last post January 21, 2010, 09:03:40 AM
by KurtEck
Connecting Battery, Servos and Xbee to AxonII. Are the connections Right ?
Electronics
bilals 6 587 Last post March 05, 2010, 08:11:36 PM
by madsci1016
Powered by MySQL Powered by PHP Powered by SMF | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!


Advertise on this Forum