Author Topic: Driving MOSFET gate with MCU I/O pin - resistor needed?  (Read 12378 times)

0 Members and 2 Guests are viewing this topic.

Offline shadewindTopic starter

  • Frequent Contributor
  • **
  • Posts: 329
Driving MOSFET gate with MCU I/O pin - resistor needed?
« on: March 04, 2011, 10:22:32 am »
I want to drive the gate of a MOSFET (http://www.irf.com/product-info/datasheets/data/irlr8259pbf.pdf) directly using the I/O pin of an ATMega8A microcontroller but I'm wondering if a gate resistor is required for this. The ATMega8A has a maximum output rating of 40 mA so wouldn't the current spike when charging the gate capacitance be very high?

I've googled around a bit for this and some people say to use no resistor, some people say to use a low value resistor (1 - 20 ? or something like that) just to prevent ringing and some people say to use a higher value resistor for current limiting (5V / 40mA). What's the correct thing to do?

I do realize that I probably should use a MOSFET driver for this but that's not the point. I'm wondering about the how's and why's so I can figure out myself what I need using the data sheets.
 

Offline mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 13879
  • Country: gb
    • Mike's Electric Stuff
Re: Driving MOSFET gate with MCU I/O pin - resistor needed?
« Reply #1 on: March 04, 2011, 10:35:42 am »
Yes, you should use a resistor to limit peak current if using larger MOSFETS - MOSFET gates can have high capacitance - well into nanofarads, which can cause current spikes on the MCU die, and ringing if the track is long. Resistor value depends on how fast you need it to switch.
The resistor can also be useful to limit the risetime of whatever you are switching.
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline shadewindTopic starter

  • Frequent Contributor
  • **
  • Posts: 329
Re: Driving MOSFET gate with MCU I/O pin - resistor needed?
« Reply #2 on: March 04, 2011, 10:51:27 am »
Since I want to switch as fast as possible (although it's not critical), I'd want to take advantage of all the current I can get. So that would be a resistance of 5V / 0.040 A = 125 ? ~= 150 ?

Sounds reasonable?

To determine the switching speed, what capacitance in the data sheet should I be looking at? Is it the input capacitance (Ciss) of 900 pF?
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 10154
  • Country: nz
Re: Driving MOSFET gate with MCU I/O pin - resistor needed?
« Reply #3 on: March 04, 2011, 10:52:54 am »
I've seen circuits with anything from 10R to 200R.  Personally, ive use 100R on atmegas and had no issues, 50mA is a little above the max but its for such a short time (just to overcome gate capacitance) that it doesnt seem to do any damage. You could probably even use 20R without any problems, most atmega ports are rated to 300mA (300mA total for all i/o on one port). I wouldnt recommend doing that for a professional product though.

If you were designing a product to sell then the correct way to do it would be a proper mosfet driver IC. However i'm sure there are professional products out there that just drive it directly. You can always use 137R which limits the current to a 100% safe 40mA at 5.5V the mosfet wont switch as fast but that may not be an issue in some applications.
« Last Edit: March 04, 2011, 11:16:05 am by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline jahonen

  • Super Contributor
  • ***
  • Posts: 1055
  • Country: fi
Re: Driving MOSFET gate with MCU I/O pin - resistor needed?
« Reply #4 on: March 04, 2011, 11:02:41 am »
To determine the switching speed, what capacitance in the data sheet should I be looking at? Is it the input capacitance (Ciss) of 900 pF?

Use gate charge for that, and read required gate charge for your gate voltage. For example if your mcu outputs 5V, then determine gate charge for that voltage and divide it by gate current. That gives you an idea how long the transition will take.

Regards,
Janne
 

Offline shadewindTopic starter

  • Frequent Contributor
  • **
  • Posts: 329
Re: Driving MOSFET gate with MCU I/O pin - resistor needed?
« Reply #5 on: March 04, 2011, 12:41:22 pm »
To determine the switching speed, what capacitance in the data sheet should I be looking at? Is it the input capacitance (Ciss) of 900 pF?

Use gate charge for that, and read required gate charge for your gate voltage. For example if your mcu outputs 5V, then determine gate charge for that voltage and divide it by gate current. That gives you an idea how long the transition will take.

Regards,
Janne
Allright, so 6.8e-9C/0.040A = 1.7e-7 s

But that assumes the charging current is constant which it is not, is it?
 

Offline tecman

  • Frequent Contributor
  • **
  • Posts: 444
  • Country: us
Re: Driving MOSFET gate with MCU I/O pin - resistor needed?
« Reply #6 on: March 04, 2011, 03:21:46 pm »
In reality the MCU I/O pin drive current capability will likely be the greatest limit to switching speeds.  A relatively low value resistor, a few hundred ohms, is advised to limit the peak current at turn on/off to a safe value as specified for the MCU.  You could do without, but good design practice says you should limit the current.  Resistors are also valuable to help swamp gate drive instability, which is unlikely with an MCU output, due to the low current capability.

paul
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf