# Speed of a mosfet triggered directly from the logic pin of an Attiny85?

I have a an N-Channel Mosfet soldered to an adapter board and connected to PB4 of an ATtiny85 via a solderless breadboard. The mosfet currently switches the ground leg of some other low power components, less than 50mA.

From the instant the ATtiny code decides to fire an output on PB4, how long does it take for the Mosfet to be to the full on state? Reading the spec sheet it looks like the mosfet should take 3.3nS and the Attiny should take 1.5 clock cycles (150nS at 10mhz). The internet tells me gate capacitance comes into play too, but I doubt its a simple RC calc?

I don't need to be exact I just need to make sure im in the right ball park and dont need some sort of specialized driver circuit or a different mosfet. I am trying to send a signal at a khz speeds, and am seeing like 0.03s delay for this mosfet to trigger. I just want to determine if it is an issue with my code or with the circuit.

Thanks!

• The delay time from your code to '1' arriving at the PBx output is nothing to do with the turn on time of the FET. The turn on time for the FET is all about how long it takes to charge the gate capacitance (in this case around 200pf). You need to characterize the delay and turn on separately. – Jack Creasey May 31 '18 at 19:05
• Jack Creasey, I guess I didnt phrase my question quite right. I meant to ask for the speed of the whole system (ATtiny delay + Mosfet delay). I don't know enough to know which one is more significant/controlling. Just guessing, how much capacitance do you think mosfet surface mount adapter and solderless bread board are adding to the gate capacitance? – ericnutsch May 31 '18 at 22:04
• The cycle time you quote (30ms) is almost certainly the loop time of your code. You could set up a timer in your code, and service an interrupt at whatever rate you want to achieve, that would be the most reliable way to drive the digital I/O port. The interrupt routine could be very small and only a few instructions long, you should easily get many kHz with a 10MHz clock. – Jack Creasey May 31 '18 at 22:19