In this PWM out put waveform (whic is collected from pin PWM0 of a PIC18F4431) there is a 0.2 volt drop below zero in the pwm output waveform. In the output waveform of the PWM I see that there is a +5v rise during ON period. But also there is a -0.2 volt fall during OFF period. Whts the reason behind this.
We need to see the schematic to be sure but the most likely reasons are your oscilloscope probes are not compensated properly or your ground reference (ground probe) is not at the same potential as the PWM0 pin. The PIC itself can not produce a negative voltage.
That isn't ground bounce. If the diagram in post 5 is accurate, I would expect some voltage drop along the ground connection between the bridge driver and the PIC. That would imply the scope wasnt measuring the signal levels produced by the PIC, it was starting from a base level already 0.2V below VSS.
The question I always ask:
Are these waveforms simulated, or are they real oscilloscope waveforms from an actual circuit?
To me, these look like they are simulated. In which case, the reasons for this negative voltage are completely different from the reasons of an actual circuit.
Maybe whoever made the macromodel for the PIC
used the min rated voltage level and voltage source
(or "assign") drive, rather than a "switch" output
structure (my preference for a CMOS part).
Be sure that the macromodel properties don't
include a "VOL" that happens to be defaulted
wrong. Do not assume that unloaded VOL=AVSS
and so on. Might test that, static, in another
simulation testbench.