0
\$\begingroup\$

For a voltage change on a serial line I'm using a common level shifter design which uses a FET (BSS138 in this case) as so:

enter image description here

I have two of these - one for RX and one for TX. I should add that I'm using this because I have an I2C line pair as well and you can get 4 of these circuits on one little board from Adafruit.

As I was hooking this up to someone else's device and the usual caveat about "RX from which point of view?" applies, I added the 1K resistor on the right so that that miswiring would be less likely to cause shorting issues.

On a proper push pull output this should be fine, especially at 9600 baud. However, with the FETs this does not work. I thought - maybe when the 3.3V side pulls down the body diode is ineffective in clamping. But I had a GPS TX on the 3.3V side sending to the 1.8V RX side and that seemed to work fine, which isn't what I'd expect. Comms with a PIC micro failed though, probably on the TX (1.8V to 3.3V direction) side. When the 1.8V side pulled low, the 3.3V side seemed to pull only half way.

Removing the 1k resistors cured the problem and the circuit translated the serial comms correctly. But I'm confused as to why the 1K caused the problem - what are the dynamics of the issue?

Edit: To explain why I'm considering continuing to use this system - I'd gladly replace the whole thing with a TXS0108 which does push-pull and open-drain level shifting for 8 lines in one device. But that device does not appear to give Vcc isolation (if either 1.8 or 3.3 is turned off for example), unlike the TXB0108 which explicity says it does in the datasheet. Thus I wanted to use two of the FET circuits "back-to-back" to give the isolation.

\$\endgroup\$
1
  • \$\begingroup\$ Just in case anyone else sees this - the problem was an unpowered FTDI chip hanging off the lines at the right side of the circuit above. \$\endgroup\$
    – carveone
    Jul 27, 2014 at 10:06

2 Answers 2

1
\$\begingroup\$

When the 1.8V side pulled low, the 3.3V side seemed to pull only half way.

Chances are the FET you used did not turn on very well with only 1.8V gate-source drive - choose a FET with a low \$V_{GS(Threshold)}\$ typically under 1V.

The other way round the circuit works because you are using the substrate diode in the FET and that drops about 0.7 to 1 volt.

\$\endgroup\$
2
  • \$\begingroup\$ I think this is certainly possible. It's a BSS138 (I edited my post to clarify this) and it does work (possibly marginally at 1.8V - Vgs is 1.3V typical) with the Adafruit circuit as it stands - ie: without the 1K "safety" resistors. If it's marginal, the extra resistance might push it over the edge so to speak... \$\endgroup\$
    – carveone
    Apr 1, 2014 at 22:43
  • \$\begingroup\$ I'm getting resistance from the other guy to tell me but I believe they have an FTDI chip on the line as well. Which is totally fine iff the chip is powered but held in reset while the USB port is unpowered (datasheet, section 6.2). I don't believe that's the case and I'm trying to use the TX line to power the FTDI via its input protection diodes, assuming it has them. Which would explain a lot... \$\endgroup\$
    – carveone
    Apr 8, 2014 at 14:55
0
\$\begingroup\$

It's exceedingly likely that the RX input you're driving has a fairly stiff (10k) pull up, and that's going to make it difficult for your circuit to pull it down.

The usual trick used to solve this problem, if you're worried, is to pull up the RX pin to the CPU's VDD, and capacitively couple it to the input. Either choose a capacitor small enough that the ESD diodes can handle the excess voltage, or add your own diodes. You'll find that used a lot on things like serial debug lines for routers, and small embedded controllers where a 3.3 or 1.8V part might get hooked up to a 5V debug cable by some field tech.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.