Sending TTL to XBee DIN pin

I am designing a board to send TTL-level serial data into the DIN pin of an XBee (and do some other stuff, of course). I’ve got the proper 3.3V/GND connections for the XBee, but I need to know how to handle the fact that the serial data are TTL-level 5V and the XBee expects 3.3V.

Currently I have a 10K resistor in series from the serial data line going in to the XBee’s DIN pin. The Sparkfun tutorial here

http://www.sparkfun.com/commerce/tutori … ials_id=65

suggests that this “inline resistor” only works if the I/O pin (in this case the DIN pin on the XBee) has an internal “clamping diode”, and I have no idea whether or not it does.

The tutorial suggests as an alternative using a diode, ideally one with a low forward voltage drop. It’s just as easy for me to use a diode in the design as a resistor, so if this is the better solution, I’ll use it. Exactly what kind of diode should I be looking for? I see that the Sparkfun Regulated Explorer uses a diode, but I can’t find anything on what kind of diode.

Should I forget about this kind of simple one-part connection altogether and add a buffer chip, like on the Selmaware boards? I can figure that out, but it’ll add real estate to my board, which I’d rather avoid.

I’d love to hear that I can just use the resistor, or a diode.

Look at the schematic for SparkFun’s regulated XBee break out board.

http://www.sparkfun.com/commerce/produc … ts_id=9132

They pull the DIN line to 3.3V with a resistor and have a small signal diode in series withe DIN. The diode blocks voltage into (sourced) the XBee DIN pin but allows the pin to be pulled low (sunk) by an external signal.

This works well as I drive the break-out board’s DIN with a 5V serial signal from a PIC at 57.6kb.

The method you read about works as follows: Connect a diode from the DIN pin (anode) the 3.3V (cathode). Then feed your external signal through a series resistor. When the external signal is low DIN is low and the diode is not conducting. When the external signal is a diode drop above the 3.3V the diode conducts and clamps the voltage at DIN to no more than 3.3V plus the diode drop (0.6V for a silicon diode, 0.4V for a Schottky diode).

The one down side to this method that I have experienced is that most linear regulators (3-pin) can only source current and not sink current. This means that the external signal can increase the voltage of the “regulated” 3.3V rail. It has made for some head scratching troubleshooting when chips fail for no apparent reason.

Okay, I think I get it. I’ll take a look at this as soon as I have a chance. I appreciate your having taken the time to explain this - it’s a lot more clear to me now, and I think I can implement the Sparkfun version.

The XBee DIN pull-up is internal to the XBee module. There is a register in the XBee to set this pull-up on.

Or you can put a external pull-up on the DIN pin of the XBee.

Ah, so I see. You set them with the PR command, and it apparently defaults to “ON” (meaning that there is an internal pull-up resistor enabled on all of those lines, including DIN).

Let me see if I understand what this means. If I double-check PR to make sure it’s still set to 0xFF (all pull-ups turned on) I don’t need an external pullup resistor to 3.3V. I can put a “small signal diode” in series with the line going into DIN, and be fine. Right?

Now, what’s a “small signal diode”, and which way does it get connected? Can I assume that one of these 1N4148 diodes will do the job?

http://www.sparkfun.com/commerce/produc … ts_id=8588

and that (based on the schematic for the XBee Regulated Explorer) that the band goes on the end AWAY from the DIN pin?

Correct on all counts.

Okay, thanks. I really appreciate the advice.