Hi, I'm trying to drive a FET via a micro with PWM (ST7FLITE09).
I'm doing this via a 22R resistor from Port pin to gate. However when I do this the voltage from the micro drops to about 1V and won't turn on the transistor. Any ideas anyone as I am stuck???
Are you sure you've got the data direction register set correctly?
Are you also sure that you haven't got the output programmed to require a pull up resistor (sorry not familar with that micro, but you can generally programme outputs with or without pull-ups).
With the right kind of FET you should be able to drive it directly from the micro without a series resistor. I used to use ZVN3306 all the time for this kind of thing until I noticed that RETs (resistor equipped transistors) are a hell of a lot cheaper.
An n-channel JFET operates in the NEGATIVE Vgs regime. A positive source, such as your micro will simply drive the gate-source junction into forward-bias.
An n-channel MOSFET operates in the POSITIVE Vgs regime. It's possible that the device has a gate short, which would forward bias the subtrate-source junction
Pinout, pull-up, defective device (or perhaps wrong device, FET instead of MOSFET, wrong polarity) have already been mentioned. There might also be a problem with available drive from the pin. If you are using a PWM output, the gate capacitance will draw "a lot" of current, which many micros cannot deliver. You say that you are using a 22R gate resistor and this value implies that your transistor is quite hefty - and hence needs a lot of gate current.
Recommendations:
1 Study data sheet for transistor. Is it really what you think it is? Check pinout, gate capacitance, calculate peak gate current and mean current.
2 Check transistor by applying external gate drive using a variable resistor.
3 Study data sheet for micro. Can the pin be programmed to deliver the gate needed gate drive? Has it been programmed to do so?
4 Talk to an analogue designer. Look for an elderly person without any computer on his/her desk ;-). Analogue designers know a lot about interfacing to transistors.
Hi, thanks all for your replies. The transistor I am using is a IRLZ34N n type logic level mosfet. The transistor is OK becuase I applied a direct drive to the gate from an external power supply and it switched ok.
Reading the data sheet for the ST7 micro it can deliver up to 25mA which I am now thinking is not enough to drive the FET.
Any ideas on an alternative drive technique. (micro use +5V)
Will the ST7 actually supply 25mA in the high state? That sounds quite high to me.
The input capacitance of the IRLZ34N is probably quite high, and miller effect will multiply it during switching (though we haven't got to that stage yet apparently).
In some automotive applications I worked on, the gate would be driven by a pnp transistor to give a high current pullup for fast switching with a 1k resistor to ground for reasonably fast turn off.
Tried a pull-up but that made no difference. Then tried zeitghosts solution. Took the output from the micro into a PNP transistor (BC857) with 1K resistor on collector to ground. Then used that 'inverted' output to drive my FET. Now it works great. Thanks zeitghost for your comments. I have tried to display the soln below for others who may find it useful.
________________ +5V
| |
_|_ | to rest of cct
10K | | | |/ BC857 /|\
| | | /¯ |
¯|¯ |/ |
|-------|\ 1K |--|
_|_ | \ _____ | |
_____ | | -----| |-----| |<-| IRLZ34N
m | 1K | | ¯¯¯¯¯ | | |
i | ¯|¯ |--|
c |_________| |
r | PWM |
o | _|_ GND
¯¯¯¯¯ _
It is a bit hard to read your schematic (distorted), but I cannot see that you really have improved anything. The 1 k resistor limits the drive "punch" to almost nothing compared to the 25 mA short circuit current available from the micro. I think that you should find the real problem and not hide it behind a handful of extra components. They do not only add to cost and complexity - they also obscure the working of the circuit and can easily turn you into a Kludge Wizard - and you don't want that. Do you?
ST7 uses CMOS outputs and is specified to sink AND source 25mA.
Using that as a minimum current, the output slew rate into 1500pF is about 16V/us, so it's not at all clear why the ST7 couldn't drive the device directly.
If the device is not CMOS, then the outputs will be limited to 2 mA source current, reducing the slew rate to 0.4V/us after correcting for both the current and total gate capacitance, which is actually 4500pF. The datasheet 1500pF applies only when the device is off, which is a pretty short period of time, since the threshold voltage is about 1V. The Miller effect, per datasheet, increases the total effective gate capacitance by 50%, reducing the slew rate to 0.3V/us
which is a CMOS device, see page 24, with p-channel pullups. Page 44 shows +/-25mA output current.
In any case, there's still no obvious reason why the device was able to drive the MOSFET, even in a static DC condition, unless... the I/O pin was actually being programmed to go high.
Referring to pages 23 and 24, you can see that the I/O ports can be programmed as open-drain, so if the I/O is not specifically commanded to drive high, the output will float and require an external pullup to go high. Using the same 10K pullup in the schematic, the current is limited to an average of about 0.2mA, which still gets you a slew rate around 30V/ms.
I originally did the circuit using a BUK555 (similar spec to IRLZ34) and a PIC 16F873 which would drive the FET directly. The PIC also sources 25mA. However when I changed the FET to the IRLZ34 it didn't work.
Would it make any difference that I am using the FET to switch an inductive load (the circuit is part of a boost converter)?
OK. That makes sense. Now you have "unlimited" gate drive and you should be able to turn the transistor very quickly. But the turn-off will be painfully slow and will give you a lot of switching losses when you put some current through the FET. You need to speed up the turn-off by using a push-pull output stage. I still think that Zeitghost's tip about using parallel 74HC04 (without any gate resistor) is the best solution. It will give you very good drive - both on and off - and is also the least complex circuit.