XBee shield with arduino

Information and discussion regarding Firewing shields

XBee shield with arduino

Postby harrybrooke6987 » Wed Nov 06, 2013 2:53 am

Hi

I'm using a Ciseco XRF module in place of an XBee S1 which are basically the same, and I am used to using an Arduino Wireless SD shield on an Arduino Uno. Wiring reset pin to ground usually allows me to use the arduino and shield as a SUB to serial converter to talk to the XRF module to configure it. I have recently purchased a Firewing XBee shield and wish to accomplish the same thing but I'm not getting any communication with the XRF module. I have soldered on the headers of the shield to make sure the connections are secure but I'm not familiar with the Xbee shield so I don't know if there is any other wiring to set up on the shield to make it work.

Can you help?
harrybrooke6987
 
Posts: 8
Joined: Wed Nov 06, 2013 2:46 am

Re: XBee shield with arduino

Postby harrybrooke6987 » Wed Nov 06, 2013 2:54 am

By SUB I mean USB... Auto-correct error
harrybrooke6987
 
Posts: 8
Joined: Wed Nov 06, 2013 2:46 am

Re: XBee shield with arduino

Postby David John Barker » Wed Nov 06, 2013 11:11 am

Hi Harry

I haven't got any Ciseco units but I do have XBee S1, so assuming they work the same this is what I did to test communication between a PC and Arduino UNO. I used a sparkfun breakout board and this article explains how I configured the XBee modules and the breakout board:

http://www.firewing.info/pmwiki.php?n=FirewingUser.XBEEBootloader

It's for wireless bootloading of a Firewing board but it has some useful information regarding configuration. This is the Arduino test program I used:
Code: Select all
// the setup routine runs once when you press reset:
void setup() {
  // initialize serial communication at 9600 bits per second:
  Serial.begin(38400);
}

// the loop routine runs over and over again forever:
void loop() {
  int data = 0;
  while (true) {
     if (Serial.available() > 0) {
        data = Serial.read();
        Serial.write(data);
     }
  }
}

My XBEE units are configured for 38400 baud. If you use a different baudrate, then just change the program above to suit. Make sure the switch on the XBee shield is set to "UART". This schematic may explain better the connections:

http://www.firewing.info/downloads/schematics/xbee.pdf

When the XBee units are paired, the RSSI LEDwill stay on and ASSOC LED will blink. The TX and RX leds should also be OFF, telling you that the Arduino RX and TX are configured correctly. I then used the arduino serial program to connect to the breakout board. The arduino program simply echoes back what is sent from the PC - it's a great way to test bi-directional comms. See the attached image - I basically sent "Hello" to the XBee shield mounted on the arduino, which then echoed it back to the PC.

I hope the above helps - please let me know how you get on...
Attachments
arduino-serial.jpg
arduino-serial.jpg (28.26 KiB) Viewed 21466 times
User avatar
David John Barker
 
Posts: 491
Joined: Thu Nov 08, 2012 12:21 pm

Re: XBee shield with arduino

Postby harrybrooke6987 » Wed Nov 06, 2013 12:02 pm

Thank you for the reply.

I have a similar breakout board coming in the mail so I'll repost here if I have further issues. In the mean time I'll try the code you mentioned and see if that solves my problem.

Thanks
harrybrooke6987
 
Posts: 8
Joined: Wed Nov 06, 2013 2:46 am

Re: XBee shield with arduino

Postby harrybrooke6987 » Wed Nov 13, 2013 10:39 am

Hi David,

I finally got around to testing the shield again, and I got it working but not in the way I expected.

I have had to switch the shield into 'user' mode and wire pin D0 of the Arduino Uno to RX on the shield, and D1 to TX on the shield. Also I have the Uno in 'reset' mode by wiring the reset pin of the Arduino to ground. This is allowing the software for configuring the XRF modules to connect to the modules properly so I can program them.

Am I right to assume that the 'uart' mode on the switch is wired to the same configuration (D0-RX and D1-TX)? If so, maybe when I soldered the headers onto the board I could have severed a connection here.

Thank you for your help,

Harry
harrybrooke6987
 
Posts: 8
Joined: Wed Nov 06, 2013 2:46 am

Re: XBee shield with arduino

Postby David John Barker » Wed Nov 13, 2013 11:44 am

Hi Harry

When the switch is in UART mode D0 and D1 are connected to the XBee RX and Tx. When it is in USER mode, pins D2 and D3 are connected to XBee RX and TX. This image should make things a little clearer.

http://www.firewing.info/user-uploads/Firewing/XBeeSDShield/xbee-sd-shield-pins.png

The boards are tested on a bed of nails before sending out, so I am not sure why the switch in UART mode would not work for you. I'm not sure about the grounding of the Arduino reset pin - are you trying to program your RF modules via the Arduino board i.e. PC <--USB-> ARDUINO <-> RF MODULE?
User avatar
David John Barker
 
Posts: 491
Joined: Thu Nov 08, 2012 12:21 pm

Re: XBee shield with arduino

Postby harrybrooke6987 » Wed Nov 13, 2013 11:57 am

David

I'm sure there wasn't a problem with the shield initially, it is probably just my soldering job of the header pins onto the shield that has caused the problem since I'm not very experienced with soldering.

By having the PC <--USB-> ARDUINO <-> RF MODULE configuration, and the Uno in reset mode, the processing chip of the Uno is put into a constant reset state, which effectively bypasses it. This allows me to just the the Serial-USB conversion chip on the Uno on its own. Basically it works just as an XBee explorer board does, but I don't have one of those yet so I'm using this method. It works now so that I have the switch set on 'USER' and have wires from D0 and D1 to RX and TX.
harrybrooke6987
 
Posts: 8
Joined: Wed Nov 06, 2013 2:46 am

Re: XBee shield with arduino

Postby harrybrooke6987 » Wed Nov 13, 2013 12:03 pm

It is still strange than the UART setting doesnt work, since I know then D0 and D1 pins both have a connection and there is no visible damage to the shield where the D0 and D1 pins are directed to the switch (observing the underside of the shield)
harrybrooke6987
 
Posts: 8
Joined: Wed Nov 06, 2013 2:46 am

Re: XBee shield with arduino

Postby David John Barker » Wed Nov 13, 2013 12:31 pm

> It is still strange than the UART setting doesnt work

I would agree - you could perhaps test the switch using a multimeter when in the UART position? Again, this is tested before boards are sent out but no harm in trying. Either way, if you have connected the USER switch to D0 and D1, make sure you break the links for RX and TX so that they bypass the D2 and D3 connection...
User avatar
David John Barker
 
Posts: 491
Joined: Thu Nov 08, 2012 12:21 pm

Re: XBee shield with arduino

Postby Jerry Messina » Wed Nov 13, 2013 6:55 pm

Pardon me for butting in, but if I follow what Harry wants to do it doesn't look like it would work.

I don't have an XBee, so just from the schematics...

I sounds like Harry wants to totally bypass the main PIC24 (holding it in reset by grounding MCLR) and have the USB 14K50 uart talk directly to the XBEE. On the main firewing board, the 14K50 uart data out (K50 RB7/TX) connects to the PTX signal which goes to D0/RX on J8-1.

Looking at the XBEE shield, D0/RX (J2-1) connects to the txd out of the XBEE (DOUT, XBEE pin 2), so you would have 14K50 TXD -> <- XBEE DOUT, and likewise for the RX data (RXD<- ->DIN).

Things would be correct for PIC24 <-> XBEE on D0/D1, but not for 14K50 <-> XBEE, which is why they would need to be swapped around
Jerry Messina
 
Posts: 280
Joined: Thu Feb 14, 2013 10:16 am

Next

Return to Shields

Who is online

Users browsing this forum: No registered users and 1 guest

cron

x