1
\$\begingroup\$

enter image description here

The uC is a PIC10F220, which if I read the datasheet correctly can supply 25mA absolute maximum on its pins. The MOSFET that drives the load is actually 4 pcs NCE0140KA in parallell, but drawn as one for simplicity. The combined capacitance of the MOSFET's is 13.6 nF. I have selected the values of R1 and R2 so that the transistor gate will charge and discharge as quickly as possible, in order to minimize the transition time when the the transistors will be half-open. I am doing this because this circuit will be potted, so I'm trying to minimize heat dissipation.

By my calculations the current drawn from the uC output should peak at around 20mA the moment the output is activated and stabilize at 10mA. The peak will be close to the absolute maximum of the pin, but I figure it will be OK since the peak will be very short: Time constant of the R1-M1 RC circuit is 250 * 13.6e-9 = 3.4 us.

The circuit will be used as a pwm control and the switching frequency will be around 2 kHz.

Have I got this right? What would you do differently?

\$\endgroup\$
  • 1
    \$\begingroup\$ You're using an nfet for high-side switching. I think that's probably not going to work as you expect it to. \$\endgroup\$ – Hearth Sep 29 at 13:55
  • \$\begingroup\$ @Hearth I checked this espruino.com/mosfets?print to see where to connect the load. Did I get it wrong? It shows an n-channel mosfet with the load connected to the drain. \$\endgroup\$ – K0ICHI Sep 29 at 14:19
  • \$\begingroup\$ I'm talking about the one you have labelled "uC FET". M1 is connected correctly. \$\endgroup\$ – Hearth Sep 29 at 14:20
  • \$\begingroup\$ Gotcha. The "uC FET" is the one inside the uC that drives the uC output. I updated the drawing for clarity. \$\endgroup\$ – K0ICHI Sep 29 at 14:29
  • \$\begingroup\$ You'd probably do better to drive it in push-pull mode rather than open-drain. That would depend on how much current your micro can sink, though, which you haven't stated (the datasheet gives an absolute max of 25mA, same as sourcing, but that isn't the same as maximum recommended) \$\endgroup\$ – Hearth Sep 29 at 14:42
1
\$\begingroup\$

You're (worse than- because of voltage drop in the output) halving the gate voltage, the particular MOSFET you mention is only guaranteed as low as 4.5V Vgs, so you're going to get more (perhaps much more, and relatively unpredictably) Rds(on) and thus I^2R heating during conduction than if you used the full 5V drive.

Secondly, you need to consider the gate charge to determine the switching time with a load, not just input capacitance because of Miller effect- your numbers will be optimistic by a large factor because the gate-drain capacitance couples the drain voltage swing back to the gate at a multiple because the drain voltage changes more than the gate voltage. From the link above:

enter image description here

There are many papers on predicting switching times, or just get a SPICE model and look at "typical" results to get a feel for it (keeping in mind that there will be a spread in parameters in reality- not all devices are "typical").

The MCU naturally drives the output push-pull- you're better off driving it that way with the full 5V (series resistor) and adding a driver circuit if the switching is not fast enough to meet your requirements. A (very) rough simulation for the MCU output with a 5V supply is a voltage source in series with a ~100 ohm resistor (maybe 200 ohms for sourcing current vs. 100 for sinking). If it turns out that guesstimate resistor value is fairly important, your circuit may be too dependent on characteristics that are not guaranteed (in reality the outputs act sort of like a constant current source over a range, and that current is not well controlled).

Here's an old Microchip output curve, the part you are using will likely be different, but the shape will be similar:

enter image description here

Edit: Suggested simple gate driver. You can also buy gate driver chips with much higher gate drive, and several manufacturers have many products (including Microchip), but for 2kHz it should not be necessary. You can optionally put a 1K resistor from MCU output to gate to get the tail of the 0/5V.

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
  • \$\begingroup\$ Thanks, that was enlightening. I read in the uC datasheet that the outputs have software configurable pull up resistors, so I assumed it that was disabled, the output would simply float. \$\endgroup\$ – K0ICHI Sep 29 at 14:42
  • \$\begingroup\$ And the circuit above would be OK if I eliminated R2 then? I will look into using a MOSFET driver. Seems like the way to go. \$\endgroup\$ – K0ICHI Sep 29 at 14:44
  • \$\begingroup\$ The output curves for the PIC10F220 are found on pages 67 and 68 of the datasheet, and it's only characterized up to 5mA source or 10mA sink, which is probably not enough for what the asker wants to do. \$\endgroup\$ – Hearth Sep 29 at 14:46
  • 1
    \$\begingroup\$ @SpehroPefhany Well that's inconvenient. Fortunately the PIC10F220 is, not ancient but certainly "medieval" as far as electronics go. \$\endgroup\$ – Hearth Sep 29 at 14:51
  • 1
    \$\begingroup\$ @K0ICHI Oh, there's nothing wrong with using old parts! If it suits your needs, you should never feel like you need to use the latest and greatest thing available. \$\endgroup\$ – Hearth Sep 29 at 15:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.