Custom SMD board - please help with xbee wireless uploading

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
daemach
 
Posts: 146
Joined: Fri Feb 13, 2009 2:07 pm

Custom SMD board - please help with xbee wireless uploading

Post by daemach »

I'm working on a custom low cost board for environmental monitoring and basic process control. They use RFM12b modules for local area communication with cheap wireless sensors, whose data they aggregate. I'm adding xbee support for long range communication with a base station or via their pin-compatible wifi module. I also have a microsd socket for local data logging, but the libraries are so large that doing both wireless and local logging is going to be tough. My goal is to make the design flexible enough to be used in many different configurations with simple reprogramming.

What do you think is the best way to wire up the reset pin on the xbee? I want to be able to use it for wireless programming (http://www.ladyada.net/make/xbee/arduino.html) so it doesn't make sense to tie it to the arduino reset. My thought at the moment is to connect it to a pin on the atmega so I could at least try resetting it programmatically. (Is that even a word?)

I am also not clear on how to wire up the cts, rts, dts pins. I know the tx and rx pins connect to the reciprocals on the atmega - do I need to do anything with these? Tie to gnd/vcc? Eagle ERC is complaining that the vref pin is unconnected as well.

Any concerns with mounting the xbee near the RFM12b module? Directly above it probably isn't a good idea, but are there other restrictions I should be aware of?

I have a 10-pin header to be used for an external screen/buttons for menu-based programming. The easiest way for me to do this right now is 3.3v, and I believe that would work for a short cable, but I could add another level converter to push these outputs/inputs to 5v if necessary. If the board is used for (wired) process control of some kind, I would assume that 5v would be better for longer cable lengths. Is that the case? What length of cable is safe at 3.3v?

My current schematic is below. Thanks in advance for any help you can give me.
Airnode 2.0 Current Schematic.png
Airnode 2.0 Current Schematic.png (55.55 KiB) Viewed 1096 times

meseta
 
Posts: 82
Joined: Tue Aug 02, 2011 7:57 pm

Re: Custom SMD board - please help with xbee wireless uploading

Post by meseta »

Hey, I can answer a few of your questions.

I designed and now sell an ARM microcontroller board with a built-in Xbee unit, and I've come across some of the same issues and questions that you have with regards to connecting up the Xbee to the microcontroller. The board I designed is this: http://www.universalair.co.uk/content/hivebrain-mk8

The reset pin: on the board the reset pin is actually connected to the reset pin of the microcontroller, the reason for this is that on the ARM chips, the reset pin can be switched between being a reset, or acting as a GPIO pin (don't know if it's the same for an Atmega, but I expect so). This way I can reset both parts with the rest button on the board, or I can have the ARM microcontroller switch its reset pin to GPIO, and reset the Xbee.

If you want super-simple serial transmission, then all you need to do is to connect the TX and RX pins (to, as you correctly say, their reciprocals on the Atmega, RX to TX, and TX to RX). You can optionally use RTS and CTS for flow control, this is useful if you are using high baud rates and you want to transfer a lot of data at a time, if so then the RTS and CTS pins should be connected to their corresponding pin on the Atmega (RTS to RTS, CTS to CTS). You also need to enable hardware flow control configurations on the Xbee.

The XBee has some requirements for what tracks or other chips can be nearby. Typically you only have to worry about things being around the antenna/antenna port part of the Xbee, so I think the best thing to do is to place the antenna end of the XBee as far way from any signal source as possible. I haven't had a look at the datasheets for standard Xbee modules, but the SMT module have a diagram of areas where tracks and components are not allowed.

The maximum length for digital cables depends on data frequency, if you're using it for just simple on/off kinds of signals i.e. buttons, then you can use fairly long cables. However if you have a screen running on the end of a cable, then this might limit how long the cables can be. I'm going to take a guess and say that you'll probably be ok at 3.3V for low frequency data up to maybe 4 meters, but it's something you should test.

User avatar
daemach
 
Posts: 146
Joined: Fri Feb 13, 2009 2:07 pm

Re: Custom SMD board - please help with xbee wireless uploading

Post by daemach »

Your board looks interesting. That ARM chip you're using is cheaper than the ATMega and it looks like there is more functionality. I'm not much of a coder - what does it take to develop with the ARM?

This is no doubt a dumb question, but the datasheet says the ARM is a 32-bit chip with 32K of flash. The guido is 8-bit with 32K of flash. At first blush it seems that 32-bit instructions should take up 4x more room than 8-bit... What am I missing here?

I don't think I can tie the xbee to the guido's reset pin with wireless uploading. The reset happens right before the code gets pushed over so the xbee needs to stay alive. I'll probably tie it high to a spare pin then make a note to reset the xbee during setup.

It looks like software handshaking should work up to around 115K - is that your experience too?

I looked over the xbee datasheet and it looks like the keepout area only applies to chip antennas. Whip and external don't need it. I think I'm going to mount this thing such that an SMA connector will protrude from the side of the can. I should be able to screw on a rubber duckie at that point.

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”