FET gate inductance / Crss and oscillation - Page 1
Forum section: electronics / beginners

author: electrolust
author_rank: Unknown
timestamp: March 08, 2017, 12:02:16 am
content: Continuation ofhttps://www.eevblog.com/forum/beginners/mosfet-drain-current-spec/.In that thread, radiogeek381 says that the coupling between the gate and drain can create an oscillation when the gate voltage is turned off. It seems quite right, but I found scant other references to this elsewhere online.I did find lots of references to gate inductance, which ultimately will cause some oscillation as well. The fix for that is to add an external Rg resistor in series with the gate. I guess selecting the correct value is another matter ...Here are some tests I did with 3 different FET parts.(part, Ciss, Coss, Crss)1. NXP PMV20XNEA, 930pF, 178pF, 144pF2. Fairchild 2N7002, 20pF, 11pF, 4pF3. Fairchild FDV301N, 9.5pF, 6pF, 1.3pFHere's a select excerpt from the previous thread.Quote from: radiogeek381 on February 01, 2017, 01:54:18 pmNote that my tests are on a breadboard, with very large  loops compared to what would be on a PCB.Now, if I were to limit myself to a google education, I'd think the only problem is inductance. And so the mitigating effects of an external gate resistor would be the dominating factor and would show similar results across all 3 parts.What I actually found that was resistor had the desired effect for the PMV20XNEA part but only partial effect for the other 2 parts.With this post I hope to better understand how to estimate the amount of oscillation based on the spec sheet, and how to combat it. Based on my reading (to date) of the gate inductance effect, and the external gate resistor's effect on the PVM20XNEA, I expected it to also eliminate oscillation on the other parts, which yeah that didn't happen. And based on my limited understanding that Crss can predict the amount of oscillation (larger Crss = more oscillation), well that isn't holding quite true either.I'll post traces in the next post.

author: electrolust
author_rank: Unknown
timestamp: March 08, 2017, 12:39:55 am
content: The first trace (PMV20NXEA_4k7_2ms) is just to show that for all other traces, it's not the case that Vds reaches a final value after the brief oscillation. It actually takes quite a long time. So this first trace shows the general curve that all the traces take, that it ultimately takes about 6ms for Vds to get to the 'off' value. I thought this trace was important because at the locally zoomed timescale of the other traces, Vds does appear to flatten out.The sequence of the rest of the traces of interest is first, a trace without an external gate resistor, and then a trace with a 4k7 external gate resistor.The very little zigzags like at about 1us in PMV20NXEA_4k7_2us.png are external periodic noise. I believe this because if I take multiple traces the point(s) at which this zigzag occurs just drifts somewhere else along the trace. Sometimes I can get a capture without the zigzag at all, just depends on the timescale and did I capture the correct interval.On the PMV20NXEA traces, the 4k7 resistor solves the major oscillation problem, but then there is a ringing at the time the Vgs is switched off. I think this is a probing problem but I notice this ringing isn't present for the other traces when I add the resistor. But note that the PMV20NXEA trace was taken on a different day than the others. My probing setup may have changed just enough that the ringing went away "on its own". I'll try to verify this in a day or so.Look at the huge oscillations on the 2N7002 and FDV301N parts without gate resistor. Note that for the FDV301N the Vds scale is 1V as opposed to 500mV on the other 2 parts. It actually swings all the way up to about 3.3V whereas the final settling is (like the others) at ~ 2.0V. That can't be good! With the gate resistor, both of these parts act about the same.Besides understanding this in general, how can I eliminate the remaining oscillation on the 2N7002 and FDV301N parts, to get it to look like the smoothed PMV20NXEA trace?

author: BrianHG
author_rank: Super Contributor
timestamp: March 08, 2017, 03:09:11 am
content: You have an absurd bounce on the 2N7002, can you provide your test jig schematic & photo of you probe setup wiring...

author: T3sl4co1l
author_rank: Super Contributor
timestamp: March 08, 2017, 04:01:57 am
content: Ferrite beads do wonders here. I was testing a high voltage cascode circuit,Note the caps from drain to gate, to reduce dV/dt and equalize V and dV/dt across the transistors during commutation.The combination of feedback caps, zener diodes (to clamp transients, just in case) and modern high gain transistors (SuperJunction type, SPA07N60C3) made for a wicked combination: I observed oscillations in the 200-400MHz range!Ferrite bead on the gate stomped that out nicely.Tim

author: electrolust
author_rank: Unknown
timestamp: March 08, 2017, 09:13:59 am
content: Quote from: BrianHG on March 08, 2017, 03:09:11 amThanks, that's quite helpful believe it or not. I'm using a ZIF test socket, which I did have a problem with earlier, but thought I had that solved. I wonder if need to re-address that. I'll take another look and maybe even solder onto a breakout board instead. Will report back ...

author: electrolust
author_rank: Unknown
timestamp: March 08, 2017, 09:17:32 am
content: Quote from: T3sl4co1l on March 08, 2017, 04:01:57 amCool. My search-fu has improved a bit and I now see a few tech docs descriing the whys and hows of ferrite beads on the gate. I'll give it a shot.Maybe I should have noted, we're only talking about 3.3V and 20mA in my case. I'm just switching on an LED. I don't mind slow switching time or losses so much, but I can't have the EMI.

author: MagicSmoker
author_rank: Super Contributor
timestamp: March 08, 2017, 12:39:40 pm
content: Quote from: electrolust on March 08, 2017, 09:17:32 amYes, you should have noted. Ferrite beads and critical damping of the gate are things you worry about when switching high power (ie - voltage * current) rapidly; at <12V and <1A just use a 100 ohm gate resistor and don't overthink this. This is because gate ringing only becomes an issue when you need to drive the gate hard to minimize switching losses (as in a switchmode power supply), which requires a low value of gate resistanceThat said...Ringing on the gate is the result of a resonant network formed between the inductance of the wiring between driver IC and gate (including the gate resistor) and the effective (or "lumped") capacitance present at the gate (usually dominated by the Ciss/Cgs). To suppress this ringing the gate resistance, Rg, needs to be larger than the characteristic impedance of the LC network, Z, or Rg > (L/C)^0.5.For example, if the gate capacitance is 100pF and the wiring to it is 20nH then Z is ~14 ohms, so make Rg 15 ohms or higher and you won't have a problem with ringing.

author: BrianHG
author_rank: Super Contributor
timestamp: March 08, 2017, 12:44:20 pm
content: Quote from: electrolust on March 08, 2017, 09:17:32 amThis is also crucial info....Like I asked, I believe a simple diagram of you test jig and maybe a photo of your setup would help in this particular case.

author: electrolust
author_rank: Unknown
timestamp: March 09, 2017, 02:23:08 am
content: test jig. The probe on the bottom is the gate, the probe you can just see at the center right is the drain.I retested the PMV part (which had good results earlier) and the FDV parts today, to verify the test connections were very similar. I get the same results. PMV part has reasonable ringing, the FDV part has absurd ringing. If I use an active probe I get the exact same results as with the passive probes.

author: electrolust
author_rank: Unknown
timestamp: March 09, 2017, 02:39:21 am
content: Quote from: MagicSmoker on March 08, 2017, 12:39:40 pmHuh, so smaller C means I need a larger Rg. I kind of thought I would need something like 22r since all refs I can find about this talk about such small resistances. But, I guess they are talking about "power" MOSFETS which will have larger Ciss/Coss/Crss and these fit your example of 14r.For the FDV part (Crss=1.3pf), I didn't have 22r but I have a 150r and I was surprised it was worse than the 4k7. Now I see why, since my Z is larger with the smaller Crss.For good measure, here are traces of the FDV part with Rg=150r (about the same as Rg=0), 15k, and 47k. At 47k it looks pretty good although there is still the brief ringing right when the gate voltage is shut off. How do I suppress that?Is the FDV part even a good selection for this application? I thought the huge capacitance of the PMV part was a bad thing, and I selected the FDV part based on having minimal capacitance. But given I need to add an appropriate Rg in either case, should I be selecting based on other criteria? Minimal capacitance seems like a good thing anyway though, from the gate driver point of view, yes? But with the PMV part I don't get the initial ringing when the gate voltage is shut off. Do I maybe actually need more capacitance to combat this? (slightly more, not so much as the PMV part has)

author: BrianHG
author_rank: Super Contributor
timestamp: March 09, 2017, 04:59:40 am
content: In your setup, what's that 'Q' black plastic device. Where is the FDV301N, or is it the FDV301N mounted on a entombed PCB?Something still doesn't seem to add up here, especially after your first new scope screenshot and looking at that breadboard.That super fast few ns swing when turning off the transistor looks like an inductive fly-back. You are powering a LED here, not a transformer or long wire leads? You should turn the BW limiter off on your scope to you can see the true voltage range of that spike, it seems it may exceed all your power supply voltages added up even with the fet's internal capacitance. This is a sign that it's the high turn off speed of the FDV301N (it's the fastest one), releasing the output to high impedance, making your wiring + breadboard + powered circuit ring, not it's internal capacitance. Yes, once such a huge ring on the drain may cause the gate to oscillate and using a slower turning off fet will remove this oscillation, but the fet here may not be at fault.

author: electrolust
author_rank: Unknown
timestamp: March 09, 2017, 09:17:45 am
content: Quote from: BrianHG on March 09, 2017, 04:59:40 amSOT23 ZIF test socket

author: electrolust
author_rank: Unknown
timestamp: March 09, 2017, 09:55:54 am
content: Quote from: BrianHG on March 09, 2017, 04:59:40 amYes, 3.3V linear power supply to the LED (mounted in black project box in upper right, you can see the LED under the green wire loop). PSU is set to 20mA current limit. The LED cathode is a black wire out of the project box, and there I have the probe and a wire lead clipped on. The wire lead goes to the FET drain.There's 5'+ of wiring from PSU until it finally gets to the drain. Another 4'+ of ground wire. Do you consider that "long"? Long enough to have an effect? I realize it's orders of magnitude longer than it would be on PCB but the PSU is on a shelf and I'm using (short) 3' test leads which just make it down to the bench. So I don't know if I can do much better than 4' without adding a voltage regulator or something else (op amp follower?) right on the breadboard.QuoteIf you look back at FDV301N_0r.png from reply#1 it looks like it bounces all the way to 3.3V if not a bit more (with BW limit on). I can try again with BW limit off, and also put a cursor there to see the value.The gate is driven by a square wave function generator. If I increase the rise/fall time will that tell me anything useful? I think not since the FET will still turn off (quickly) once the signal gets under Vgth.What if I add a small (22r) shunt resistor at the drain? If that actually reduces the ringing is that any indication that I need such on my PCB, or is it safe to assume I will be ok given short PCB trace lengths.Thanks so much for your continued attention!

author: BrianHG
author_rank: Super Contributor
timestamp: March 09, 2017, 10:24:12 am
content: Ok, as test #1, place the + from you power supply to the red rail of your bread board. Add a 10uf cap on the +&- rail of the bread board. Remove the LED box and add a test approx 47-100 ohm resistor from the + bread board rail to the drain of the mosfet & attach the scope probe to the drain of the mosfet and see if you get the bounce. Both probe ground clips should be connected together to a leg going directly to the Source of the mosfet. We want to see the voltage signals as the mosfet sees them since everything comes down to the Source being the reference 0v.test #2, connect the + & - lead of your led box in place of the resistor. This means wiring the LED box's leads right into the bread-boards holes where the test 47-100ohm resistor used to be & once again place the probe right at the Drain & scope capture this signal to compare.

author: MagicSmoker
author_rank: Super Contributor
timestamp: March 09, 2017, 12:09:06 pm
content: Quote from: electrolust on March 09, 2017, 02:39:21 amCiss, not Crss; the latter is the (voltage dependent and non-linear) capacitance between drain and gate. It does place an upper limit on the value of the gate resistor because it couples charge from the swinging drain voltage back to the gate (which the driver - through the gate resistor - must resist), but when switching a few volts (ie - less than 10-12) it hardly matters with reasonable choices of gate resistor (where "reasonable" is defined as somewhere between 1 and 1000 ohms).So I was really puzzled by the extreme amount of oscillation in the drain waveform until I read this:Quote from: electrolust on March 09, 2017, 09:55:54 amYes, that is *very* long without some sort of local decoupling capacitance and/or RC damper across the drain-source terminals!The ringing across the MOSFET drain-source is from a resonant network formed between the inductance of the wiring and the output capacitance, Coss, of the MOSFET. Sound familiar? It's very much like the gate ringing, except different wires and MOSFET junctions are involved! The cure here is to put a 10uF to 100uF electrolytic capacitor across the positive and negative supply terminals near the MOSFET; this decouples the inductance of the wiring which should eliminate the ringing.

author: electrolust
author_rank: Unknown
timestamp: March 09, 2017, 08:59:54 pm
content: Quote from: MagicSmoker on March 09, 2017, 12:09:06 pmI was going to followup on this earlier but forgot.Wouldn't Ciss dominate when turning the gateon, but Crss dominate when turning the gateoff? I'm going by what radiogeek381 stated in my earlier thread on this. I'm thinking that this is because it isn't a capacitor per se, more of a capacitive effect and Crss represents that effect as the FET turns off.In my example, I'm only looking at the time when the gate voltage goes to 0.For the rest, I think I get it and I'll post a followup when I'm able to modify the breadboard setup and retest.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: March 09, 2017, 09:29:26 pm
content: It's equally relevant during turn-on and turn-off, during the Miller plateau, where transconductance is highest. (When fully switched on, Vds ~= 0 and Gm is very small; when fully switched off, Id ~= 0 and Gm is about zero.)One or the other may not actually manifest itself in a real circuit, because real circuits are not always resistive. For example, a circuit with a capacitive response at very high frequencies (i.e., Vds rises or fallsafterId falls or rises) will have a longer plateau at turn-on, and none at turn-off (Vds hangs around ~0 due to the capacitive lag). A ZVS circuit may not have any plateau or ringing because Vds is always ~= 0 during gate commutation.Tim

author: MagicSmoker
author_rank: Super Contributor
timestamp: March 10, 2017, 12:07:27 am
content: Quote from: electrolust on March 09, 2017, 08:59:54 pmNot really. I didn't see your earlier thread so can't comment on what was said in it, but Crss (aka Cgd) slows down both turn on and turn off through what is essentially a negative feedback mechanism (the so-called "Miller effect"). What happens during turn-on, for example, is that as drain voltage declines Crss removes charge from the gate which has the net effect of reducing the gate voltage thereby causing the MOSFET to want to turn back off; the inverse occurs during turn-off, in which rising drain voltage pumps charge back into the gate causing it to want to turn back on.As you might infer, then, Crss/Cgd is less of a factor at lower drain voltages. Speaking of, if 3.3V is the supply voltage for everything in this circuit - ie, the MCU which controls the MOSFET also runs on 3.3V - then you should use an NPN BJT rather than a MOSFET for load switching.Your main problem is still the hellacious ringing on the drain waveform, though... it's practically an AM radio station right now!

author: electrolust
author_rank: Unknown
timestamp: March 10, 2017, 01:54:40 am
content: Quote from: BrianHG on March 09, 2017, 04:59:40 am4.4V! Yow!

author: electrolust
author_rank: Unknown
timestamp: March 10, 2017, 02:34:54 am
content: 10uf film bypass cap on drainno gate resistorthe crazy ringing is gone! Still some oscillation but this looks much better.With the bypass cap the drain voltage never (1s) quite reaches the steady state of 2.0V. Compared to without the bypass cap it got there in about 2ms. I suppose it would get there faster with smaller bypass cap but at some point I would start to introduce the wild ringing again.

author: electrolust
author_rank: Unknown
timestamp: March 10, 2017, 02:37:38 am
content: now with 150r gate resistor (still some ringing) and then 2k2 gate resistor (ringing gone on drain but still some small oscillation on the gate).

author: BrianHG
author_rank: Super Contributor
timestamp: March 10, 2017, 04:55:43 am
content: Now, if you followed my bread-board layout & probe recommendation from a few posts up, using short jumper leads for the power rail to the mosfet with the scope-shot I see just above, here is one more trick:Take the shortest possible solid conductor wire from the GND power rail on the bread-board and short it to the metal base below the bread board and see if it cleans thing up even a little better. That metal base does add some noise to the circuit in some circumstances. Note that you need to penetrate the paint...At 200ns/div, we are getting into the noise introduced through the limitations of your layout, the bread-board & wiring. Something which would barely be there with a well designed PCB.

author: electrolust
author_rank: Unknown
timestamp: March 10, 2017, 08:32:47 am
content: Quote from: BrianHG on March 10, 2017, 04:55:43 amSo to design this for a PCB (ie choose the correct value for gate resistor), do I basically have to know the inductance of the gate trace? Which I can know from one of those PCB calculator tools? And then that's a ballpark and I would have to try different resistor values to really dial it in?Or is it the case for a circuit like this, where rise time isn't critical, that a ballpark figure is good enough and I just add (say) 5% to account for uncertainty in the inductance value and resistor tolerance?

author: electrolust
author_rank: Unknown
timestamp: March 10, 2017, 08:36:36 am
content: Quote from: BrianHG on March 10, 2017, 04:55:43 amI did, except I didn't do the with/without LED comparison. I'll do that next and then try grounding to the bread-board base. I guess that would be trying to use the bread-board as a shield?

author: electrolust
author_rank: Unknown
timestamp: March 10, 2017, 08:52:40 am
content: Quote from: MagicSmoker on March 10, 2017, 12:07:27 am3.3V is indeed the "everything" voltage. Why should I prefer a BJT in that case?AIUI BJT switch will consume more power (current) as I will need some Ib to keep the transistor on. Whereas with the MOSFET the transistor doesn't consume/dissipate power during the on-time, only during the transition off-on and on-off. But in that understanding I'm not considering the voltages of the switch device vs the load.As long as I am operating in the linear/ohmic region of the MOSFET (which I am; Vgs-Vth > Vds), I would have thought that I am good. What am I missing here?

author: BrianHG
author_rank: Super Contributor
timestamp: March 10, 2017, 10:22:28 am
content: Quote from: electrolust on March 10, 2017, 08:32:47 amFor a PCB, I would put a series resistor for the gate in case you do want to soften the drive, but, already looking at the vast improvement in your new scope output, you may just put in an anywhere from 0 ohm to 2k as you see fit. As for the LED, what length of wiring will you be using? You might ass a cap at the led if you don't need switch speed in the Mhz, or even Khz. This would pretty much nullify any remaining signal bounce by another 3 or more fold, so long as you PCB has proper power supply decoupling caps. At this point, such small bounce would only be of interest in analog applications, or, extra low EMI design considerations.

author: MagicSmoker
author_rank: Super Contributor
timestamp: March 10, 2017, 11:27:00 am
content: Quote from: electrolust on March 10, 2017, 02:34:54 amWait, did you wire the capacitor across the power supply near the MOSFET, or to the drain terminal (and, presumably, ground/source) of the MOSFET? I wanted you to do the former, and while the capacitor in the latter position will reduce turn-off ringing, it is also very hard on the MOSFET since every time the MOSFET turns on it effectively shorts out the capacitor.Quote from: electrolust on March 10, 2017, 08:52:40 amYes, a BJT requires continuous base current to remain on, but since you are switching ~20mA max (actually, not even that much - see below) and the typical current gain of (Beta) of a small signal BJT is around 100, this means you'll need about 200uA of base current or so.The reason why a BJT is preferred here is because it will turn fully on with just 0.6V applied to its base, while the MOSFET's gate threshold voltage, Vg, is usually in the range of 1.5-3.0V, and it will behave more as a resistor than a switch until at least 5V is applied to its gate. You might think that is a bonus in your application as it theoretically saves the need for a current limiting resistor for the LED, but another problem is that Vg varies quite a bit from device to device and, worse, with temperature. Drain-source channel resistance is also a square law function of gate voltage, so when operating near the threshold region there will be huge changes in LED brightness for very small changes in either Vg or applied gate voltage.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: March 10, 2017, 05:35:18 pm
content: Quote from: electrolust on March 10, 2017, 08:52:40 amIt's not enough to saturate "logic level" MOSFETs that are rated Vds > 20V or so.Lower voltage MOSFETs have higher gain, with 6-10V parts being 1.8V logic level compatible; some are available in battery-management-scale parts with Rds(on) < 1mohm!Gain quickly drops to ordinary levels as you go up in voltage. Hence there's no need to go over about 10V drive, for MOSFETs rated 30V to 2500V+."Logic level" MOSFETs, at regular voltages, are just regular devices modified for lower Vgs(th). Their performance is marginal at 5V, because Rds(on) isn't quite saturated at that level, and the lower gate voltage takes longer to cross the switching threshold. It's good enough for simple things like relays, but I don't recommend it for power switching applications.QuoteLook at it by overall efficiency: you're spending < 1/10th the current, and 0.7V, whereas the load might be dropping well over 7V. That's over 40dB power gain already!BJTs get less attractive if the load is externally powered, and internal power is limited (e.g., a battery powered device with contact closure output), or if the load current varies and isn't always at high current (in which case you're wasting all that base current for no reason, most of the time).There are some ways to arrange a circuit to deal with this, for example drawing parasite power from the load during the off state (a few uA will be nothing but leakage for most applications, but could be sufficient to keep the battery topped up), or controlling base current to keep collector voltage just barely saturated (the Darlington is a simple arrangement of this, but Vce(sat) is rather high; more creative arrangements can achieve better saturation, and with less current consumption and more speed).BJTs start looking particularly attractive at low voltages, particularly in applications that can spare the base current. Battery powered switching regulators are a good example: if it's always operating at design current output, then efficiency will be high -- you don't much care about base driving power exactly, as long as overall efficiency is good. Switch outputs from non-micropower, low voltage ( <= 3.3V) logic is also a good candidate: the BJT will save cost, switch better from the logic source, and you don't mind the base current.Low voltage and low-Vce(sat) BJTs also have improved hFE, so that you can switch them at hFE(sat) = 50 or 100 even. When you're doing this at power switching frequencies, you're mostly delivering turn-on and turn-off current -- because the base-emitter junction is charge-controlled, just like the MOSFET is. The BJT starts to look more like a leaky MOSFET with super-high gain, than a BJT!Tim

author: electrolust
author_rank: Unknown
timestamp: March 10, 2017, 06:02:10 pm
content: Quote from: MagicSmoker on March 10, 2017, 11:27:00 amI did the former, or tried to. The cap is across the power rails of the breadboard. Notright atthe FET terminals. But how close is close? There is a short jumper wire from the + power rail to the drain (and the probe attached right at the drain), and a longer but still quite short jumper wire from source to - power rail.Isn't the only difference in the 2 configurations, an inch or 2 of wire? I understand that for small bypass caps, you need them to be close to the power supply pins of the device you are bypassing, and the closer the better, but for 10uF is 1-2" of wire significant?

author: electrolust
author_rank: Unknown
timestamp: March 10, 2017, 06:12:09 pm
content: Quote from: BrianHG on March 10, 2017, 10:22:28 amI need 30-40mm of wire to the LED. It's kind of a heartbeat LED and the on time is only tens of ms, and a period >=250ms. I guess that implies hundred Khz to single Mhz switching speed. Any cap would have to be at the distal end of the LED wire (far from LED, close to PCB). I suppose, like the gate resistor, I can have a spot for it on the PCB regardless, and experiment with different values maybe ending up with 0uF.VCC -- RL-- LED -- FET -- GNDWould I put the CAP at the RLside or the FET side of the LED? (bypass to GND, not in series)

author: electrolust
author_rank: Unknown
timestamp: March 10, 2017, 06:21:11 pm
content: Quote from: T3sl4co1l on March 10, 2017, 05:35:18 pmAh ha ... got it now(plus all the other considerations)

author: electrolust
author_rank: Unknown
timestamp: March 10, 2017, 09:40:26 pm
content: Hey, for a single LED (20mA) why don't I do away with the BJT or FET altogether? My MCU can source 40mA so if I just put an appropriate resistor in line with the LED ...Sure, now I have a power dissipation concern at the MCU but at half the rated output and at 2% to 20% duty cycle I'm thinking it's probably manageable. There might be a lot of voltage drop at 20mA but as long as there is enough margin above the LED's Vf it's ok isn't it?

author: MagicSmoker
author_rank: Super Contributor
timestamp: March 10, 2017, 10:24:48 pm
content: Okay, sounds like you put the cap in the right spot. There's no problem with the LED being a few cm away - the main issue is with the >1m long wiring between MCU and MOSFET.Don't drive LEDs directly from an MCU unless you really limit the current. I know the datasheet for the MCU probably says each pin can handle 20mA or whatever, but take a closer look and you might find a rather low total current limit for all I/O, perhaps as low as 100mA. An even worse sin, though, is to connect an MCU pin directly to the outside world without any sort of protection against static discharge, picking up/radiating EMI, etc. So, just don't do it.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: March 10, 2017, 10:51:26 pm
content: MCUs driving LEDs is fine if:- Total supply current is observed. Usually something like 10-20mA per pin, and a total of 100mA per IO bank, so 5 or 10 painfully bright LEDs. Or double that, if you use half the LEDs to GND (uses the pin's high side PMOS) and half from VCC (low side NMOS).- LED voltage is available (i.e., 3.3V logic can't consistently drive green superbright, blue and white LEDs)- The LEDs aren't distant, say on cables (EMI hazard)Remember EMI works both ways. Maybe you don't personally care about EMI emission, but ambient EMI, and transients like ESD, can blow up your MCU pins, or upset operation (RFI causing protection-diode conduction is well known to upset the analog section of most MCUs).If you don't meet one or more of these conditions, then a lever shifter, logic buffer, external switch, IO expander, etc. is a good idea.A 'gold standard' example of all three options:- RS-422 transmitter(s) at the MCU. Driven by UART or SPI.- Differential transmission line, with protection and filtering (this, and the robust RS-422 channel, wins you a ton of EMI capability).- RS-422 receiver (and line terminator) at the LED board- Serdes or shift register or IO expander, with enough voltage and current capacity for all the LEDs attached.Tim

author: BrianHG
author_rank: Super Contributor
timestamp: March 11, 2017, 12:53:28 am
content: Quote from: electrolust on March 10, 2017, 06:12:09 pmThis means less than 1Khz, unless you are using a 1 watt led and attempting a strobe quicker than the sensitivity of the human eye to artificially dim it. In fact, you should be operating below 100hz.I think you circuit is fine and functional. That tiny remaining little ring you see on you scope will shrink even further off the breadboard on a normal PCB and you are measuring it is in the ns.

author: electrolust
author_rank: Unknown
timestamp: March 11, 2017, 01:56:34 am
content: Quote from: BrianHG on March 11, 2017, 12:53:28 amoh yeah. I should have said 100hz to 1Khz. I was off by a prefix (10^3). But yeah if you consider the signal itself is 4Hz, I can probably even tolerate switching speed as slow as 10s of hz. (assuming large latency is acceptable, which it is)I'll try to revisit this in a few weeks after I've got the PCB and will post final results.