Converting logic level sink to source for powering n-channel mosfet gate

MikeML

Joined Oct 2, 2009
5,444
Most processor port pins are configurable to be either an output, in which case it has a full CMOS output driver with a PFET to source current from Vdd, and an NFet to sink current to Vss, or an input, in which case the weak-pull up can be enabled or disabled.

The weak pull-up could be used when that input pin is sensing an external switch or keyboard, for example. Switch off, input is pulled high by the internal weak pull-up; Switch closed, the input is pulled low by the switch, and not much current flows to ground through the switch...
 

SgtWookie

Joined Jul 17, 2007
22,230
You might find that your uC will draw less current if the I/O pins are in the INPUT state; in that case you may wish to keep them as INPUTs most of the time, then change the MOSFET gate control pin to OUTPUT prior to turning it ON, then back OFF - after it's been off for at least several milliseconds, you could go back to INPUT if you had a large pull-down resistor - say 300k Ohms - to keep it turned off.
 

BobTPH

Joined Jun 5, 2013
8,998
The datasheet indicates that it can source 2mA. This would not be enough for fast switching of a massive MOSFET, but it should be plenty for the rate of switching that you need. Find the total gate charge of the MOSFET and use the equation:

Q = I * t

Using a popular high power MOSFET, the IRF540, the total gate charge is 71 nC.

At 2ma this equation works out like this:

71e-9 = 2-e3 * t

t = 35.5e-6

So the time to charge is 35uS. This would be disastrous if you were trying to switch at 100KHz, but for your application, perfectly okay.


Bob
 

BobTPH

Joined Jun 5, 2013
8,998
Yes, and that is the current at which they gaurantee an output voltage of Vdd - 0.5V, so 4.5V with a 5V supply.

I now notice that you specified the MOSFET you were looking at, and its Qg is max 3.9nC. So the turn on time at 2mA would be less than 2 uSec.

Bob
 

Thread Starter

MrSoftware

Joined Oct 29, 2013
2,202
Thank you everyone for the help! I've sent my PCB off to be made and ordered all of the components, so please cross your fingers and toes for me. ;)
 
Top