DRAIN connected to 5V??? Shouldn't DRAIN be connected to load and SOURCE to 5V??? I'm sooo confused now....
Can you give a bit more information on how you got these numbers and why these components have to be used? I want to learn, not only implement and forget it
First the PMOSFET gate resistor. That is a gate stopper which discourages the PMOSFET from oscillating of its own accord, typically from 50kHz to 20MHz. The gate stopper plays no part in the fundamental operation of the circuit.
The gate of a MOSFET only requires voltage to control the drain current, so it follows that to turn the PMOSFET on and off fast, you need to have a fast voltage change between its gate and source. But the PMOSFET has a large real and virtual capacitance between its gate and source, so to generate a fast signal at the PMOSFET gate you need to charge the gate capacitance up and down fast, and that requires current, the more current the faster.
But there is a further complication with the gate of the PMOSFET. It only turns off at 4V2 so the MCU driving the PMOSFET gate cannot provide much current to discharge the gate capacitor and turn the NMOSFET off. This is where the pull up resistor comes into play: it discharges the gate capacitor to 5V and turns the NMOSFET off relatively fast.
When it comes to turning the PMOSFET on, the MCU has plenty of voltage swing, probably down to 0.5V. The PMOSFET, thus turns on at 4V2, but the MCU carries on down to 500mV which provides a large drive to charge the PMOSFET gate capacitance and turn the PMOSFET on fast.
Moving on to the drain of the PMOSFET. As stated, the PMOSFET has a nice big turn on gate drive so there will be bucket loads of current pouring out of its drain. That current will turn LEDs on and charge up capacitances as fast as hell.
But, when the PMOSFET is turned off (even fast) everything on its drain is just left hanging in space with no discharge path to 0V: the drain pull-down resistor provides that discharge path.
How were the particular values chosen: by precedent and compromise. The gate stopper was by precedent and compromise- I know that a resistor of around 10R to 1K is OK for gate stopping, and would normally have chosen 100R, but 100R would have slowed the PMOSFET gate drive too much, so I went for 22R as a compromise.
The pull-up resistor was also chosen by compromise. On one hand I wanted it to have a low value for fast PMOSFET turn-off, but on the other hand the minimum value was limited by the current sink capacity of the MCU.
The pull down resistor was also chosen by a compromise between speed (low value) and limiting wasted current (high value).
In general, for speed you need to charge and discharge capacitance fast, and to do that you need to source and sink high currents. To illustrate this, there are MOSFET gate driver chips which can swing 15V and source and sink 9A (see link below).
And finally, design in any field, is very much about optimizing compromises.
Sadly, I can't add not SMD components, I only have max 4mm above PCB.
OK, use SM, but 1uF if you can.
P.S. low side of the LEDs will be PWM with TLC59116, it has constant current limit, so no need for external resistors, don't know if that makes any different...
No- it will be fine, but be sure to fit the decoupling capacitor.
http://www.ti.com/lit/ds/symlink/ucc27321.pdf