4
\$\begingroup\$

I am building the following circuit, in order to control the P channel MOSFET as a high side switch for my load.

The input of this circuit will be from a microcontroller (maybe an STM32F103), and I was planning to use the output pin, in open collector mode.

Will this work? Please note that I am pulling up the pin at 12V.

I know that in other circumstances it would work, but in a microcontroller, will the output handle the 12V? When in open collector, are the ESD diodes disconnected?

And if it works, how do you handle the initialization of the pin, (after reset, before configured as an open collector pin).

enter image description here

\$\endgroup\$
0
\$\begingroup\$

No, the ESD network is not disconnected. There are a very few micros that may have one pin or so that can be pulled up to a higher voltage than supply voltage (eg. RA4 on PIC16F7X, which can be pulled up to 12V absolute maximum), but generally you cannot do this without causing the ESD network to conduct (which you should avoid doing for several reasons, for here it will suffice to note that it won't work for you). Some newer micros may have special ESD networks to allow 5V inputs which allow the output to be pulled up to +5 even with a lower voltage supply, but I don't think an operating voltage of 12V is a reasonable expectation.

Just drive a small MOSFET or a BJT+base resistor with the GPIO push-pull and use that as your 'open drain'. You may even be able to find a dual n-channel/p-channel MOSFET that suits your purposes and keep the parts count identical (though I like the idea of a series resistor to the GPIO if possible, just because it could save the micro in case something shorts the 12V to the GPIO).

\$\endgroup\$
  • 1
    \$\begingroup\$ STmicro ARMs tend to have a ton of 3.3V microprocessors with a slew of 5V tolerant pins. I'm pretty sure that 12V is out of the picture. \$\endgroup\$ – Scott Seidman Jun 26 '15 at 19:25
0
\$\begingroup\$

No, it will generally not work. Most likely you'll be unable to turn the transistor off, since the esd diodes will pull the gate to vdd.

However, I think there are some microcontrollers with open collector outputs that can handle higher voltage.

The datasheet will say this. Look under "absolute maximum ratings". Look for "maximum voltage on any pin" or "maximum voltage on open collector output".

\$\endgroup\$
0
\$\begingroup\$

Even open collector type GPIO will have an absolute limit on maximum voltage that can be pulled up to. Assuming your MCU is okay with that, your circuit works. During MCU boot up, or when MCU is under reset, the pin will not be driven and hence the gate of the FET will only see 12 V. Hence Load will not be energised by default. Once you drive MCU to zero PFET will definitely turn on and provide current to load. The pull up value can be around 10k. Ideally, you can look upon the Iol of the MCU. The current value, 12V /R should be less than that. Your circuit will work.If the pins are not open drain by default, then I would suggest to have a NFET driving the gate of PFET low. No worries of open drain. If you are looking for a solution you can refer to this. Using Arduino + MOSFET to automate the pressing of button

\$\endgroup\$
0
\$\begingroup\$

When the output is high it will be exposed to the full 12V. The leakage may be low enough to prevent too much damage, but it's still not something you want to do if you can help it, so don't do that. Use a N-type driver between the output and the PMOS, and switch to a push-pull output.

\$\endgroup\$
  • \$\begingroup\$ OP shouldn't even try this until checking the abs max ratings for the I/O pin voltage in the uC datasheet. Even if it doesn't damage the uC, it's likely to not pull up to 12 V due to esd protection. \$\endgroup\$ – The Photon Jun 26 '15 at 18:24
  • \$\begingroup\$ @ThePhoton: ... They shouldn't switch to an external driver until they check the specs? \$\endgroup\$ – Ignacio Vazquez-Abrams Jun 26 '15 at 18:25
  • \$\begingroup\$ They shouldn't connect 12 V \$\endgroup\$ – The Photon Jun 26 '15 at 18:52
  • 1
    \$\begingroup\$ They won't be if the rest of my answer is followed. \$\endgroup\$ – Ignacio Vazquez-Abrams Jun 26 '15 at 18:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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