Go Down

Topic: High voltage tri-state logic MOSFET pair configuration questions.  (Read 137 times) previous topic - next topic

Rayuela

Hi everyone,

A couple of months ago I made a post asking about an IC to control an array of Charlieplexed LEDs -this post is not about multiplexing-. After much study and reading (I must emphasize how useful is The Art of Electronics by Paul Horowitz) I arrived at the configuration that you can see in the schematic below.



There you can see a typical Push-Pull configuration that follows the truth table shown, where:
- H is HIGH or that particular OUT terminal is working as a source
- S-T stands for shoot-through (something totally unwanted)
- L is LOW or that particular OUT terminal is sinking
- Z stands for High Impedance, where that particular OUT terminal is -should- be floating.

So far the simulation runs okay, and only two GPIOS are used to control each OUT.

Now looking for tri-state configurations, I found the following diagram that seems to use BJTs instead of MOSFETs.


Quoting the description of the behavior
Quote
When enabled the signal QP12 and QN12 are on the inverter formed by QP11 and QN11 can drive the output.
In the disabled state QP12 and QN12 disconnect the inverter from the supply and the output is in a high impedance state regardless of the input signal.
That led me to simulate the following configuration but, as the first one, with MOSFETs, which led me to this schematic:

Here I don't attach a truth table since the simulated behavior is the same, only with more components.
Note1: Switches S1, 2, 3, and 4 are just for simulation simplicity, not considered in the final design.
Note2: Reduction of GPIOS might be achieved using an inverter (not gate) with GPIO1 and GPIO2 and shorting GPIO_01 and GPIO_OE2, thus having only a GPIO for enable/disable (~ enable/HIGH-Z) and other to switch between H and L.

Now, my question:
  • Are the circuits equivalent? With that I mean, is there an extra functionality that the second design might achieve that I'm not seeing? or more broadly, I'm overlooking something?
  • Is there a reason to choose BJTs over MOSFETs when using GPIOS?
  • Can the HIGH-Z state be achieved with both MOSFETS off?


Some quick questions that you might be asking:
  • Why 12 volts for LEDs?
    Line resistance is very high (Simulated by R2), thus to supply the required current and the LEDs Forward voltage a supply of 12V is assumed
  • How many terminals (out) do you need?
    arrays can be as large as 150 LEDs, thus up to13 terminals might be needed.
  • Can you provide the MOSFET datasheet?
    Attached as pdf


I hope everything is clear,

MarkT

Now looking for tri-state configurations, I found the following diagram that seems to use BJTs instead of MOSFETs.


Those aren't BJTs, they are MOSFETs, but the signal kind, not power MOSFETs.  That's the kind
of circuit you'll typically find inside a logic chip.

Go back to your original circuit, and do the conversion in software, as in:

Code: [Select]

void drive_output (byte hipin, byte lopin, bool sense, bool, enable)
{
  digitalWrite (lopin, LOW) ; // prevent shoot-through
  digitalWrite (hipin, enable && sense) ;
  digitalWrite (lopin, enable && !sense) ;
}

Once you have control from software you can avoid unnecessary complexity in the attached hardware.

Your circuit already has pull-downs and pull-ups that will prevent shoot-through during reset/power up.
[ I DO NOT respond to personal messages, I WILL delete them unread, use the forum please ]

raschemmel

I commend you for the excellent format of your
post , coming from someone with only 4 posts
to their name.

Paul__B

The 4k7 - 1 mA at 5 V - could probably just as well be 10 or 22k.  It is only there to keep the FETs off until the microcontroller starts up.

Your reference to "GPIO2" suggests an ESP8266.  If so, do be careful about the necessary conditions on these pins in order to actually boot the ESP, they generally require to be pulled up at boot.

Your first circuit already implements "Tri-state".  You would only get "shoot-through" if you make a coding error or - just perhaps if it crashes.

Your last circuit always exhibits "shoot-through" during transitions if using logic level FETs or 12 V or more supply voltage.

Rayuela

I commend you for the excellent format of your
post , coming from someone with only 4 posts
to their name.
Thank you, I only try to make myself understood in the best way, so that people who read first do not get confused and second can help me effectively without asking for more information.
 
The 4k7 - 1 mA at 5 V - could probably just as well be 10 or 22k.  It is only there to keep the FETs off until the microcontroller starts up.

Your reference to "GPIO2" suggests an ESP8266.  If so, do be careful about the necessary conditions on these pins in order to actually boot the ESP, they generally require to be pulled up at boot.

Your first circuit already implements "Tri-state".  You would only get "shoot-through" if you make a coding error or - just perhaps if it crashes.

Your last circuit always exhibits "shoot-through" during transitions if using logic level FETs or 12 V or more supply voltage.
Hi Paul, almost, I'm planning to use the ESP32-PICO or the ESP32-S2. Still not defined. but thanks for the heads up. I'll check that.
With respect to the pull-up resistor, do you have an equation you can base the choice of 10k or 20k on? I'm asking because I want to learn that and be able to justify and not just trust.

Paul__B

With respect to the pull-up resistor, do you have an equation you can base the choice of 10k or 20k on?
No.

MarkT

The pull up value is not critical - since FET gates are ultra-high resistance, any value from 200 to 1M would
probably work.  Less than 200 and the logic output might struggle to overcome it, more than 1M and noise
pick-up would be a definite issue.  With long wires than 1M is too high anyway.

So 10k is a reasonable universal value, rounded to the nearest power of ten.
[ I DO NOT respond to personal messages, I WILL delete them unread, use the forum please ]


Go Up