Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Driving FETs with PICs

Status
Not open for further replies.

MacGyverS2000

Electrical
Dec 22, 2003
8,504
I've read through several threads here about driving FETs with microcontrollers, but I'm still unsure of the best method. Some suggest pullups, some suggest pulldowns, others suggest driver transistors for maximum gate capacitance supply, etc.

Knowing that there's a "better" design for every different application, I won't ask "What's the best way?" I need to switch a mere 1-2A, in the microsecond range, etc. using a PIC. I believe most PICs can source/sink around 20mA on each I/O pin. It will be a logic-level FET (take your pick, although suggestions are gladly accepted) switching 12V into 2 LEDs and a resistor in series (Vf on the LEDs is around 4.5V each).
 
Replies continue below

Recommended for you

A few points to consider in your design:
1) "I need to switch a mere 1-2A, in the microsecond range, etc" - how many microseconds, and, on/off duty cycle? What speed does the PIC output device switch at? These will determine if gate capacitance or switching speed is critical, as slow turn-on or turn off at the FET can cause lots of power dissipation problems.

2) Will the power supplies to the PIC and and the 12V supply to the LEDs ever be switched separately? If they are switched separately and your circuit has pull-ups this can drive current from the 12V supply into the PIC output devices, causing all sorts of strange problems at other outputs. Also, under these part-powered conditions you need to make sure that the FET is either turned fully on, or fully off. Otherwise a "don't know" could make it fry!.
 
Hi, if it's a logic level fet then a pic output will drive it easily. Why do you need to drive a led in microseconds? If it's for a visible application then milliseconds will do fine.
 
<Chuckle> Yeah, I said microseconds to prevent people from assuming much faster switching times, like ns or ps. It's for visible LEDs, so a switching time of 1 ms is more than acceptable...I'm turning power to large banks of LEDs on/off. This isn't PWM as that's done by another module, this is more of a &quot;Turn a section on immediately, then turn it off 100ms later&quot; type of switch.

The PIC is powered by a 5V regulator off of the unfiltered 12V line. The 12V line will be the power source for the FETs.

I ask because the information I have on the subject is somewhat limited. Examples I've seen in past thread have listed gate capacitances in the 1000pF+ range and it was always suggested they couldn't be driven by themselves, whereas many of the logic-level FETs I've seen have Ciss=1000pF+. I wasn't sure if these values were equivalent.
 
This is to drive the LEDs that you're talking about in your other thread? Then how were you driving them previously?
Choose your mosfet with multiple sources in mind. An IRF7401, for example, has a standard SO8 pinout.
If you see too much capacitance at the gate, use logic buffers in parallel to add drive to your PIC outputs. It's like an array of small push-pull amplifiers in parallel.
Don't forget a capacitor unless you want to scramble all the rf receivers in your area. A &quot;too good&quot; rise time will increase interference.
 
You can drive a big fet directly from a microcontroller port pin, you just can't drive it very fast.

The logic buffer approach is to be recommended if you want reasonable rise & fall times.

I've seen some remarkably complex drive circuits used in automotive comfort controls for this reason.

rgds
Zeit.
 
A simplistic view of the circuit goes something like this: A 12V supply line with a number of LEDs/resistors connected to ground through a FET. This FET is PWM'ed to change the brightness for all of the LEDs. Let's assume the LED lines are split into two sections...a FET will interrupt the 12V supply to each section to turn the entire section on/off. From the sound of it, I could get away with directly driving the FET which controls the section's on/off ability (fairly slow switching times, milliseconds), but I might need a driver circuit for the FETs which do the actual PWM control.
 
If you want to drive the FETs from 5V logic, I suggest that it's easier to put the FET in the ground (0V) side of the supply, and connect the LED + resistor to +12V, so it &quot;sinks&quot; the current rather than &quot;sources&quot; current from the +12V supply.

With each bank of LEDs, why not combine the PWM signal with the on/off selection at each FET? This can be done with some simple gates. That way you don't get the extra complication of using transistor level shifters for any sourcing FETS.

A further thought: although you can get power FETS with logic-level gate voltage requirements, if you use open-collector logic gates with pull-up resistors to +12V you can achieve extra gate voltage swing for the FET (if you need it) to make sure it fully turns on.
 
Brian, What is your reasoning behind putting the FET on the ground side of the supply (current sinking)? Combination of the PWM and selection circuitry is not possible. Also, using a pull-up resistor to +12V would enable the circuit when the processor was turned off, not a good thing...adding in extra circuitry to invert the signal again is to be avoided whenever possible.



For everyone, what equations are you using to determine the turn on times of the FET based upon its specs, current being switched, and gate voltage? A clear explanation of Miller capacitance is also appreciated.

Thanks!
 
Hi MacGyver, if you check both our posts of Feb 3rd you will see that I cautioned against using a pull-up if the rails could be switched independently. However, as your own post of this date said that the +5V supply was derived from the 12V rail for the LEDs, therefore unless you have a separate switch for the processor, they are both on together. I simply suggested the pull-up as an extra possibility.

The switching times for FETs are normally specified at a particular load current and Vds. Depending on the drive circuit impedance, gate isolation resistors, etc., it is possible to get a significant R-C delay circuit with the gate capacitance which can lengthen turn-on and turn-off times of the FET. This can be difficult to drive at really high switching speeds, and can also increase FET power dissipation during switching transitions due to the slow edges in the load circuit.

Miller capacitance is a parasitic capacitance between drain and gate (+ circuit board strays) which slows switching times by a negative feedback effect. Consider a positive-going gate voltage to turn the FET on. As the FET starts to conduct and the drain-source voltage starts to drop from a high to lower potential, the Miller capacitance produces a negative going transition into the gate which tries to counteract the positive going change which produced it. The reverse situation occurs when the device turns off.

Hope that helps.



 
So am I merely looking at the time constant created by the drive circuit impedance and gate capacitance RC network for switching times? Say, 1 time constant for a basic idea of speed, and 5 constants for a real idea of how fast it will truly be?

The PIC parts can supply 25mA per port (not the 20mA I originally specified). Switching times should be in the millisecond range for the &quot;selection&quot; FETs, but the PWM FETs should have switching times in the 100 us range.

Where do I look on the FET datasheet to find the gate capacitance? The datasheet lists Ciss, Coss, Crss (Input, Output, and Reverse Transfer Capacitance, respectively), but no indication of what these values refer to (which pin or grouping of pins). The sheet lists turn on/off times, but I assume those are based strictly upon the internal gate capacitance and resistance.
 
The gate-source capacitance is Ciss.

The gate-drain capacitance is Crss.

The drain-source capacitance is Coss.

Ciss is more or less constant.

Crss is multiplied by the voltage gain during switching to give the Miller capacitance.

The combination of Ciss and (Crsss x gain) defined the input capacitance that the driver has to charge and discharge to turn the thing on and off.

rgds
Zeit.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor