Seyed Masoud Hosseini · Overview · Study log · Ideas · Transcript · RSS feed
Embedded Systems, 6502 breadboard computer · Lecture 8 of 29 · 28:43
Why build an entire computer on breadboards?
Study guide
What this lecture covers
This side lecture in the 6502 breadboard computer series steps back from wiring to ask why build on breadboards at all, and what physical limitations that choice brings. It compares cheap and high-quality breadboards under the hood, then explains how stray capacitance and inductance in any real circuit (breadboard or otherwise) distort fast-changing signals.
The second half applies that theory directly to the project: since a square wave is really a sum of many sine-wave frequencies, meeting the 6502's clock rise/fall time spec at 1MHz turns out to be a serious constraint. Switching from the slow manual clock module to a real 1MHz crystal oscillator finally reveals a real bug: the LCD can't keep up, exposing the need to check its busy flag before sending each instruction, which becomes the subject of the next video.
Key ideas
- Breadboard contact quality: the metal strips inside a breadboard that grip inserted wires vary a lot in springiness and shape between cheap and high-quality breadboards, directly affecting connection reliability.
- Stray capacitance: any two nearby conductors, including breadboard wires, form an unintentional capacitor that resists voltage changes; decoupling capacitors near each chip's power pins help stabilize supply voltage.
- Stray inductance: current flowing through a wire creates a magnetic field, and a changing magnetic field induces a voltage that resists changes in current, another effect that becomes significant at high switching speeds.
- Square waves as sums of sine waves: a true square wave is the sum of an infinite series of odd-multiple sine waves of decreasing amplitude; approximating it well at a given fundamental frequency requires components at much higher frequencies.
- Rise/fall time spec: the 6502 datasheet requires the clock signal to transition between high and low within 5 nanoseconds, a requirement that implicitly demands clean signal behavior well above 100MHz.
- High vs. low logic thresholds: a signal only needs to cross from below about 1.5V to above about 3.5V (not the full 0-5V swing) within the timing window to count as a valid transition, relaxing the effective bandwidth requirement somewhat.
- LCD busy flag: the LCD controller's datasheet warns that a new instruction should only be sent after checking that the busy flag is clear, something the earlier slow manual clock made unnecessary but a fast 1MHz clock does not.
Walkthrough
Comparing breadboard quality (1:00)
The lecture opens the housing on both a cheap and a high-quality breadboard to compare the metal contact strips directly, showing that the cheaper breadboard's contacts are less springy, less consistently shaped, and more prone to bending out of shape and losing contact quality over time.
Stray capacitance and decoupling (4:02)
Any two nearby wires act like an unintentional capacitor. The lecture explains how this resists changes in voltage, why that's actually useful on power rails (adding 0.1 microfarad capacitors near each chip stabilizes supply voltage), and why it's a problem for fast-changing signal lines.
Stray inductance (7:03)
Using a hand-cranked generator as a physical demonstration, the lecture shows how a changing magnetic field induces voltage in a wire, explaining that current-carrying wires in the breadboard behave similarly and resist rapid current changes.
Measuring signal degradation at increasing frequency (9:04)
An oscilloscope and signal generator send a sine wave through a chain of breadboard connections. As frequency rises from 1kHz toward 20MHz, the output signal shows increasing phase shift and attenuation, and a frequency response sweep confirms that both effects grow sharply above a few megahertz.
Why a square wave needs very high frequencies (13:08)
Using a graphing tool, the lecture builds up a 1MHz square wave by summing increasing numbers of odd-harmonic sine waves, showing that a sharp square edge requires frequency components well above 100MHz, which explains why real square waves in a breadboard circuit can't have perfectly steep edges.
Checking the 6502's rise/fall time spec against reality (16:11)
The datasheet's 5-nanosecond rise/fall time requirement is checked against the model, showing that meeting it in the strictest sense would require frequency content up to roughly 100MHz+, though the more relaxed high/low voltage thresholds make the true requirement somewhat less extreme.
Measuring the real clock signal (20:16)
A 1MHz crystal oscillator replaces the manual clock module. Measured directly at the oscillator and again after reaching the processor through the breadboard wiring, the signal's rise time stays well within spec, encouraging news for the build, aided by short, direct wiring and high-quality breadboards.
Discovering the LCD timing bug (25:19)
With the faster clock connected, the "Hello world" program stops working correctly: the LCD initializes but doesn't display text. Revisiting the LCD datasheet reveals the busy-flag warning that was previously safe to ignore at slow clock speeds but now causes instructions to be sent before the LCD has finished processing the previous one.
Before you watch
- Watch the earlier parts of the 6502 series, especially the LCD wiring and instruction-sending code, since this video's bug directly involves that code running too fast.
- Basic familiarity with sine waves, frequency, and oscilloscope readings is helpful for the signal integrity sections, though the lecture explains the concepts as it goes.
Check your understanding
- Why do two nearby wires in a breadboard behave like an unintended capacitor, and why does that matter for the 6502's clock signal?
- Why does producing a clean square wave require frequency components far higher than the wave's fundamental frequency?
- What did switching to the 1MHz crystal oscillator reveal about the LCD that wasn't a problem with the slower manual clock?
- What is the LCD's busy flag, and what does the datasheet say about checking it before sending a new instruction?
- Why might a signal not need to swing the full 0V to 5V range to still count as a valid high/low transition within the timing spec?
Chapters
- 0:00 Why build on breadboards?
- 1:06 Breadboard quality issues
- 3:48 Capacitance and stability
- 7:43 High-frequency effects
- 12:33 Square waves and harmonics
- 15:00 Clock timing requirements
- 20:40 Measuring the clock signal
- 24:41 Fixing the LCD speed
From the YouTube description
More on breadboards: https://www.eater.net/breadboards
More on the 6502 project: https://www.eater.net/6502
Here are the graphing calculator models if you'd like to play with them:
https://www.desmos.com/calculator/txls6jc88c
https://www.desmos.com/calculator/i75gnzi3jb
Support these videos on Patreon: https://www.patreon.com/beneater or https://eater.net/support for other ways to support.
------------------
Social media:
Website: https://www.eater.net
Twitter: https://x.com/beneater
Patreon: https://patreon.com/beneater
Reddit: https://www.reddit.com/r/beneater
Special thanks to these supporters for making this video possible:
Adam Lininger, Adrien Friggeri, Alexander Wendland, Andrew Miller, Andrew R. Whalley, Anthony Cuccia, Armin Brauns, Ben Dyson, Ben Kamens, Ben Williams, Bill Cooksey, Bouke Groenescheij, Bradley Pirtle, Bryan Brickman, Carlos Ambrozak, Charles Haseltine, Christopher Blackmon, Clayton Parker Coleman, Daniel Jeppsson, Daniel Struthers, Daniel Tang, Dave Walter, David Boardman, David Brown, David Clark, David H. Friedman, David House, David Sastre Medina, David Turner, Dean Winger, Dirk Lentzen, Dmitry Guyvoronsky, Dušan Dželebdžić, Dzevad Trumic, Eric Brummer, Eric Busalacchi, Eric Dynowski, Eric Twilegar, Erik Broeders, Eugene Bulkin, fxshlein , George Miroshnykov, Harry McDow, HaykH , Hidde de Jong, Ian Tait, Ingo Eble, Ivan Sorokin, Jason DeStefano, Jason Specland, JavaXP , Jay Binks, Jayne Gabriele, Jeremy A., Jeremy Wise, Joel Jakobsson, Joel Messerli, Joel Miller, John Fenwick, John Meade, Jon Dugan, Jordan Scales, Joshua King, Kefen , Kent Collins, Koreo , Lambda GPU Workstations, Lucas Nestor, Lukasz Pacholik, Maksym Zavershynskyi, Marcus Classon, Martin Roth, Mats Fredriksson, Matt Alexander, Matteo Mohr, Matthäus Pawelczyk, Michael , Michael Burke, Michael Garland, Michael Tedder, Miguel Ríos, Nicholas Counts, Örn Arnarson, Örper Forilan, Paul Pluzhnikov, Paul Randal, Pete Dietl, Philip Hofstetter, Randy True, Ric King, Richard Wells, Rob Bruno, Robert Butler, Robert Diaz, Sachin Chitale, Sam Rose, Sam Soffes, Scott , Sergey Ten, SonOfSofaman , Stefan Nesinger, Stefanus Du Toit, Stephen Riley, Stephen Smithstone, Steve Jones, Steve Gorman, Steven Pequeno, Tom Burns, Vladimir Kanazir, Warren Miller, xisente , Ziggy L
← Part 7: Subroutine calls, now with RAM · How assembly language loops work →
