Do I severly misunderstand how to select a mosfet gate resistor? - Page 1
Forum section: electronics / beginners

author: NaDobraNich
author_rank: Regular Contributor
timestamp: August 28, 2024, 06:44:05 pm
content: I have a stupid problem. I'm 100% sure this is happening but can not explain why.https://tinyurl.com/2dy76frvI have a small signal mosfet (NTZD5110NT1G). Source tied to ground. Gate tied to a 3V3 pullup via 48.3K total (R1+R2), and also hooked to an unprogrammed 3V3 micro (STM32H5, pin in high-z / input state). The drain is tied to a 5V pullup from another device, as well a 3V3 LED via a 10k pullup (I didn't want it too bright).It must be on such a ragged edge of not working that removing that 10K LED resistor makes it sort of work.I realize the correct issue now is that my total gate drive via the 47K R1 and 1.3K R2 (I realize R2 is not needed, I have jumped it for these tests, I originally thought I might drive it high from the micro) is too high. Like comically wrong it seems and I don't understand why.My estimation was that because I do not need fast switching, I could use a lower gate drive. I thought I calculated this to be 25us or so at 48Kohm. Turns out, my circuit is acting more like 200ms!Please tell me what is going on here!?GREEN: 3V3 LDO source from 5VBLUE: GATE VOLTAGEYELLOW: 5V PULLUP IN DEVICE, TO BE GROUNDED FOR ENABLE EFFECTNOTE: There is a 2ms glitch between the device being powered and the 5V signal. This is correct behavior.First test: I reduced the gate pullup to 28K total. At 48K it looks just like this.Second test: I reduced the gate drive down to 5.1K R1, R2 now jumped. Better, but still wrong. The gate voltage isn't as low but it isn't enough to drop the 5V/5K pullup signal to ground until 150ms in or so.Third test: Ok, this is correct. The 5V signal is immediately pulled to ground by the mosfet. However... I can't explain this. Obviously the stronger the gate, the faster it will work, but this is WAY WAY outside of the time ranges I was expecting.I have the solution, use a smaller resistor. But I can't explain why it's so far off from my estimations.Can anyone help?

author: Konkedout
author_rank: Frequent Contributor
timestamp: August 29, 2024, 02:06:05 am
content: While this MOSFET has a gate threshold voltage of 2V5, that is only enough to get a trickle of current through the drain. Rds(on) is specified with Vgs=4V5 and also 10V0. If I wanted to switch this FET "ON" I would drive the gate with at least 5V. So anyway, you may be seeing only the very top end of the curve as the gate is charged up through your pullup resistance. If you cannot do that, you may be much better off using a BJT such as 2N3904.

author: NaDobraNich
author_rank: Regular Contributor
timestamp: August 29, 2024, 02:41:39 am
content: So, my entire load is 1-1.25mA. And “high” RDSon could be 500 ohms before it caused a problem for me.But I hear you. I needed other transistors that could withstand 18V and re-used those here.By the charts, it looks like under 400mA or so, it doesn’t really matter as I’m clearly in the linear region but the worst case RDSon should be unnoticeable for a 1.25mA load.FWIW, I did run a wire on a board to 5V0 instead of 3V3. With the 47K resistor, it still didn’t work. It did with 12V.

author: ArdWar
author_rank: Frequent Contributor
timestamp: August 29, 2024, 02:48:13 am
content: Those waveforms are suspiciously similar to how miller effect would behave, but wrong by three orders of magnitude in timescaleHow's youractualschematic looks like?

author: NaDobraNich
author_rank: Regular Contributor
timestamp: August 29, 2024, 03:01:15 am
content: Quote from: ArdWar on August 29, 2024, 02:48:13 amI’m unfamiliar.I’ll post the schematic tomorrow, but I promise it’s this and there are no surprises.

author: ArdWar
author_rank: Frequent Contributor
timestamp: August 29, 2024, 03:10:29 am
content: I said suspiciously similar because the shape is the only thing similar here, a lot of the details aren't.Actual Miller would slope down VDSduring the plateau for example, not after. Nor that the plateau voltage change with resistance for that matter.

author: NaDobraNich
author_rank: Regular Contributor
timestamp: August 29, 2024, 04:43:17 am
content: My current best guess is that my unprogrammed micro is either not keeping that pin in reset. Or maybe somehow it is loading to the factory bootloader and this pin is being used there? Or… IDK, I’m nearly out of ideas.That as I lower the pull-up resistance, I am overcoming whatever the micro is doing.I’ll cut the trace going to the micro and re-test.

author: Jeroen3
author_rank: Super Contributor
timestamp: August 29, 2024, 05:47:34 am
content: Leakage in the mcu pin is probably enough to offset the voltage the 47k is pulling up.And the mosfet isn't very much on at 3V, it only passes around 0.4A, or abouts 7 ohm rdson.Is this pin 5v tolerant? Can the pull-up be to 5V?

author: ArdWar
author_rank: Frequent Contributor
timestamp: August 29, 2024, 05:52:23 am
content: Most STM32 pins are 5V tolerant, except those that can be muxed as DAC outs

author: Doctorandus_P
author_rank: Super Contributor
timestamp: August 29, 2024, 11:43:39 am
content: Quote from: NaDobraNich on August 29, 2024, 04:43:17 amMost common is for uC pins to be high impedance during reset and before initialization. If this can be problematic, then add an external pullup or pull down resistor.For determination of gate series resistors, it's nice if you have an oscilloscope. Put your uC on a breadboard and add a (too) high series resistor, and watch the miller plateau getting shorter as you reduce the resistance. After the miller plateau has disappeared, further reduction will increase the switching speed of the FET. This can be important for EMC purposes.As a secondary task, the series resistor can be used to protect the microcontroller if the FET ever gets damaged. But it's value has to be quite high for this to work. The ESD diodes on microcontroller pins can usually handle only just a few mA of DC current safely. Some datasheets I have seen mention 2 to 5 mA dc.

author: NaDobraNich
author_rank: Regular Contributor
timestamp: August 29, 2024, 04:04:01 pm
content: Quote from: Jeroen3 on August 29, 2024, 05:47:34 amAgain, I'm trying to sink 1.25ma. That's all. From the scope pictures you can see it IS doing it around 1.5-2V at the gate.The issue is the gate is not acting at all how I would expect.As to 5V, I tried that first. With the 47K resistor, it did not work. I didn't get a scope image of it. I could just tell it was acting the same as 3V3. However, 12V0 on that gate did work, I cut it from the micro when I did that, so this is my next move.

author: NaDobraNich
author_rank: Regular Contributor
timestamp: August 29, 2024, 04:12:00 pm
content: Schematic:My sideThe deviceAnd the micro is a never programmed STM32H5 with it's boot0 pin tied to ground, which means it should be unprogrammed, should be not going into the bootloader, should be hard faulting immediately and the pin should be in a high-Z state. I guess I could check this with GDB after power up. I'm cutting that line and testing now.

author: NaDobraNich
author_rank: Regular Contributor
timestamp: August 29, 2024, 04:27:10 pm
content: I think I narrowed the issue down,Probably obviously to many, once the trace to the MCU was cut, the gate acts exactly as you would expect with the 48Kohm of resistance from 3V3.When the MCU is link to STM32H563 PB14 is cut, the gate follows the 3V3 source exactly, you can tell no difference. I separated them by .5V X-axis for illustration..... So..... How do I confirm that the MCU isn't in high-Z, or that PB14 is acting strange, or.... IDK what my other options are. I can move this pin in a later build, I can test another pin that might work better. But none of that explains why this isn't working.EDIT: I restored the trace. Looks to me like the 3V3 and Gate follow until 1V15. Then I guess something must happen inside the STM32, it holds the line low it seems, then releases for 27us when it follows back to 3V3, then grounded again.So.... Clearly the MCU is not in high-Z right!? But then when I remove the 47K pullup down to a 1K, I must be overpowering the MCU drive?EDIT2: ConfirmedI changed the gate from connected to PB14 to PC5 and the issue goes away. The scope shows a small strange issue with the gate not following the 3V3 source exactly at the start but whatever, it works after some odd startup behavior (maybe?).