Hello all! This is my first post here, and I'm hoping to make this as detailed as possible with all of the issues I'm facing, the things I've tried, and the type of help I'm looking for. Please forgive me if any of this is either too much (useless) information, or the fact that I'm very much learning as I go starts showing through too much. I'll try to split this post up into a few different parts; if the back story isn't helpful, feel free to skip down to the TL;DR.
I've built Ben Eater's awesome
8-bit breadboard computer, with a few slight modifications. All the pieces work in isolation, but unlike Ben's version (where he uses some sort of black magic or incredible luck), I've had to make a number of modifications to ensure that unused gate inputs are tied (high or low), certain switches are debounced (the ones in his kit and the ones in his videos are different), and things like EEPROM outputs have pull-down resistors to ensure a consistent state while switching addresses. For the most part, though, most of my computer is pretty much the same as what he has designed, circuit-wise. As a brief overview, the computer consists of a clock (with auto and manual modes), a simple ALU that can add and subtract, two 8-bit input registers A and B, a program counter, a cycle counter (each instruction takes 5 cycles), a 4-bit memory address register, 16 bytes of RAM, and an output display module, all connected by an 8-bit bus. The entire computer is built out of 74LS-series ICs, and I've taken photos of my breadboard, which you can see
here. There are also
schematics for all of the modules on Ben's website.
Once all the parts are connected together, and I'm starting to try running programs with it, I start seeing lots of glitches, errors, and other problems that I'm not knowledgable or skilled enough (yet!) to resolve myself. I'm a software guy, and this is my first
real (since I was a small child playing with those 300-in-1 kits) electronics project.
The main issue I'm trying to resolve at this time is that the memory address register, which controls the address that is passed to the RAM chips, occasionally resets itself to zero while stepping through a certain instruction cycle. It does not happen every time, and occurs much less often when the register is hooked up to an oscilloscope, but when it does happen it seems to be pretty consistent, always on the same instruction and cycle. It happens on the falling edge of the clock pulse, and the symptoms look as follows: first, the rising edge of the clock pulse pulls the program counter into the memory address register (which I can see happen via the blinkenlights); next, on the falling edge of the clock pulse, the address register is cleared or reset to zero.
I have probed all parts of the 74LS173 register chip, and some screenshots of the results are in the
photo album.
There is a clear signal, activated via a push-button, that resets the computer's registers and state back to zero. It seems that sometimes, this signal is raised to around 2V when this glitch happens, which resets the register (but ONLY this register, not any of the others connected to the same signal!), despite the button not being pressed. At other times when the glitch happens, I see the Vcc pin for the register going up to ~6.3V, despite the fact that the computer is running at 5V.
Here's my main question: how do I go about debugging this kind of thing? When I see a weird signal, or Vcc doing something odd, what kind of steps should I take to try and isolate the problem? It's much easier when the domain is smaller, like when trying to debug an issue with a single module, but when the issue only happens when the entire computer is connected together, I'm presented with such a large problem space that I don't even know where to begin.
What kind of debugging methods should I employ in trying to fix these glitches? Are there some steps I can take to reduce the problem space? At the moment (as a software guy), this feels akin to me trying to debug an optimized executable, without symbols, by stepping through instruction-by-instruction. It could be done, but it would be such a monumental undertaking that it would take forever without additional tools. That's what I'm looking for here, additional tools I can use to help me debug these issues.
Beyond what's shown in the original schematics, here's what I've already done:
- Added pull-up resistors to all unused gate inputs; in many cases, I've wired all the unused inputs together, and used a single 1K or 10K resistor to pull the whole set to Vcc.
- Isolated the edge-detection RC circuit on the clock that's controlling the RAM write from the rest of the clock signal.
- Changed the auto/manual clock switching 555 timer to be using a monostable configuration, as the switch I have bounces and was causing extra clock cycles if switched at the wrong time. Similar to how the single-step manual clock switch works, the 555 timer remains active while the trigger is high (and is also debounced).
- Placed a lot of decoupling caps across the power rails, and added a huge 1000nF cap where the power comes in from the wall plug.
[li]Added pull-up/down resistors to many outputs where I needed to make sure that the value is never floating. The EEPROM outputs, for example, are all tied low to make sure that they don't float while the EEPROMs switch addresses.
[/li][/list]
Are there other common things I should try? The computer is powered by a 5V, 2A wall plug, and I'm getting roughly 4.8V on all the power rails on each breadboard. This should be enough to handle everything, as far as I can tell.
Thank you all for any help or insight you can give me! If (when) additional info is needed, please let me know!
TL;DR:I need some guidance on how to go about debugging issues in a large, complex system where all the individual parts seem to work great in isolation.