Button debounce ringing

The ringing is caused by poor layout (possibly breadboarding is the worst culprit) AND the fact that your button's switch-contact is shorting out a charged capacitor - the instantaneous current flow is (practically) tens of amps and that surge (along with poor wiring and layout creating excessive loop inductance) causes the ringing.

Try putting a 10 ohm resistor in series with each capacitor.


Pushing the button causes high dv/dt so the edge is extremely fast and depends on the scope ground lead connection how it will see the fast edge due to inductance in the probing setup. If the switch bounces, it also causes high di/dt spikes, and even if it does not, impulse from shorting the cap is like a small loop of coil that can induce magnetic field to the scope probe, and can also cause ringing due to any stray inductance and capacitance. The high di/dt can cause significant voltage in stray inductance which could cause stress for the IO pin structure, so even Atmel appnote suggests a 330 ohm series resistor to limit the discharge current (related to the reset pin, as it has no clamp diode to VCC).