Driving MOSFET gate with MCU I/O pin - resistor needed? - Page 1
Forum section: electronics / projects

author: shadewind
author_rank: Frequent Contributor
timestamp: March 04, 2011, 10:22:32 am
content: 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.

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: March 04, 2011, 10:35:42 am
content: 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.

author: shadewind
author_rank: Frequent Contributor
timestamp: March 04, 2011, 10:51:27 am
content: 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?

author: Psi
author_rank: Super Contributor
timestamp: March 04, 2011, 10:52:54 am
content: 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.

author: jahonen
author_rank: Super Contributor
timestamp: March 04, 2011, 11:02:41 am
content: Quote from: shadewind on March 04, 2011, 10:51:27 amUse 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

author: shadewind
author_rank: Frequent Contributor
timestamp: March 04, 2011, 12:41:22 pm
content: Quote from: jahonen on March 04, 2011, 11:02:41 amAllright, so 6.8e-9C/0.040A = 1.7e-7 sBut that assumes the charging current is constant which it is not, is it?

author: tecman
author_rank: Frequent Contributor
timestamp: March 04, 2011, 03:21:46 pm
content: 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