Unipolar to bipolar logic level shifter: simpler solution? - Page 1
Forum section: electronics / projects

author: Unixon
author_rank: Frequent Contributor
timestamp: November 10, 2020, 10:26:17 am
content: Here's the situation: 5V MCU sitting between 0V=GND/5V power rails wants to control 5V analog switches sitting in shifted power rails -2.5V/+2.5V.Both IO voltages must not exceed corresponding power rails.Current schematics is in the attachment.Q1: Is it possible to make it with even less components?Q2: There are 5 switches in the device. Is there an integrated level shifter that would do this job for all channels?

author: Zero999
author_rank: Super Contributor
timestamp: November 10, 2020, 11:15:28 am
content: Use an analogue switch with a built-in level shifter, such as the 74HC4053.https://assets.nexperia.com/documents/data-sheet/74HC_HCT4053.pdf

author: Unixon
author_rank: Frequent Contributor
timestamp: November 10, 2020, 11:58:16 am
content: Oh, I just went with 1G3157 over 405x for much lower ON resistance and slightly lower propagation delays.That decision led me into voltage translation problem, but it's not too late to turn back yet.

author: sandalcandal
author_rank: Unknown
timestamp: November 10, 2020, 12:30:57 pm
content: Can you share the datasheet for the 1G3157 you're using?You could just use a passive divider?Edit: SN74LVC1G3157 looks like it's spec'd for +/-1V high/low input for +/-2.5V (5V) supplyEdit2: Should also add diode from gnd to MCU_PIN to avoid sourcing current from MCU while output low.

author: Unixon
author_rank: Frequent Contributor
timestamp: November 10, 2020, 12:43:34 pm
content: Quote from: sandalcandal on November 10, 2020, 12:30:57 pmSure.Quote from: sandalcandal on November 10, 2020, 12:30:57 pmI'm thinking about this now...

author: Ian.M
author_rank: Super Contributor
timestamp: November 10, 2020, 12:51:32 pm
content: if you've got a -5V bias rail available, a simple R:2R potential divider will give you better than 80%/20% levels at your switch control inputs.

author: sandalcandal
author_rank: Unknown
timestamp: November 10, 2020, 12:59:49 pm
content: Hmm on second thought, even with an anti-parallel diode on the MCU_PIN to try clamp it close to gnd the MCU might not be happy needing to source current during output low state...Edit: or during startup when it might be in a high Z state...Edit2: If MCU does tri-state logic output could use also use that to do a full +2.5V to -2.5V

author: Unixon
author_rank: Frequent Contributor
timestamp: November 10, 2020, 01:16:34 pm
content: Quote from: Ian.M on November 10, 2020, 12:51:32 pmHmm... yes, it does almost 80/20 and yes, I do have a -5V rail.Speaking of which... power circuit looks like this:12V input -> filter -> 5V reg -> (1) 2.5V LDO; (2) 5V/-5V charge pump inverter -> filter -> -2.5V LDO.

author: Ian.M
author_rank: Super Contributor
timestamp: November 10, 2020, 01:17:49 pm
content: Quote from: sandalcandal on November 10, 2020, 12:59:49 pmYes some MCUs malfunction if their I/O pin MOSFETs body diodes conduct significant current, even if its well below the rated abs. max. current above which one risks latchup, a case in point being any analog capable pin on a PIC MCU, which can cause effects ranging from drastic internal oscillator frequency shifts to unexpected device resets. However Schottky clamping diodes will alleviate that problem if the I/O pin current is no more than a couple of mA. Unixon only needs low side clamping, so three BAT54A dual Schottky diodes (common anode) would do the job.Another option would be just about any comparator with open collector/drain outputs powered between the +5V rail and the -2.5V rail. Tie in- to +2.5V and drive in+ from the MCU I/O. Pull the output up to +2.5V with a resistor.

author: Unixon
author_rank: Frequent Contributor
timestamp: November 10, 2020, 01:34:57 pm
content: Quote from: Ian.M on November 10, 2020, 01:17:49 pmComparators or op amps are NO-NO because of board space.Clamping diode makes 2 part into 3 and this is only 1 part less that what was in the beginning.Well... going back to 405x solves this problem too. Can't tell if it simplifies routing or not, I have to try to arrange 405x gates.

author: sandalcandal
author_rank: Unknown
timestamp: November 10, 2020, 01:59:59 pm
content: Would there be issues using a series zener? There could be some drift so some margin would be needed, maybe a 3.3V?

author: Ian.M
author_rank: Super Contributor
timestamp: November 10, 2020, 02:16:09 pm
content: @UnixonAs I noted before, you can use common anode dual Schottky diodes, each of which can clamp two I/Os, so for your five control signals, the parts count is only 2.6 per signal. If you use quad resistor arrays for four of the signals, the parts count reduces further to a total of seven, or you can ease routing by using three out of four resistors in a quad array to implement the R:2R divider for a total of eight parts.However your original circuit is over-kill. The MOSFET gate can be driven direct from the MCU I/O without the pullup resistor (if you can tolerate an indeterminate state before the I/O is configured as an output) and diode you have. That gets it down to two parts per signal which is hard to beat, especially as you can further reduce it by using dual MOSFETs and a resistor array, for a total of four parts.Quote from: sandalcandal on November 10, 2020, 01:59:59 pmI don't like the series Zener idea - low voltage Zeners Vf vs If curve typically have a very soft 'knee' and high slope resistance, so even if you spec 5% tolerance 2.7V parts, its going to be difficult to do much better than the simple R:2R divider., at a considerable increase in cost. Also it still requires the Schottky clamps to stop the I/O pins being dragged below 0V.

author: sandalcandal
author_rank: Unknown
timestamp: November 10, 2020, 02:38:23 pm
content: Quote from: Ian.M on November 10, 2020, 02:16:09 pmHence going for a higher 3.3V zener which comes at the performance cost of making the output only go+/- ~1.7V+1.7V to -2.5VI agree though. Since -5V is already there, hard to beat the R:2R divider, that gives +/- 1.66V as opposed +/- 1.25V using the -2.5V rail and minimal cost compared to a zener.Quote from: Ian.M on November 10, 2020, 02:16:09 pmCould put a resistor in parallel to MCU_PIN to gnd instead and potentially get lower reverse bias than Schottky forward voltage? Would depend on required output impedance and would also waste more current in the output high state if using resistive divider output.Edit: Sim screenshot and added corrections. <0.1V reverse bias using 10k parallel to gnd in place of Schottky.

author: Zero999
author_rank: Super Contributor
timestamp: November 10, 2020, 02:47:18 pm
content: Quote from: Unixon on November 10, 2020, 11:58:16 amThere are lower resistance dual supply SPDT analogue switches, than the 74HC4053. I've had a quick lock and found the MAX4564 and TS12A12511. No doubt there are other options, with more channels.https://docs.rs-online.com/bb8d/0900766b80f72752.pdfhttps://www.ti.com/lit/ds/symlink/ts12a12511.pdfEDIT:How about the quad ISL43240, or the TS5A22362, which is dual, but can switch negative votlages, even when powered from a single power supply rail?https://www.renesas.com/eu/en/doc/datasheet/isl43240.pdfhttps://datasheet.lcsc.com/szlcsc/Texas-Instruments-TI-TS5A22362DGSR_C201663.pdf

author: Unixon
author_rank: Frequent Contributor
timestamp: November 10, 2020, 07:03:43 pm
content: Quote from: Zero999 on November 10, 2020, 02:47:18 pmRenesas ISL43240 part is nice, I'll keep that in mind.TI's TS5A22362 can't switch far enough beyond power rails, it's only Vcc-5.5 and if I put it between GND and +2.5V operation conditions won't be optimal.I don't know... maybe I'm shouldn't worry about switch resistance that much.Initially there were 3 switches, 2 of which are 3-to-1 and one switch is 2-to-1.So, I can use 1x4053 + 1x4052 or 2x4052 with all unused inputs connected to GND (0V is valid alternative to choose from).

author: TurboTom
author_rank: Super Contributor
timestamp: November 10, 2020, 07:14:19 pm
content: Pulldown at the switch control input to -2.5V and a blue LED to the MCU's port pin? Doubles as indicator of the switch state and provides the required voltage drop...

author: Zero999
author_rank: Super Contributor
timestamp: November 10, 2020, 09:02:50 pm
content: Quote from: Unixon on November 10, 2020, 07:03:43 pmI admit I missed that, but the logic input will tolerate 5V, when the power supply voltage is 2.5V, so it can be powered from 2.5V, rather than 5V.QuoteIf the on resistance isn't an issue, my recommendation would be 2x74HC4052, over 1x74HC4053 + 1x74HC4052, because buying larger quantites of the same part is cheaper, than having two different parts and it's still the same number of ICs.Unused inputs can be connected to either 0V or +V and the same for the switches, although I'd just connect the commons to either supply rail and leave the other contacts floating.EDIT:By the was, for future reference, to answer the original question, a P-channel J-FET can be used to shift positive voltage, to the negative rail.https://www.eevblog.com/forum/beginners/level-shifting-3v-to-5v/msg3178048/#msg3178048

author: Unixon
author_rank: Frequent Contributor
timestamp: November 11, 2020, 01:35:51 pm
content: Quote from: Zero999 on November 10, 2020, 09:02:50 pmOh, thank you anyway. This part is still good in its own right, I just meant that Renesas one is superior.Quote from: Zero999 on November 10, 2020, 09:02:50 pmI have many pieces of both of them anyway, so my choice from different 405x is mainly based on possible options to arrange additional inputs to some valuable constant potentials.I'm designing a MCU controlled 4-mode (CC/CV/CP/CR) electronic load module and I need these switches to switch DAC or op amp outputs to other op amp inputs in order to set a particular mode of operation.So, my concern about ON state resistance (and leakage in OFF state) and propagation delays is that switches' characteristics may affect desired circuit operation in an adverse way.Quote from: Zero999 on November 10, 2020, 09:02:50 pmOK, I'll check that.