Bidirectional logic level shifting from positive to negative supply

Aug 18, 2010 119 Replies

I have a feeling there is a better circuit lurking around somewhere.

This is a slight improvement:

ftp://jjlarkin.lmi.net/Level_Shift_2.JPG

John

Be sure to report back on how well this works. ...Jim Thompson

| James E.Thompson, CTO | mens | | Analog Innovations, Inc. | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | Phoenix, Arizona 85048 Skype: Contacts Only | | | Voice:(480)460-2350 Fax: Available upon request | Brass Rat | | E-mail Icon at http://www.analog-innovations.com | 1962 | Spice is like a sports car... Performance only as good as the person behind the wheel.

Yes, and the way it's drawn it does have separate supplies. Still, you can't have the negative rail at +0.4V and IN- at -4.8V. At least not on the typical comparators. It'll go kaputt.

Why not just use comparators, add a wee bit of hysteresis and AC-drive them or use LAN transformers? If you need the very first bit after power-up not to be screwed up hang it onto the POR/BOR (hoping there is one ...).

Regards, Joerg http://www.analogconsultants.com/ "gmail" domain blocked because of excessive spam. Use another domain or send PM.

formatting link

The reset line needs DC drive, and I need it to be stoooopid simple because I don't want to have to delve into all the gory details of how DebugWire works. Bidirectional open collector over a transformer would be a bit of a trick, no? ;)

Cheers

Phil Hobbs

Dr Philip C D Hobbs Principal ElectroOptical Innovations 55 Orchard Rd Briarcliff Manor NY 10510 845-480-2058 hobbs at electrooptical dot net http://electrooptical.net

That would help some statically, not as much dynamically.

It would actually be better to use two SOT-23s that way, because the collectors could be nailed together better!

These sorts of dual transistors aren't much better than two discretes off the same reel.

John

formatting link

How about this?

ftp://jjlarkin.lmi.net/Level_Shift_3.JPG

John

formatting link

Cute. I like the LM319 version better because it keeps the two pullups strictly separate, so I can use a smaller one on the MCU side and save some delay.

Cheers

Phil Hobbs

Dr Philip C D Hobbs Principal ElectroOptical Innovations 55 Orchard Rd Briarcliff Manor NY 10510 845-480-2058 hobbs at electrooptical dot net http://electrooptical.net

formatting link

No, it's easy. And it will have DC drive. It's just that NRZ never guarantees the status after power up before the first transition occurs but that can be goosed if necessary.

However, if John's latest circuit does the trick then that'll be the best method, it's all DC. Hint: With most comparators it's ok if the open collector output is pulled above its positive supply. Within reason of course, there always comes an abs max voltage.

Regards, Joerg http://www.analogconsultants.com/ "gmail" domain blocked because of excessive spam. Use another domain or send PM.

:(

It's depressing. We keep designing clever transistor circuits, realize they need too many parts or some such, and just use an IC. Or even worse, a whole potted module.

John

It's usually 1% match for two transistors from the same batch (and you can get current-mirror pairs that are tested for this, for a price). Add to that some self-heating (5V/10 mA is only 50 mW, but we can allow a 3C temperature rise), still in the 1% range. So, with 10 mA of Zener current, any pullup/pulldown that can swamp 200 uA or so will get the correct logic level.

An emitter resistor in the (+) current mirror can offset the current so the mirror acts as a pullup resistor, if you want to ensure the correct sign of error current.

You need current source/low Z voltage drop/current sink elements to do it, so the two current mirrors is just as minimal as any op amp will be. One might use a resistor as the voltage drop element, you just have to know that its impedance is low enough to pass the logic. If 'twere CMOS with 10kohm pullups, a 4k resistor and current mirrors programmed for 1.25 mA would suffice.

50 mw, SOT-23 at 300 K/w, gives 15 K self-heating. That's about 38 millivolts change in Vbe. It doesn't look like holding anywhere near 1%.

Even a 3K differential rise (60 K/w, heat sink?) is 7.5 mV, which changes Ic by over 25%, if I did the math right.

John

Cute. Pull "A" to -5V and it sticks. ...Jim Thompson

-- | James E.Thompson, CTO | mens | | Analog Innovations, Inc. | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | Phoenix, Arizona 85048 Skype: Contacts Only | | | Voice:(480)460-2350 Fax: Available upon request | Brass Rat | | E-mail Icon at

formatting link
| 1962 |

Spice is like a sports car... Performance only as good as the person behind the wheel.

formatting link

This is a silly time to ask - spoiling the fun - but does it really need to be bidirectional? JTAG to uP is the usual path.

Or run the debug code from a battery-powered laptop and let it float on -5! Maybe add some bypassed resistors just in case the laptop gets grounded, to prevent damage.

John

Theta_JC is in the ballpark of 400 K/W, so that 50 mW is 20 degrees C temperature difference. The BCV62's specs say that the maximum dissipation to avoid runaway is 5V * 5 mA. A 1 degree delta T makes a

9% delta I_C/I_C, so 1% I_C difference corresponds to a dissipation of 1/(9*400) ~ 280 microwatts.

The DebugWire interface specifies a minimum pullup resistor value of

10k, so I can't go tossing round milliamps. (My original schematic had too-small pullup values.)

Cheers

Phil Hobbs

Dr Philip C D Hobbs Principal ElectroOptical Innovations 55 Orchard Rd Briarcliff Manor NY 10510 845-480-2058 hobbs at electrooptical dot net http://electrooptical.net

formatting link

It does. The ATmega88PA actually doesn't have JTAG, just SPI style ISP and DebugWire. Bigger AVRs do have JTAG, but 6 wires is a lot for a 28- or 32-pin part.

Some joker will drop a screwdriver or put the laptop down on the metal bench top at some point and blow up the programmer or the board (and maybe its one-and-only $1000 pseudo-unobtainium laser, which would be a disaster for the company since they'd very likely miss their milestone).

Cheers

Phil Hobbs

Dr Philip C D Hobbs Principal ElectroOptical Innovations 55 Orchard Rd Briarcliff Manor NY 10510 845-480-2058 hobbs at electrooptical dot net http://electrooptical.net

formatting link

Just a word of caution: Industrial grade laptops like my DuraBook have a metal enclosure that is connected to PE via the power supply. No matter how often you tell people not to connect a power supply chances are you haven't even completed your flight home and the light on your answering machine will be flashing nervously.

Regards, Joerg http://www.analogconsultants.com/ "gmail" domain blocked because of excessive spam. Use another domain or send PM.

formatting link

Some people have no sense of adventure.

John

formatting link

Not a joke, happened: Lengthy audio recording, the usual, s....y laptop power supply with an EMI behavior from hell, so let it run on battery. Put a note on there not to plug it in. Came back half an hour later, li'l power supply connector was plugged into laptop. Hurumph! "Oh, I thought you had forgotten that, so I thought the battery might run down, so I thought ..."

Regards, Joerg http://www.analogconsultants.com/ "gmail" domain blocked because of excessive spam. Use another domain or send PM.

We want our sound effects!

John

s

:(

e
+5 -+- | .-. R1 | | 5K | | '-' R2 | 1k +-----------+---/\/\/--+---- (B) | | | | '>| | \| |--------' Q1 |---. /| .---. .

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required