Sigh. Another bad Ben Eater thing.
The way this works:
- Initially, with the switch open the cap is discharged through R1 and R2 and is at 5V on its input and output.
- Close the switch. The discharged cap is instantly brought to ground. This brings the right side - the output - to ground as well.
- While the switch is still closed, the cap charges up through the 680 ohm to the supply voltage. The charge-up time is 1.1RC, or about 750ns. This forms the write pulse.
Now, here's yet another reason why Ben Eater videos are such dumpster fires:
- When the switch opens, the 1k pulls up the left side of the cap rapidly. Meanwhile, the right side - the output - goes over 7V, then discharges back to 5V through the 680 and 1k.
Guess what? You just fried your chip (or if you hit it enough times with that positive spike, you eventually will.) Why? 7V (Vcc + 2.0V) is the Absolute Maximum Rating for any I/O on this chip, and this circuit exceeds that. Further, the Recommended Operating Conditions states that Vi(h) should be Vcc + 0.3V maximum.
What these limits mean is that the chip manufacturer doesn't want the ESD protection diodes to come into play unless, you know, the chip is in need of protecting from an actual ESD event. If you exceed these limits intentionally it’s on you.
Here's something that won't do that (simulate it here):
The diode clamps the positive-going voltage on button release so that it won't get to the chip and damage it.
You can argue all you want that the chip itself has protection, but it may not be enough, and when push comes to shove, the manufacturer's data sheet is the governing document. Without the catch diode this pulse gen is marginal, and out of both Absolute Maximum and Recommended spec.
Oh, and one more thing: Switch bounce. Ben got lucky with his sample (or at least what he was willing to show on video), but in the real world? They will oscillate for some milliseconds before they settle down. More here: https://www.allaboutcircuits.com/technical-articles/switch-bounce-how-to-deal-with-it/
In short, Ben Eater has shown you a bad design that stresses the chip and ignores switch behavior.
R1
, all you have is a seriesR2 + C
after the switch is opened. WithR1
, you have a parallel resistor. You still have it even when the switch is closed. \$\endgroup\$C
. Small test (which you could have done it yourself, free simulator on this site). \$\endgroup\$