For example, although 10uF would be better. Be careful to what you connect PWR_FLAG to, you don't want to inject any noises there.
In the pcb, put the VDDA capacitors near the pin. Ideally few mm away at most.
Also, it's better to add a small capacitor when reading voltage coming from a resistor.
This is because when the ADC samples the pin, the sample-and-hold circuit charges an internal capacitor and then disconnects the pin.
That time is usually adjustable, called sample or adquisition time. The higher the input inpedance, the higher the time you need to wait.
The internal capacitor is usually in the 5-10pF range. Seems low, right? But if the sample time is too low, the resistor might not let it charge completely, and your reading will be wrong.
Ex, if TH1 is 5K, to completely charge 10pF you need about 250nS. If it's 10K, it will be 500nS.
Doesn't seem a lot, but you need to know that when designing the analog frontend.
Depending in the application you might have issues. A small capacitor, ex. 100pF close to the ADC pin help to compensate this.
What's the PWM frequency? Driving mosfets that way is usually ok for low frequencies, but in the best scenario, not more than few KHz.
Depending on the gate capacitance, you might end making a RC integrator.
What happens next is that instead fully turning the fet on and off, the gate remains charged at a intermediate voltage.
That is very dangerous because the mosfet can work in the ohmic region (work as a resistor) and overheat very quickly. Also the load won't get perfectly controlled.
You can see the effect yourself, run the PWM at 50% and 500Hz, then start increasing the frequency in ex. 500Hz steps (Don't put load in the transistor) and keep watching the signal before and after R4.
As you rise the PWM frequency, it will start looking like this:
As you see the voltage is not reaching zero, also the rising and falling times are terrible, so the transistor will start to heat up if there was load.
If you keep increasing the frequency it will get worse and worse:
Now the transistor is probably turned on all the time!
Your load is out of control, and if the transistor is in the ohmic region and the flowing current high enough, it will overheat and fail in no time.