I am wondering what the safe transient peak current is for an Atmel AVR output pin is. Safe meaning long term reliable operation won't damage the microcontroller.
In my specific application I am driving a STP16NF06L logic level MOSFET directly from an ATTiny85 output pin with an 8Khz PWM. Without a dedicated gate driver there is a trade off between gate current flow and heat dissipation due to switching time. The Arduino hardware specs (e.g. Uno) suggest a 20mA maximum and the Atmel datasheet suggests an absolute maximum of 40mA sink/source current for an individual IO pin. The total gate charge is 7.3 nC, so there is a transient spike in current when the gate charges and discharges. Some tutorials don't use a gate resistor (theoretical 200mA peak current!), forum posts suggest a 220 ohm gate resistor (theoretical 20mA peak current) - assuming a 25 ohms internal resistance on the pins.
I used an oscilloscope to measure voltage drop across a 100 ohm gate resistor which indicated a 25mA peak source and 30mA peak sink currents flowing for 200 nanoseconds. Look here for details.
I'd love to understand whether it is safe to expose an Atmel AVR to peak current loads >20mA for less than 200ns and should those loads be under the absolute maximum 40mA or can they be higher.