I have an STM32 MCU at home. I was thinking of controlling a load with this MCU and a MOSFET. Let's assume this is my circuit:
In this circuit, we use a resistor (R2) to discharge the gate of the MOSFET. Now let's look at the structure of the GPIO inside the STM32. Here is an image:
As you can see, there is an NMOS that when we change the output control to 0, the MCU will turn it on to connect the line to the ground. Now the question is: why should I use a resistor to discharge the capacitor of the MOSFET when there is an NMOS that can do it? Do I always need to put this resistor in?