The damped oscillatory waveform you see in first waveform
is fundamentally a LC resonance in system. Typically distributed
L and C in the signal path. Possible scope probe ground lead L
can aggravate. Or transmission line issues.
Northwest Engineering Solutions | Blog | Here's why impedance matching is important in a transmission line.
The PWM waveform looks like Vdd noise on the logic level output
of the PWM. Possible clock noise bleed thru as well. Eg, internal
parasitic C and common mode noise due to switching activity.
Look at spectrum to get clues as to frequency components.
When looking at noise to get worst case pk-pk put your scope on infinite
persistence and watch the sampling process aggregate noise generated.
Bypass caps critical in fine grained suppression, not all caps, for equal C,
yield same esr behaviour -
Generally supply pins both bulk and ceramic in parallel. Chip datasheets usually have
recommendations.
Regards, Dana.