Awhile back I built a version of Ben Eaters 8 bit computer, on my build, I changed only AND, NOT, and OR gates to all NAND. Otherwise the design was exact. I tested it before touching it and found that it does still work. I've made a modification to the RAM by adding an Arduino nano and 2 595 shift registers so that I can program the computer at the push of a button. That all works. The program is successfully loaded into RAM from the Arduino. However the computer itself seems to have an issue now as the same code that worked before, will not work. I have noticed 2 problems:
- The program counter, despite being disabled (shown by the multimeter below) will still count on occasion when it shouldn't. However it is consistent, on my test program it will about 90% of the time count on the first clock cycle(which it should not), then again on the 2nd clock cycle, which it should and does.
- The output 7 segment displays will output a random number from time to time, seemingly to be just before it switches to a different number, however not every time. The random number also does not show up anywhere else, whether on the bus, in the memory, or any of the registers.
The problem I am focused on here is the counter, but I am unsure if the two problems might stem from a common issue.
The counter IC is a 74ls161
What I have tried:
- The most obvious being checking if the chip is enabled at the correct time to check if its a control logic issue. Based on the multimeter it is only being enable when it should be.
- The chip is not being loaded, the only time it should ever get loaded is when jump instruction occurs of which there are none in my test program, this is double checked with a multimeter as well.
- Trying to fix any loose wires and shorts, if there is one causing it, I havn't found it yet
- I have removed the counter from the computer and tested it on its own, and seems to work just fine
- I have tried switching out an EEPROM I thought to be iffy, as it would seem to "turn off" to the touch, however I believe this to have been some sort of short, as it doesn't have that issue now. However I cant be 100% sure that was the case.
- Lastly I have looked in the assembly test code for any patterns, but the issues happen a couple times during the test run and not one instruction is used more than once. But it typically happens during the very first microcode instruction, which is consistent for every assembly instruction (Outputting the counter to the bus and the memory address register receiving it).
I will check back frequently and try and be as active as I can on here around work, let me know if you need any more information!
Description of photos, since I don't see the captions showing up
- Step 0, the computer has the program uploaded and was just reset(minus the RAM of course) **Notice the CE (count enable) control LED (bottom right) is not lit up (its hard to tell from photo, but it isn't), meaning it should not count on the next clock. Confirmed by multimeter
- The Counter (top right, green LEDs, counted, despite being disabled. It is NOW enabled both confirmed by the CE light and multimeter)
- Again the counter was incremented, this time it should have, but now we will miss a whole memory address
Step 0, the computer has the program uploaded and was just reset(minus the RAM of course) **Notice the CE (count enable) control LED (bottom right) is not lit up (its hard to tell from photo, but it isn't), meaning it should not count on the next clock. Confirmed by multimeter The Counter (top right, green LEDs, counted, despite being disabled. It is NOW enabled both confirmed by the CE light and multimeter) Again the counter was incrimented, this time it should have, but now we will miss a whole memory address
-
1\$\begingroup\$ I see very few decoupling capacitors in your setup -- maybe one or two per power strip. If you're using mostly LSTTL, that isn't nearly enough. Back in the day, even when using a proper PCB, we would typically have close to one capacitor per chip. Furthermore, if you are driving LEDs with signals that are also going to other logic, you are seriously compromising your noise margins on those signals. \$\endgroup\$Dave Tweed– Dave Tweed2020年05月09日 01:19:46 +00:00Commented May 9, 2020 at 1:19
-
\$\begingroup\$ Yeah, thats very true. My next project is gonna be utilizing breadboards to a much lesser extent. I will keep that in mind for the next one. However this computer did work before though, I did pull the arduino out to see maybe the arduino is drawing too much, but it didnt make a difference. \$\endgroup\$dka13– dka132020年05月09日 01:30:18 +00:00Commented May 9, 2020 at 1:30
2 Answers 2
Get leaded 0.1uF caps, spread the leads out, and insert them from pin 7(GND) to pin 14(VDD) over the top of each IC.
You have made physical changes, and inductances that were LOW ENOUGH prior to changes, may not be low enough now.
Another risk is the lack of GROUND GRID.
============================================
back at university I implemented a 70-TTL-IC tic-tac-toe machine.
Knowing little of EMI, and not yet concerned with V = L * dI/dT, I had seen professional implementation of large IC systems using wire-wrap (Augat) boards that provided solid GND and solid VDD planes (punctured by thousands of wirewrap pins).
Having no budget for such niceties, I merely included X+Y ground wires (and X_only VDD wires), soldered at each X+Y at every crossing.
These X+Y parallel wires (5 for X and 18 for Y direction), soldered at each opportunity (4 * 17 = 68 nodes) were a fine GROUND GRID and ensured the 5 nanosecond TTL edges were always within 0.1 inch of a return_ground_wire.
With 0.1uF bypass caps across each of the 70 ICs (typically pin 14 to GND grid), there were no debugging issues.
-
1\$\begingroup\$ Whats a ground grid? \$\endgroup\$dka13– dka132020年05月09日 18:02:42 +00:00Commented May 9, 2020 at 18:02
-
\$\begingroup\$ @dka13 A network for ground that runs everywhere. If it's a solid sheet of copper it is a groundplane. If it's a wiremesh, it is a ground grid. \$\endgroup\$DKNguyen– DKNguyen2020年05月10日 06:39:34 +00:00Commented May 10, 2020 at 6:39
-
\$\begingroup\$ For anyone looking at this later, I am accepting this as solution as it seems most likely my problem. If I find something else that I screwed up thats causing the problem I will come back and change the answer \$\endgroup\$dka13– dka132020年05月10日 18:32:50 +00:00Commented May 10, 2020 at 18:32
-
\$\begingroup\$
always within 0.1 inch of a return_ground_wire
no way - make that one inch. \$\endgroup\$greybeard– greybeard2024年11月14日 03:42:58 +00:00Commented Nov 14, 2024 at 3:42
Everyone seems to be putting these breadboards on a piece of wood. They should be installed on a piece of copper or stainless steel that will act as a ground plane. Then it's rather easy to put short wire jumpers from each GND bus on a breadboard to the ground plane. There should be 3-4 such wires in parallel, spread throughout the length of each ground bus.
This ensures that most signals will be routed within 0.5" of the ground plane. Ground returns from each chip will be at most a couple of inches long till they reach the ground plane, if you follow the straight wire from pin 7 to ground bus, and then the length of the ground bus to the nearest jumper to ground plane, and finally the length of that jumper.
I have found that to work also for more sensitive analog circuits.
If someone asked me to build a large digital computer on breadboards, I'd have used both a ground plane and a power plane. The ground plane would be on top of the power plane and would have laser-marked positioning guides for the breadboards, and laser cut holes for access to the power plane (lots of them). The power plane can be mechanically attached to the bottom of the ground plane in many ways. I would shy away from double-sided foam tape since it tends to badly disintegrate over time. I'd probably order a laser-cut piece of balsa, since it can resist soldering heat to an extent, and use spray adhesive to laminate that sandwich.
In terms of EMI and ground/supply noise, such a "sandwich plane" beats most breadboard layouts I have seen. Getting the three sheets (two metal, one balsa) laser cut and shipped is less than 100ドル total from China. A big performance win for the price paid.
I'd have also used CD4000 series chips since they are more docile, EMI-wise, than TTL, and they are more representative of modern digital logic. Their speed depends a lot on the supply voltage, and at 3V they sip power but are slow and produce little EMI, whereas at 12V they are more power hungry during switching, but also the fastest they can be - and can be heard on the radio :)
Oh, 4000-series CMOS also consumes next to no power when the clock isn't ticking. At a low enough clock speed, you could run the whole computer on a 9V battery for a couple hours, as long as high-efficiency LEDs were used, set to run on about 0.1mA each. The LEDs would be still consuming most of the power then, not the logic, when constrained to the load limit on a 9V battery that is about 30mA.
That's not the case with TTL at all - the whole thing probably idles at 10W or so. And will not run happily from anything but 5V. Whereas CD4000 runs well on unregulated supplies. Usually, for CD4000 CMOS you can remove the 7805 regulator and run the logic directly on the output of the bulk filter capacitor that was feeding the 7805, since that would be 10-12VDC maximum. A Ben Eater-design computer build with CD4000 logic runs well from a 3.7V 350mA e-trash Nokia phone power supply :)
Unfortunately, 4000-series chips don't have some of the higher integration functions like bidirectional buffers and ALUs and such that you get with TTL. So you need more of them relative to TTL chip counts. Win some, lose some. Engineering is all about tradeoffs.
Explore related questions
See similar questions with these tags.