Level shift circuit MCU to MOSFET
I first saw the following circuit in a TI app note many years ago.  It works well and is robust.  I have used it or variations of it in several projects (and products).







simulate this circuit &ndash; Schematic created using CircuitLab

There are a couple of things to consider:

1) This circuit inverts the drive signal.

2) R3 is added to ensure the FET drive remains OFF while the controller is in reset (i/o pin is input instead of output).

3) Value of R1 may need to drop if PWM frequency is high or if FET has large gate capacitance.

4) Add low-value resistor in series with FET gate as close to the FET as possible.  That's why it's not shown on the schematic - this gate resistor is part of the FET circuit rather than the driver.  The purpose of the resistor is to reduce or eliminate parasitic oscillation that can occur of the FET is located some distance away from the driver circuit.  This resistor value is usually fairly low - 22R to 100R.  I use 47R in most of my low-frequency (1KHz or less) PWM circuits.