Arduino and XBee shield...

Hello, I am very new to Arduino but my main goal is to get the board working with the XBee shield.
I currently have:
1 Arduino Diecimila board
1 NKC hardware Diecimila compatible board
2 XBee shields with XBee modules.

I know everything works as I've managed to upgrade the firmware and everything on the XBee modules, but for the life of me and I can't get either the tutorial here: Arduino Playground - Xbee013 or here: http://itp.nyu.edu/~raf275/meshnetworking/XBee/XBee_program_Arduino_wireless.html to work.

For the first tutorial I just don't get anything in the serial output box.

For the second tutorial, if I upload the example sketch from the itp site without the XBee shield the LED at pin 13 blinks as it should. Once I plug the XBee shield in though it doesn't blink anymore. I'm not sure if this is expected, but I also can't load a sketch to the chip while the shield is plugged in. I've tried this on both boards with each shield and get the same results.

I believe I have the jumpers set correctly as well. The "remote" board has both jumpers set on the "xbee" side while the board attached to my computer has it's jumpers set to the "usb" side and the chip removed. The remote board is being powered by a 9v plug and the one attached to my computer is being powered by usb.
Is there something simple I'm missing?

TIA

hi

you have to configure the Xbee modules using a serial program-- see that part of the tutorial. it's a bit tricky, as in hit and miss, but if you just proceed slowly and follow the config instructions it works fine.

D

Thank you for the quick response.
Sorry I left that out. I actually have done those steps already. Even when I type "ATND" via the serial console I can see the other XBee module so I'm assuming they are connected. Is their another way to verify they are actually connected?

Thanks.

You can upload a program that outputs via serial (e.g. the ASCII Table example) to the remote board, and check that you can see the data via the local board in the Arduino serial monitor.

You can upload a program that outputs via serial (e.g. the ASCII Table example) to the remote board, and check that you can see the data via the local board in the Arduino serial monitor.

I think that's what the first tutorial I tried was more or less doing, but I'll give it another go tonight.

So in theory, the XBee shield should just work though right? No other hardware mods are needed?

Ah, sorry, I missed that. Did you change the baud rate on the modules with the instructions at: Arduino Playground - Xbee012? You don't actually need to for the boards to communicate (only if you want to program them wirelessly), but the baud rate in your sketch needs to match the one that they're configured for, as does the rate in the serial monitor.

Ah, sorry, I missed that. Did you change the baud rate on the modules with the instructions at: Arduino Playground - Xbee012? You don't actually need to for the boards to communicate (only if you want to program them wirelessly), but the baud rate in your sketch needs to match the one that they're configured for, as does the rate in the serial monitor.

Yeah, I more or less followed that step by step.

I don't really think it's a software issue though (I'm just a newbie though so I could be wrong). Is it strange that say for example I load the blink sketch then as soon as I plug the XBee shield in the led just stops as if the sketch has stopped. I also think it's strange that I can't upload a sketch to the board with the XBee shield in, it has to be removed for the program to be uploaded.
The XBee shields are the kits from NKC but I don't think I put them together wrong as I can reprogram the XBee modules and everything so the shield must be working.

Thanks for your help so far everyone.

Is this the blink sketch from the XBee tutorial? Does the same thing happen with the standard blink sketch (i.e. with no serial communication at all)? Can you get the microcontroller to do anything while the XBee shield is on the board?

Is this the blink sketch from the XBee tutorial? Does the same thing happen with the standard blink sketch (i.e. with no serial communication at all)? Can you get the microcontroller to do anything while the XBee shield is on the board?

So if I load the standard blink sketch without the XBee shield it works fine. As soon as I plug the XBee shield in the sketch stops.
From what I can see I can't get anything to work with the XBee shield plugged in.

Strange. Are you sure assembled it correctly?

What happens if you remove the jumpers from the XBee shield entirely? Can you upload a sketch? If not, what output do you get if you set upload.verbose to true in your preferences file?

Strange. Are you sure assembled it correctly?

What happens if you remove the jumpers from the XBee shield entirely? Can you upload a sketch? If not, what output do you get if you set upload.verbose to true in your preferences file?

Well hardware is not my strong point but I think everything was put together as it should be. Here is a link to a picture of the shield itself: http://www.introspeed.com/xbee.JPG. It's not the greatest picture but I think you can see everything well enough.

So with the jumpers removed I still am unable to upload the blink sketch. The errors that are shown are:

avrdude: stk500_getsync(): not in sync: resp=0x00
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

Can you turn on upload.verbose in the preferences file and then try it? It should let us know whether you can get any data at all from the board with the shield on.

Sorry about that, here you go:

Binary sketch size: 1112 bytes (of a 14336 byte maximum)

C:\Documents and Settings*\Desktop\arduino-0010-win\arduino-0010\hardware/tools/avr/bin/avrdude -CC:\Documents and Settings*\Desktop\arduino-0010-win\arduino-0010\hardware/tools/avr/etc/avrdude.conf -v -v -v -v -pm168 -cstk500v1 -P\.\COM18 -b19200 -D -Uflash:w:C:\Documents and Settings***\Desktop\arduino-0010-win\arduino-0010\examples\Digital\Blink\applet\Blink.hex:i

avrdude: Version 5.4-arduino, compiled on Oct 11 2007 at 19:12:32
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

System wide configuration file is "C:\Documents and Settings***\Desktop\arduino-0010-win\arduino-0010\hardware/tools/avr/etc/avrdude.conf"

Using Port : \.\COM18
Using Programmer : stk500v1
Overriding Baud Rate : 19200
avrdude: ser_open(): setting dtr
avrdude: Send: 0 [30] [20]
avrdude: Send: 0 [30] [20]
avrdude: Send: 0 [30] [20]
avrdude: Recv:
avrdude: stk500_getsync(): not in sync: resp=0x00
avrdude: Send: Q [51] [20]
avrdude: Recv:
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

avrdude done. Thank you.

It looks like there's no data coming from the board at all. It's possible that the shield is holding the reset line low stopping it from ever running. Can you measure the pin of the 6 pin ICSP header that's closest to the microcontroller with a multimeter? The reset line is connected to the CTS of the XBee module, so it's possible that depending on how you have the module configured, it's holding that line low. What settings did you change?

Ah, a bit more investigation reveals that you probably didn't change anything, since the CTS flow control is enabled by default. Which is probably why the boards that Gianluca made don't have the transistor mounted (which connects CTS to the reset line). Try setting the D7 parameter to 0: ATD70.

Ah, a bit more investigation reveals that you probably didn't change anything, since the CTS flow control is enabled by default. Which is probably why the boards that Gianluca made don't have the transistor mounted (which connects CTS to the reset line). Try setting the D7 parameter to 0: ATD70.

That was it :slight_smile:
I still need to remove the shield when programming (which I've read already), but after that everything works fine. I will make a note of this setting from here on out.

Thanks for all of the help, I appreciate it.

Awesome. Glad you got it working.