drive the LED using PWM.
What kind of LED and how much current?
some MOSFET driving the LEDs
What kind of FET, and now it's not LED but LEDs?
Gate of the Mosfet
once again, what kind of FET?
waveforms captured when C2= 10uF, 25V, and others are as per the snap.
What is C2, and what do you mean by "others"?
datasheet maximum value of the C2 should be 4.7uF
I can't see a max value of 4.7uF on any cap in the datasheet. What "C2" are you talking about? C2 in Figure 4-1 can be max 22uF. Input capacitor has no maximum.
Can you please suggest if we can use 20UF for the C2 or not for such frequency.
If you want an official Microchip answer rather than fellow users you need to submit a support ticket at microchip.com/support.
The pictures seem to show the output of the PWM, but what do the output of the LDO and the 5V from USB look like?
Krunal SHahevery time if someone has to share the complete schematic of their product which is not good.
This is absurd. The only way someone can diagnose such an issue is to see all relevant schematic and layout aspects, and if you can't find the issue you may not be qualified to determine what's relevant.
Now that you've shown a tidbit of schematic, at least one issue is clear. A 6.3V ceramic capacitor is not appropriate for a 5V rail. Ceramics should be derated minimum 50% so for a 5V rail, 10V caps minimum. For higher voltage rails like 15V, I will go down to 25V caps if necessary, but not less. 4.7uF 0603 35V caps are readily available, and a 4.7uF 0603 6.3V cap is really just 1.5uF due to capacitance-voltage derating. A 35V version will be about 2.5uF.