23
Driving a logic level MOSFET with an ATtiny 3224
(thelemmy.club)
For questions about component-level electronic circuits, tools and equipment.
1: Be nice.
2: Be on-topic (eg: Electronic, not electrical).
3: No commercial stuff, buying, selling or valuations.
4: Be safe.
The ATtiny datasheet has a lot of useful information about power dissipation for its IO pins. The input capacitance of your MOSFET gate seems to negligibly effect the power usage compared to the 30 Ohm gate resistance. At 5.5V that's 183mA and above the 100mA supply limit, so you'd only actually need a minimum of a 25 Ohm resistor (+30Ohm gate) in series to lower it under 100mA (plus maybe add a heatsink depending on your duty cycle).
If you can handle supplying 100mA, then you'd get roughly a 60ns rise time based on the 1nF capacitance, which should be plenty fast for switching anything under 100kHz. This scales linearly, so selecting a resistance to target 10mA would give you a 600ns rise time (thus lowering the switching frequency you can hit before overheating the MOSFET).
I'm bumping against the edges of my ignorance here. I haven't done any calculations yet. I've been reading the DC/DC Book of Knowledge by Steve Roberts.
I've got a working 5V switch mode supply using a driver ic for the ATtiny. Plan is to use that supply and the ATtiny to variably control a larger inductor/MOSFETs. This will power a resistive load around 25w max, 14.5w typical, 1.6ohm so roughly 4V/3A typical.
The data sheet gives an absolute maximum of 40mA for output on a pin with 5-10mA being ideal. My understanding of the chart above is that the voltage will also sag below the 4.5V gate actiivation. I'm assuming trying to switch the MOSFETs with just the ATtiny either leads to a blown output or an overheated MOSFET.
I guess I need to figure out my target frequency and work backwards from there. I've got a working reference circut, but all the ICs and MOSFETs have been laser obufuscated. Inductor is 1.5uH and 27A.
So I'm assuming I need a higher frequency than what I can push with the ATtiny but I don't know that.
Sorry for the novel. Writing this down helps me work the problem. Do you see anyrhing wrong in my assumptions/reasoning?
Ah okay, I read a stat for max total current on a pin group, but I guess the single pin current is lower.
If you have a capacitor on your supply pin, it should reduce fluctuations due to changing outputs, but I found the stat you're talking about: At 5.0V supply a 15mA load only guarantees 4.0V.
So for it to be reliable you'll need to use another driver in-between. A single smaller transistor with a fast switching time and low voltage drop when saturated/on would be able to multiply that 5-10mA up to the 100mA you might want, and stay above the 4.5V threshold. You can probably find something within 0.4V.
In terms of switching time, I think the main thing is just picking a frequency outside the audible range, so something like 30kHz or above would work. You can probably figure out your own tradeoffs going to a higher frequency. I think the main benefit is you can use smaller capacitors and get less ripple on the output, but it makes the switching control harder to get right.