Pages: [1]   Go Down
Author Topic: Xbee Baud Rate  (Read 1000 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm trying to set the baud rate of the of an Xbee using an Arduino and it seems like it should be an easy task using terminal software or X-CTU. However, I've been unable to connect to the Xbee using the Arduino as the serial device that is connected to the computer to set the baud rate. I'm mostly wondering if it's even possible to do this or if i need additional hardware outside the Arduino and the Xbee Shield from SparkFun to be able to communicate with the Xbee directly so that I can set the baud rate. I'm using an Uno R3 if that helps. I can provide any additional information per request.

Thanks for your assistance!
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 548
Posts: 46026
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I'm mostly wondering if it's even possible to do this or if i need additional hardware outside the Arduino and the Xbee Shield from SparkFun to be able to communicate with the Xbee directly so that I can set the baud rate.
Yes, it is possible. No, you don't need more hardware. In fact, you need less hardware. You need to remove the ATMega328 chip from the Arduino while you are doing this. Be sure to keep track of which way it is installed, so you can reinstall it the same way.

That's a hassle, so getting a USB Explorer is a good idea.
Logged

the land of sun+snow
Offline Offline
Faraday Member
**
Karma: 149
Posts: 2790
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Assuming a UNO board [which you didn't specify], you cannot connect XBee to Arduino header
pins 0,1 [Rx,Tx] at the same time as talk to the Arduino from the PC via USB. The signals
conflict.

You can do what Paul says, but you have to cross-wire the XBee to the Rx,Tx pins to get the
USB port thinking the XBee module is an Arduino.

You can also avoid removing the 328 chip by simply holding it in reset - easiest way is to short
the Reset pin on the ICSP header to ground [don't short the Vcc pin by mistake].
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the reply, Ive tried taking that out already and i still can't get it to work. Is there anything else after that I need to do either on the Arduino, the shield or on the computer to make it know that you are trying to communicate with the Xbee correctly?

I have tried to just put the shield on top of the Arduino and wiring it up like this:
http://i49.tinypic.com/jidq44.jpg  I tried just putting in the image and it looked awful on this elderly forum software.

Edit: Is it maybe that it's still using the Arduino drivers?
« Last Edit: December 08, 2012, 02:06:11 pm by caseyzahorik » Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 331
Posts: 16499
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The way you have Xbee wired to the arduino pins 0 and 1 in that picture, the AVR chip can send and receive to the Xbee board. If you want the Xbee board to talk directly to the PC X-CTU program you need to switch the wires around on pins 0 and 1 and wire a temporary jumped from ground to the reset pin on the arduino. That will let the Xbee 'own' the USB serial link to the PC with no electrical interference from the AVR chip.

But that is effectively what the small switch does (not sure about the hard reset part) on the Xbee board when mounted on a arduino board, it reverses the send and rec signals to allow Xbee to send/rec to the USB serial link instead of send/rec to the AVR chip.

Lefty
« Last Edit: December 08, 2012, 02:13:14 pm by retrolefty » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Okay i have tried doing what you said (I believe). However it's still unable to communicate over serial.

Here is how it is now wired: http://i49.tinypic.com/33yklmu.jpg

Thanks for your assistance!
« Last Edit: December 08, 2012, 02:36:54 pm by caseyzahorik » Logged

the land of sun+snow
Offline Offline
Faraday Member
**
Karma: 149
Posts: 2790
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

1. to me, you have one of the worst designed XBee shields there is. They say "level
    shifters" but I'm not sure they really are. Other boards have better level-shifters.
    [of course, everyone has their own opinion on EVERYTHING in electronics].

2. it also looks as if you may have an older [?] or newer [?] XBee shield than is currently
    shown on the s-f site, so who knows what's actually on it. Some of the older s-f bds had
    no level-shifters at all. In any case, the XBees run at 3.3V and Arduino at 5V, and you
    cannot interface them directly without damaging the XBee. On S1 modules, the Din
    pin is not 5V tolerant.

3. as lefty indicated, since your shield has a cross-connection switch on it, you need to make
    sure it's in the correct direction for the Rx,Tx connections.

4. the XBee S1 series come pre-set for 9600 bps [at least they used to], so your terminal s.w.
    needs to be set there.

5. I would try a terminal emulator not XCTU and not the Arduino Serial Monitor. First make
   sure the the PC is finding the CORRECT comport.

6. if everything is wired right, and baud set right, you need only type in "+++" and the
   XBee will respond OK.

7. the other problem some people have is some Arduino bds may not be able to supply enough
    current for an XBee, but I think you're ok here. You might check the 5V and 3.3V levels at
    the shield.


Logged

the land of sun+snow
Offline Offline
Faraday Member
**
Karma: 149
Posts: 2790
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

@lefty, on another note, you mentioned the other day that the FTDI chip gets power from
the 5V rail, via the Power Jack, when the USB port is not connected, so you can still get a
measly 50mA out the 3.3V pin.

Do you know what state the TXD,RXD pins on the FTDI chip are in when it's powered this way?
[USB connector is not connected]. If low-impedance, then this is bad.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

the shield that I'm using is: https://www.sparkfun.com/products/10854
It says you can connect it to 5v and it regulates the voltage down to 3.3v. I'm able to communicate between the 2 Xbee's that i have so i would think that they power that it is provided is okay.

I don't know how easy it is to see in the picture but i have the switch at DLINE which i believe is the USB side. However, I have tried it both ways as well as switching the wires up. Being that i have the switch to DLINE and the TX -> TX and RX -> RX in the form Arduino -> shield. Am I supposed to do it like TX -> RX and RX -> TX instead as I had it in the first picture that i posted?

I'm using Putty as my terminal  software and it is configured as followed: http://i45.tinypic.com/29l1nxx.jpg
The device is set up as follows: http://i49.tinypic.com/535uhe.jpg

Actually those are a little mixed but have all the information none the less.

Logged

the land of sun+snow
Offline Offline
Faraday Member
**
Karma: 149
Posts: 2790
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

1. Good, that looks like an updated version of the s-f shield, and the schematic shows
    level-shifters. MUCH better design. And dated 11/26/12 - just in time!

2. However, the switch does not cross Rx,Tx, rather it connects over to pins 2,3, and only
    if you solder in jumpers yourself for the alternate-position. So, the switch has to be in the
    default [pin 0,1] position, and you need to cross-wire pins 0,1 using external jumpers.

3. Your PUTTY setup appears to be ok, however, are you sure COM2 is the proper port? I never
    see such low port values on my computer. I see you're using an R3 board, which I've not
    used. Are you able to download sketches ok, and it's COM2 in the Arduino IDE?

4. Don't worry, be happy, XBee setting up is always a big mess for some reason. Too many
    factors in play.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for your help. Sorry it took me so long to respond, I have had to take care of some stuff that required me to be away from my computer.

I'm unsure exactly what you mean when you say.
Quote
2. However, the switch does not cross Rx,Tx, rather it connects over to pins 2,3, and only
    if you solder in jumpers yourself for the alternate-position. So, the switch has to be in the
    default [pin 0,1] position, and you need to cross-wire pins 0,1 using external jumpers.

I'm not sure where I need to solder in these jumpers and if you mean for me to connect pins 2 and 3 from the Arduino to the shield and how/where you want me to cross wire it. Sorry if this is a stupid question, but would you mind just laying out where all the jumpers go? For example: arduino,p# -> shield,p#

Thanks!
Logged

the land of sun+snow
Offline Offline
Faraday Member
**
Karma: 149
Posts: 2790
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I hate to say it, but now that we've been through all this, I want you to forget everything
I've said, and don't try using XCTU or a Terminal Emulator to directly talk to the XBee.
 
I'm afraid you'll damage the XBee module. I don't trust the design of the s-f shield, in
case you wire things wrong [I'm gonna start a thread on this on the Electronics section
to ask for opinions].

The other alternatives are buy an adaptor [which you should probably have in any case]
that allows direct PC to XBee comms, like this one

http://www.adafruit.com/products/247

or else write a sketch you can load into the Arduino, then disconnect the USB and connect
the XBee shield, and run the sketch to set the XBee parameters. The sketch will have to
run at the current baudrate of the XBee, and start with "+++", and end with a write to
the XBee's eeprom. [sorry].


Logged

Pages: [1]   Go Up
Jump to: