I have an engineering background, but close-to-zero practical experience with discrete electronic circuit design.
simulate this circuit – Schematic created using CircuitLab
Regarding the above schematic, let's say I have a P-MOSFET (type SiA441DJ), a 10 V power dupply, and an STM32 microcontroller with 3.3V logic level.
Very simple, I guess.
If I use a GPIO configured as open drain output, not push-pull, and use a pullup resistor between the gate and source of the P-MOSFET, it shuld be possible to directly drive the P-MOSFET from the microcontroller, without extra driver circuitry. (Except a 100 OHM resistor between the GPIO and the gate for "safety" and a pullup.)
The pullup is to put the gate voltage for the off-state.
It it OK to do so? Am I correct or am I missing something?
Regarding the microcontroller STM32F103, the GPIO output driver circuit looks something like this:
(GPIO output driver from STM32 Ref. manual RM0008)
So, what I understand (or misunderstand :-) ):
If I use open drain configuration, the P-MOS of the GPIO driver is not conducting, thus open, thus a not existing. So if the GPIO output level is High, also the N-MOS is open, i.e. "not existing". So what's left is the Protection diode, which ties the pin to 3V3. OK then, I understand this doesn't work. Means, the "open drain" configuration is limited to the GPIO output logic.
So my conclusion: I can't directly drive the P-MOSFET this way because the protection diode of the GPIO prevents the Gate voltage to raise to V-SUP = 10 V. That's why I need an additional N-MOS (or NPN) to get a "true open drain", not limited to GPIO hi-voltage level ... That makes sense to me...
Am I right?
I am asking this because lots of examples I found for doing this looks much more complicated, at least using, for example, an N-MOSFET to drive the gate of the P-MOSFET.
Note: A very similar question is here: Can you drive a MOSFET directly from a microcontroller? but is hasn't been answered. The answers had been altered.