8bit CPU project had problems - ***SOLVED*** - Page 1
Forum section: electronics / projects

author: PauloConstantino
author_rank: Regular Contributor
timestamp: June 01, 2017, 07:16:28 am
content: Hi there. I have built a CPU on breadboards, and I been testing the design to see how everything works. All was working fine until today I had a strange bug.I am still using a manual clock to test each instruction. A problem happened today that if I try to execute the instructions "too quick" with the manual clock, that is, maybe 2 cycles per second, then the instructions start to go crazy. If I go slowly with the manual clock, they execute fine. I have a few bypass capacitors here and there (100nF), but not at every IC or ROMS/RAMS. What could this problem be? Could it be that I need one bypass capacitor per IC? Could this be voltage swing problems? My power supply is a good one.Any ideas?********Problem SOLVED********

author: Zero999
author_rank: Super Contributor
timestamp: June 01, 2017, 07:52:07 am
content: Of course you need decoupling capacitors with a low frequency clock, which will still have fast rise/fall times, thus still have high frequency components in the multi-GHz range.

author: PauloConstantino
author_rank: Regular Contributor
timestamp: June 01, 2017, 07:55:03 am
content: Why does it work when I go very slowly in the manual clock then? The difference is 2 cycles per second between working and not.

author: tautech
author_rank: Super Contributor
timestamp: June 01, 2017, 07:59:09 am
content: Scope the power pin on the IC and its output too.

author: DaJMasta
author_rank: Super Contributor
timestamp: June 01, 2017, 08:00:07 am
content: Could there be some questionable grounding that's making what logic high and low really are? Maybe floating inputs?Maybe there's a big cap on a data pin by mistake or an output that has too much current draw and is being pulled down to be ambiguous?It's an odd problem, but if I'm remembering right and this is the CPU core built up on solderless breadboards.... it would be VERY easy for a loose connection or a mismatched wire somewhere in there to create this kind of problem.

author: mikerj
author_rank: Super Contributor
timestamp: June 01, 2017, 08:09:09 am
content: Quote from: PauloConstantino on June 01, 2017, 07:55:03 amHow are you generating this "manual" clock?

author: PauloConstantino
author_rank: Regular Contributor
timestamp: June 01, 2017, 08:10:01 am
content: Quote from: mikerj on June 01, 2017, 08:09:09 amA set/reset latch, why ?

author: PauloConstantino
author_rank: Regular Contributor
timestamp: June 01, 2017, 08:12:27 am
content: Quote from: DaJMasta on June 01, 2017, 08:00:07 amIt's odd because when I go very slowly on the clock it works, but if I accelerate a little it bugs. There's no loose wire. No cap on data pins. I am going nuts here

author: MK14
author_rank: Super Contributor
timestamp: June 01, 2017, 09:09:50 am
content: Quote from: PauloConstantino on June 01, 2017, 08:12:27 amHave you tried to build something, way, way too big for breadboards (in at least some peoples opinion) ?Have you got any unconnected inputs ?Have you mixed logic types (e.g. LS and HC), without regard to compatibility of input threshold voltages and drive current (i.e. fan in and fan out, between the relevant TTL series) requirements ?Have you missed out any decoupling capacitors and/or implemented them poorly ?Are you using breadboards, despite their huge stray capacitance, potential cross-interference, unsuitability for higher frequencies and potential loose wires/connections issues ?Are any switches (and similar) suitably debounced (where necessary, such as when going to counters) ?Are you using a suitable quality of power supply, at the correct voltage ?Are any of your displays or LEDs, overloading any TTL gates ?If you have broken any of the above and/or many other decent design rules for using TTL. Then I'm not at all surprised if it is unreliable and you get odd results, at times.

author: Ian.M
author_rank: Super Contributor
timestamp: June 01, 2017, 09:32:05 am
content: This one?Quote from: PauloConstantino on May 31, 2017, 12:09:16 amI'm surprised it works at all. Pre-made jumpers like that are almost invariably absolutely crappy (seehttps://en.wikipedia.org/wiki/The_Market_for_Lemons). The length of the jumpers is adding quite a bit of inductance. Also the inductive coupling between the power jumpers and nearby signal jumpers of a similar orientation is probably enough to cause significant glitches.

author: mikerj
author_rank: Super Contributor
timestamp: June 01, 2017, 09:33:44 am
content: Quote from: PauloConstantino on June 01, 2017, 08:10:01 amBecause if the clock wasn't clean due to contact bounce it could cause issues, but a latch should prevent this.You should fixed the lack of bypass caps before you go any further though. Even if they don't turn out to be causing this issue it will cause problems at some point.

author: PauloConstantino
author_rank: Regular Contributor
timestamp: June 01, 2017, 09:37:56 am
content: Quote from: mikerj on June 01, 2017, 09:33:44 amI added caps everywhere but it still bugsI will do some debugging later today.

author: PauloConstantino
author_rank: Regular Contributor
timestamp: June 01, 2017, 09:39:30 am
content: Quote from: Ian.M on June 01, 2017, 09:32:05 amInductance has nothing to do with why it isn't working. It's something else.

author: Ian.M
author_rank: Super Contributor
timestamp: June 01, 2017, 10:08:47 am
content: You *should* be using jumpers that are cut to length from insulated tinned solid copper wire, and formed to fit neatly, following the shortest route that doesn't block access to the chips for testing. take a look athttp://hackaday.com/2017/04/10/8-bit-breadboard-computer-is-up-to-8-hours/for inspiration.Adding decoupling (0.1uF disc ceramic) directly across each chip's power and ground pins is likely to reduce the incidence of unexpected behaviour by keeping the transient switching currents localised, but you also need a low impedance ground connection for *EVERY* logic chip to minimise ground bounce. For a breadboard project of this scale, to get that essential low impedance ground, I'd probably construct a grid of 2.5mm2bare copper wire, and connect each end of each ground bus strip to the ground grid using short tails of 22 AWG tinned copper wire wrapped round and soldered to the nearest ground grid then plugged into the bus strip. Once you've got a good ground, power distribution is less critical, as long as you minimise loop area, run individual feeds to boards with higher current consumption, and use between 10uF and 100uF bulk decoupling between the power rail and ground on each board. . . .Quote from: PauloConstantino on June 01, 2017, 09:39:30 amYou have no way of proving or demonstrating that inductive coupling isn't causing problems. Of course, if there is a bad contact somewhere, capacitive coupling could also be an issue.A glitch as short as 5ns can be expected to cause unwanted clocking of a 74HC latch or flipflop. As there is no effective ground plane, there is no way of checking signal integrity without an expensive compact differential probe, and a high bandwidth deep memory DSO.

author: PauloConstantino
author_rank: Regular Contributor
timestamp: June 01, 2017, 10:18:31 am
content: Quote from: Ian.M on June 01, 2017, 10:08:47 amThank you. I remember once I had a problem using breadboards and jumper wires, and I posted on a forum asking for help. I got dozens of people telling me that the reason my circuit was failing was because of breadboards and jumper wires, and that it would never work. The problem had nothing to do with inductance or jumpers or breadboard capacitance etc. People are quick to preach about all these issues when the problem is actually something else. I am skeptical the design is failing for these reasons. I have only a few clock wires because my design is "robust". All my signals are level signals and they can't cause unexpected clocking... It must be something else, maybe a loose contact who knows. I appreciate the help but when people start preaching about soldering, ground planes and etc for this kinda project I am skeptical.As for the ben eater computer, his computer is the very simple sap1. My cpu is quite different and much more complex.

author: Ian.M
author_rank: Super Contributor
timestamp: June 01, 2017, 10:36:36 am
content: The issue with 'birdsnest' wiring like that, is that it make it very very difficult to check the integrity of each signal at each chip.Consider that hypothetical 5ns glitch I mentioned earlier - if you treat it as a half-cycle of a sinewave, its fundamental frequency is 100MHz, and a quarterwave is about 750 mm. A wire of 10% of that length - 75mm - is about as long as can be tolerated without matched termination. You'll need a 300MHz or better scope and probe to see a 5ns glitch, and without a good (local) ground and an active probe, the additional loading of the probe will be likely to either suppress the glitch or introduce one that wasn't there previously.

author: Siwastaja
author_rank: Super Contributor
timestamp: June 01, 2017, 11:27:30 am
content: Quote from: PauloConstantino on June 01, 2017, 09:36:23 amUnfortunately, he's right, and not being rude.The reason he's replying "without knowing anything" is simple:no one in the worldhas the answer to your exact question.A circuit like this has orders of magnitudes too many unknown variables, and the operation is so chaotic that it will be seemingly random. Finding exact physical mechanisms at play, and the exact place of the failure, to answer the question "why this works/doesn't work", could take thousands of man*years, and I'm not exaggerating.This is why we have basic engineering practices, to keep impossible variables down, to be able to focus our effort to where it comes into fruition.Therefore, you really need to start from these basic lines:- Eliminate solderless breadboard- Eliminate "dupont" wire connectorsThese are both just OK for prototyping small things, since it appears that both have reliability rate of about 99% per contact. But as you can see, it goes exponentially down with increasing number of contacts. Parasitic L,C circuit elements are another issue with this style, and it's not going to work well with binary signals without serious edge rate limitation.Then, you really need to implement proper power supply bypassing. Without it, things can be very chaotic and seemingly random.Yes, it really is very surprising it seemingly seems to work at all at some operating point.No onecan give you an answer why (on what physical principle) it fails on another operating point. There are too many places it can and will go wrong.

author: PauloConstantino
author_rank: Regular Contributor
timestamp: June 01, 2017, 11:55:56 am
content: Quote from: Siwastaja on June 01, 2017, 11:27:30 amWell the only person who can really find the problem is myself. Probing the birds nest is a nightmare. Theres no prob in the logic since it works at low frequencies.Do I need termination resistors maybe? But if so, what kind of signals require it? Edge signals or level or both ?

author: DaJMasta
author_rank: Super Contributor
timestamp: June 01, 2017, 05:30:21 pm
content: It working below 2Hz does not guarantee that the logic is fine - normally even with a fair amount of stray parasitics and a fairly large layout, hundreds of kHz should be possible with modern logic families. We're not saying that breadboards aren't suitable to this type of prototyping because we're trying to be mean or because we have a problem with them, it's because there are real signal integrity issues.At this frequency, I'm willing to effectively ignore inductance and capacitance - a few dozen nH on every line and 15pF extra on every breadboard point aren't going to be the difference between 2Hz and 10Hz - but you can't ignore the connection issues. Even if you build it up and it works fine, because all of the connections are loose and susceptible to oxidization and whatnot, there is a very real potential for loose connections causing intermittent issues or other problems. As you've experienced, it's also extremely hard to troubleshoot because of how many things are in the way of you finding the spot you want to probe. I recently brought a simple project from storage and did a little update programming and I found that the headers on the board that were joined with these individual ebay connectors were dirty enough to significantly effect ADC readings on those pins, and that just by touching the cables I could get half a volt swing intermittently or more.These sorts of problems are common when you don't have things fully stuck down (soldered, crimped, screw terminals, etc.) and can cause the gamut of problems. Because everything is setup in a prototyping stage, that also means that it's extremely possible for a connection to be accidentally pulled out or replaced one row over... so even if it were working fine earlier, it's not guaranteed to continue that way.Probing power lines is a decent place to start, but instead of just saying that there isn't a problem with X, I would go back and just recheck the things suggested because even if they were fine once, they may not be now. If it were me, I would start with making sure the ground connections are solid and low impedance, then I would check to ground any floating inputs, then i would check the power rail integrity, and then I would check for loose connections by just sort of wiggling things... but there are plenty of valid places to start and check. It will simplify things greatly if you can move some of it onto a permanently wired board - a couple of breadboards worth of circuit moved onto a permanent board takes out dozens, if not more, points for potential intermittent and unexpected failures due to solderless breadboards and flying cables.By the way, you initially suspected bypass caps... if they're the cause, then you should be able to see a lot of noise on the power rails at the chip - a basic measurement from a scope should give you an idea if that's a significant portion of the problem.

author: jonovid
author_rank: Super Contributor
timestamp: June 01, 2017, 05:38:51 pm
content: Quote from: Ian.M on June 01, 2017, 09:32:05 amOMG take it one step at a time, get some of it on to a pcb.too many jumpers

author: Ian.M
author_rank: Super Contributor
timestamp: June 01, 2017, 06:16:55 pm
content: If the circuit is only TTL, I would agree there is no way that you could get the magnitude time constant needed to discriminate between a 1Hz and 2Hz clock, but the combination of the very low quiescent and input currents of SSI CMOS logic, 100nF decoupling caps and a very high resistance connection, either to an input of a gate that is missing its Vdd connection so is being powered parasitically through its internal protection diodes, or between the bus bar and the strip its Vdd pin and decoupling cap are in, could result in a large enough time constant for the observed effect.Solderless breadboards aren't *that* evil but you do have to keep your design neat, modular and testable, which means the 'birds-nest' wiring *MUST* be minimised. You need to be able to verify good continuity between each component leg and the contact strip its in, and through each jumper so should ideally have a spare unused hole in each strip (which may not be possible when working with 0.6" wide ICs).At least one logic probe capable of distinguishing between high, low and hi-Z with appropriate threshold levels and capable of detecting narrow pulses is *ESSENTIAL*. Scopes and DMMs are poor substitutes as their input impedance can pull floating CMOS inputs low enough to be seen as logic '0'. Many affordable logic analysers cannot reliably detect hi-Z signals, though a 16 channel logic analyser + a DIP16 test clip (for ease of access to all the pins of a 14 or 16 pin logic chip) is still a very useful thing to have.

author: ebclr
author_rank: Super Contributor
timestamp: June 01, 2017, 06:46:35 pm
content: If you want to increase the clock the 1st thing you need to do is to cut that spider web of jumpers you have.Buy a standard PCB like one of thoseUsing wirewrap wire mount using the shortest possible connectionsA copper plate ground plane will also help.A second path is to make the same circuit on an FPGA using the same schematics, this way you get really faster clocks

author: klaff
author_rank: Regular Contributor
timestamp: June 01, 2017, 07:26:12 pm
content: I can say with certainty that circuit would never work for long in my house. I would wake up to find a few jumpers laying in the floor, and the cat grinning at me.

author: rstofer
author_rank: Super Contributor
timestamp: June 01, 2017, 11:24:13 pm
content: One 100 nF capacitor per chip mounted as close to the pins as possible. In the old days, we could buy IC wire-wrap sockets with integral capacitors.http://www.arieselec.com/products/data/12027-open-frame-capacitor-collet-socket.htmThere are others...

author: rstofer
author_rank: Super Contributor
timestamp: June 01, 2017, 11:26:02 pm
content: You mentioned that the clock didn't go very many places. Is it safe to assume that all the registers are clocked? If you are trying to use R-S flops, you may be in for a ride. There's a reason that FPGAs implement synchronous logic and highly discourage asynchronous logic.

author: MK14
author_rank: Super Contributor
timestamp: June 02, 2017, 01:01:22 am
content: Ignoring the breadboard size/construction, for now ...I only had a quick glance at your schematic, and was trying to hint that it would seem to have a number of potential weaknesses to it.Sorry!Examples are things like...You may be trying to use 74S logic, which probably is best done on a proper PCB, with really decent layouts and probably ground planes. Because the 74S logic series are meant for very high speed/performance. Which needs more care in its constructions. Because it can easily achieve 100 MHz and very fast changing signals, compared to slower 74LS logic and many other slower types.Very fast transitioning logic, is especially problematic, on weak noisy breadboards, with significant stray capacitance (inductance etc).The 74S series needs LOTS of current to drive it, especially at the low logic level. The lower power consumption 74LS is NOT very capable of this (ignoring buffer versions). You can just about get away with driving one 74S connection with LS, and sometimes 2 (maybe more, depending on what inputs and 74 devices you are talking about).I have NOT gone through your circuit and thoroughly checked how many things are connected to what, but a quick glance worries me.You seem to have a large number of unconnected inputs. These are best properly sorted out (there are guides to help you, it varies depending on which 74 series it is), as they can easily cause incorrect/odd behavior if left like that.I.e. They can randomly toggle between 1 and 0, tending to be 1, for most of the time, usually.tl;drAlthough you are currently running it at 1 and 2 Hz, the glitches etc (because of unconnected inputs, missing decoupling capacitors, unsuitable very high speed logic, etc etc) can toggle/change the state of flip-flops, latches, Ram etc etc, and hence bite you in the foot.I.e. It might only take a few nano seconds or more, for a glitch to corrupt some kind of latch/Ram etc, even though you are clocking it at only 1 or 2 Hz.-------------------------------------------------------------------------------------------------------------------------------------Just in case others want to disagree with me here.I agree that you can probably take one 74S device and wire it up on a breadboard and it will probably work ok. But probably at a significantly lower frequency than if it was on a properly designed PCB.I also agree that a 74LS might cope with more than 1 or 2 74S inputs, in a simple circuit. Even if the datasheets disagree.But to try and make a massive/complicated computer with a huge number of 74S devices and many 74LS (and other series) ones, on a huge number of breadboards. Is not going to be the happiest of experiences as regards it working 100% reliably all of the time.

author: MK14
author_rank: Super Contributor
timestamp: June 02, 2017, 01:28:13 am
content: I found this guy, who seems to be doing similar things to yourself (OP).He has a fair amount of detail about "glitches" and things like that.https://leo1cpu.wordpress.com/tag/ttl/He goes into much detail in places (than I've had the patience/time to explain).E.g. (very approximate summery) That brief (call it 5 or 10 nano second) "mistakes" in the address decoding while the logic ripples through with the right answer. Can be long enough for the Ram to get corrupted (at the WRONG address), and how he FIXED such problems.

author: amyk
author_rank: Super Contributor
timestamp: June 02, 2017, 01:47:55 am
content: I suspect one of the ICs has its power supply completely disconnected and is getting powered not even through the ESD diodes on its inputs but pure inductive pickup from ambient electromagnetic fields; the amount of current is tiny, but enough to accumulate sufficient charge to work at extremely slow speeds, yet not slightly faster. The time scales you're seeing are roughly on this order of magnitude.Ironically, the large capacitance of breadboards may actually be helping you with that.

author: PauloConstantino
author_rank: Regular Contributor
timestamp: June 02, 2017, 04:05:18 am
content: Quote from: rstofer on June 01, 2017, 11:26:02 pmThe SR latch is only used as a manual clock generator. All my logic is synchronous

author: PauloConstantino
author_rank: Regular Contributor
timestamp: June 02, 2017, 04:08:01 am
content: Quote from: ebclr on June 01, 2017, 06:46:35 pmI have 8 high quality gold plated wirewrap boards here waiting to be used. I just wanted the prototype to work before I go to the permanent construction, but it seems the prototype will have to be cancelled

author: PauloConstantino
author_rank: Regular Contributor
timestamp: June 02, 2017, 04:13:14 am
content: Quote from: amyk on June 02, 2017, 01:47:55 amI have checked all power pins on every IC, they're all receiving power... still the problem is there.I constructed another circuit, which was a monochrome composite video generator, that reads a ROM and displays an image pixel by pixel. There are many jumper wires in it and its built on breadboards. It works fine, except that some of the pixels *sometimes* do not display, but if I pull the jumpers apart the glitches disappear.

author: PauloConstantino
author_rank: Regular Contributor
timestamp: June 02, 2017, 04:16:55 am
content: Let me see if I can describe the problem more accurately.The CPU is executing a JMP instruction. There is a ROM and a RAM. ROM is from 0x00 to 0x7F. RAM is from 0x80 to 0xFF. The CPU starts at 0x00, and there is a JMP to address 0x80. At 0x80 there is a JMP back to 0x00. The cpu was supposed to just loop there.It starts well and executes the first JMP. It has to do 3 steps (3 clock cycles) to do this. It does it very well, with all control bits shown correctly via LED's. (there are 32 control bits).Then when it gets to 0x80, it loads the JMP, and jumps back to 0x00. It does this a few times, and then it glitches, and the control bits are junk.Since it works a few times, why would it glitch afterwards? Very strange. The fast I go on the clock the faster it glitches.Here's the microcode for the FETCH routine.0x00: 00100000, 00100001, 10000001, 00001000, * PC_Out, IMMVal=0, IMMOut, ALU=1001, ALUMode=0, CarryInMux=01, MAR_Wrt, type=seq(00) *00001000, 00000000, 00000010, 00000000, * RD, IR_Wrt, type=seq (00)*00100011, 10100001, 00000001, 00001100; * PC_Out, PC_Wrt, ALU=1001, ALUMode=0, CarryInMux=01, IMM_Out, IMMVal=1, type=post-fetch(11) *and here's the microcode for the JMP instruction.0x1B: 00100000, 00100001, 10000001, 00001000, * PC_Out, MAR_Wrt, IMM_Out, IMM(0), CarryInMux1=0, CarryInMux0=1, ALUOp=1001, ALUMode=0, Next=00 *00001000, 00000000, 01000100, 00000000, * RD, MDRIn_Mux=1, MDR_Wrt, next=00 *00100010, 10100001, 00001000, 00001000; * MDR_X_Out, PC_Wrt, IMM_Out, IMM(0), ALUOp=1001, ALUMode=0, CarryInMux1=0, CarryInMux0=1, type=10(pre_fetch) *Each line is a clock cycle's worth. Each column is one byte from each of the 4 ROMS.

author: PauloConstantino
author_rank: Regular Contributor
timestamp: June 02, 2017, 04:23:24 am
content: I'm not using 74S or 74LS. As I said I am using 74HC. The schematics don't show the actual chips I'm using, they are just what was available in the eagle library. They were made for myself as a sketch to help build the CPU.The schematics have no weakness to it, as you're trying to attack my work again.The unused inputs in the schematics do not imply my actual circuit have unused inputs either. It doesn't.The problem is not one with the design as you're trying to suggest. The problem is something else.

author: rs20
author_rank: Super Contributor
timestamp: June 02, 2017, 04:24:22 am
content: Quote from: PauloConstantino on June 02, 2017, 04:05:18 amWe never really seemed to explore this in detail. What inputs are you giving to the SR latch? Do you have two pushbuttons, one going to R, the other going to S, and alternating between them to generate your clock? This is a strange, but I suppose reasonable, way of debouncing your clock input.Failing that, just about any other solution will require debouncing, even if an SR latch is somewhere in the circuit (garbage in to SR flip flop --> garbage out).

author: PauloConstantino
author_rank: Regular Contributor
timestamp: June 02, 2017, 04:26:17 am
content: Quote from: rs20 on June 02, 2017, 04:24:22 amThe SR latch has its 2 inputs pulled up by resistors. I just ground one of the inputs alternately to generate the pulses.

author: MK14
author_rank: Super Contributor
timestamp: June 02, 2017, 04:30:23 am
content: Quote from: PauloConstantino on June 02, 2017, 04:23:24 amSo you're now saying the schematic and what you have built, are significantly different!How was I to know that you have done it significantly different to the schematic ?You are also saying your setups are completely wonky and unreliable:Quote from: PauloConstantino on June 02, 2017, 04:13:14 amAnyway...74HC logic, makes a lot more sense, if you are experiencing problems going from 1 Hz to 2 Hz, because the CMOS, if there are any open connections or partial/intermittent connections, can do things like that, as the Mosfets gates (inputs) charge up and discharge, from their very high impedances.I think you are going to need a huge amount of luck to find the one or more, possible open connections, out of the thousands, in that huge birds nest of yours.

author: PauloConstantino
author_rank: Regular Contributor
timestamp: June 02, 2017, 04:32:50 am
content: Quote from: MK14 on June 02, 2017, 04:30:23 amAre you crazy or something? I didn't say they are "Significantly" different. They are the same. Please go bother someone else's posts.

author: MK14
author_rank: Super Contributor
timestamp: June 02, 2017, 04:35:41 am
content: Quote from: PauloConstantino on June 02, 2017, 04:32:50 amYes, I'm crazy.I'm so crazy, that I thought that a 74S is different to a 74HC.I'm even crazier for thinking that a schematic which shows lots of unconnected inputs, is different to one with everything connected.

author: MK14
author_rank: Super Contributor
timestamp: June 02, 2017, 05:12:36 am
content: Quote from: PauloConstantino on June 02, 2017, 04:16:55 amI did not realize you had used lots of 74HC logic. I'm pleased you have, as it is probably better overall for something like this.Now that I realize that you have, that is EXACTLY the sort of symptom, I would expect to see with CMOS logic devices. Because any open circuits (quite possible with your breadboard construction), would just be floating about in the wind. Fluctuating between 1 and 0, somewhat randomly. Even moving your hand nearby, could switch it on and off, over a period of seconds.CMOS logic is quite well known to do this.There are other fault possibilities as well. But one or more, possibly intermittent open circuits, can act like you describe.tl;drCMOS inputs, if open circuit, can randomly change state every second or so (time period can be almost anything). Similar to what you have been experiencing.

author: PauloConstantino
author_rank: Regular Contributor
timestamp: June 02, 2017, 05:29:22 am
content: Ok sorry if I was rude.I have grounded all of the unused inputs... Even if they are not part of the circuit....

author: Ian.M
author_rank: Super Contributor
timestamp: June 02, 2017, 05:33:36 am
content: Both Siwastaja and myself are *VERY* suspicious of the quality of those jumpers. Unless you've got a receipt for them from Sparkfun or other well respected 'Maker' supplier, or from a reputable major distributor, the odds are they are probably made with wire with a very low CSA and strand count, and there is a significant chance the wire may not even be copper.Cheap Chinese jumpers are often made with CCA or CCS wire or recycled low grade copper - more like a poor grade of brass - and tend to have much higher resistance than a similar copper wire should have. CCA and CCS are probably the worst as anything that breaks through the thin flash of copper plate over the Aluminum or mild steel core + even traces of moisture (not uncommon during shipping) results in rapid bimetallic corrosion, especially at the crimped terminals. All of them fatigue far more readily than copper wire and are prone to strand breakageIf you do want to keep using pre-made 'dupont' terminated stranded jumpers, they all need testing on a milliohmmeter before use, to eliminate bad ones and its also worth gently pulling on them end to end to try to eliminate 'stretchy' ones that are full of broken strands. A sample from each purchase should also be closely examined to check the ends are properly crimped (with no horror storries like the strands being folded back over the insulation then the connector roughly crushed over the lot), and CCA wire should be eliminated by destructive testing (use the flame test - CCA strands go soft and droop at a far lower temperature than copper strands), and CCS wire eliminated by testing if the strands are attracted to a magnet.However insulated 22AWG solid core tinned copper wire is dirt-cheap (just strip it from scrap Ethernet cable, but not stranded patchleads), easy to work with, doesn't have separate end pieces so eliminates two potential bad connections per wire and doesn't clutter the breadboard so much, and when its going bad, its very obvious as it becomes floppy at the break. Also the ease of cutting it to length will eliminate most of the birdsnest.

author: MK14
author_rank: Super Contributor
timestamp: June 02, 2017, 05:34:10 am
content: Quote from: PauloConstantino on June 02, 2017, 05:29:22 amGood, that should improve the reliability.With CMOS, it is especially important to ground (or logic 1) the inputs (even if unused). Because if they float towards mid-supply voltage they can cause the IC to misbehave and/or use too much current.I like 74HC logic over older 74 TTL, because they can use considerably less power and have big fan in/out figures. They are also much more available than the outgoing older 74 TTL devices, which are getting increasingly harder to get hold of. They also have nice big output voltage swings, which makes them potentially less susceptible to noise.Great for battery powered applications as well.

author: PauloConstantino
author_rank: Regular Contributor
timestamp: June 02, 2017, 05:39:11 am
content: Quote from: Ian.M on June 02, 2017, 05:33:36 amI got them from JPR. Here in the UK. They are dupont. Dunno if made in china. So I get from you that I should replace all of them with solid copper wires? In this case, I might just reconstruct everything using wirewrap boards with gold plated pins. Oh well.

author: PauloConstantino
author_rank: Regular Contributor
timestamp: June 02, 2017, 05:42:46 am
content: Quote from: Ian.M on June 02, 2017, 05:33:36 am0.7 omh each

author: MK14
author_rank: Super Contributor
timestamp: June 02, 2017, 05:47:53 am
content: Quote from: PauloConstantino on June 02, 2017, 05:42:46 amAlthough I totally agree with the advise you are being given, about possible duff or poor quality "wires". I would like to add that many (especially cheaper, ebay and hence often Chinese sourced/made) breadboards, also have bad reputations for having very bad connections.

author: tautech
author_rank: Super Contributor
timestamp: June 02, 2017, 05:54:40 am
content: Quote from: MK14 on June 02, 2017, 05:34:10 amThis ^.RTFMdatasheet. Don't tie them high or low is the standard recipe for disaster.Does nobody read datasheets these days or do they think they know better that the manufacturer.

author: Ian.M
author_rank: Super Contributor
timestamp: June 02, 2017, 06:13:37 am
content: 0.7 Ohms each is absolutely horrendous. For comparison 24AWG electrical grade copper wire has a resistance of about 0.085 Ohms per meter, and 22AWG about 0.053 Ohms per meter. As your jumpers are well under a meter long they apparently have two orders of magnitude too much resistance - I suspect that either they are total shite or your meter doesn't read low ohms very reliably.Have you got some that aren't in use, or can you pull a reasonable sample without loosing track of what you need to reconnect?As I said, test them with alow-ohmmeter, and compare with the same length of 22AWG tinned copper wire. You'll soon spot the bad ones. Most hand-geld DMMS are fairly useless for trying to measure resistances under one Ohm. If you have an ESR meter for testing caps, its Ohms scale *may* go low enough.Otherwise, if you don't have a low-ohm meter - Build one!Take a LM317 regulator and connect a 15 Ohm resistor with a 100 Ohm preset in parallel, adjusted to 12.5 Ohms total, between Out and Adj to make a 100mA current source, make up a x10 gain differential amplifier using a 5V single supply rail-to-rail OPAMP and 1% or better resistors, and make a pair of DIY Kelvin clips from clothespegs and self-adhesive copper foil.Use a stable 5V supply to power the 100mA current source, connect the current source output (Adj pin) and ground to the forcing contacts, and the x10 amplifier to the sense connections. Use a DMM on mV for the readout, directly in milliohms.If you have a precision one Ohm resistor put it in the Kelvin clips and calibrate it by adjusting the preset for a reading of 1.000V. It will read up to 2 ohms from a 5.0V supply. Don't use it for in-circuit testing of anything containing small signal semiconductors ar ICs as the internal junctions wont stand up to the forcing current.You can also make up psuedo-Kelvin probes for checking breadboard contact resistance - take some gold plated pins or offcuts of gold plated component lead thin enough not to damage the breadboard contacts, and solder two wires side by side to each, taking care not to let solder run down the pin. The protruding pin length should be just enough to fully seat in the breadboard. Insulate and protect the joint with small-bore heatshrink sleeving, then use one wire to each pin for the forcing current and the other for the sense voltage. That will measure the series resistance of two breadboard-pin contacts and the strip between them + the resistance of the pin between the wires and the contact point which should be negligible.

author: MK14
author_rank: Super Contributor
timestamp: June 02, 2017, 06:18:47 am
content: Quote from: PauloConstantino on June 02, 2017, 05:42:46 amPlease don't take offense at this question.But did you initially short together the meter probes and see what it reads ?Because some of that 0.7 Ohms could be the meter + probes resistance.

author: Muxr
author_rank: Super Contributor
timestamp: June 02, 2017, 06:26:11 am
content: You're probably dealing with multiple issues, one of which is likely chatter, like the signal is being affected by voltage droops and all that stray capacitance and inductance. As others have said, solderless breadboards and jumpers don't really scale well for big projects. Things become unmanageable real quick. They are really meant for smallish quick prototypes.Anyways, a scope can probably tell you more than we can.

author: PauloConstantino
author_rank: Regular Contributor
timestamp: June 02, 2017, 06:45:45 am
content: Quote from: MK14 on June 02, 2017, 06:18:47 amYes buddy. I think my multimeter just isnt very precise.

author: PauloConstantino
author_rank: Regular Contributor
timestamp: June 02, 2017, 06:48:02 am
content: Quote from: Muxr on June 02, 2017, 06:26:11 amMy old faithful hp 54501a scope has become uncalibrated and I'm waiting for a bnc cable to be able to calibrate it

author: PauloConstantino
author_rank: Regular Contributor
timestamp: June 02, 2017, 06:51:57 am
content: Quote from: Ian.M on June 02, 2017, 06:13:37 amI think my meter is just not precise enough. I have some other rolls of wire here, but they aren't copper. They are gray. Not sure what metal they are made of. If I want good signal integrity, does it need to be copper ?

author: PauloConstantino
author_rank: Regular Contributor
timestamp: June 02, 2017, 06:55:11 am
content: Here's a photo of the cpu, i should have uploaded it before...

author: PauloConstantino
author_rank: Regular Contributor
timestamp: June 02, 2017, 06:59:29 am
content: This is sad. I was hoping I would have a working prototype. I really trust these IC's and the breadboards and jumpers. They never let me down before. I still believe the problem is an incorrect connection or something like that. Maybe it's a bad breadboard connection. I found one before early on. I have tested all the pins on each IC though and they all have power. My teacher said he thinks there might be high capacitance on some signals and that's probably right. Going fast on the circuit even at 3Hz might add to much to the potential time constant of these signals.I suspected earlier it could be a weak 2A power supply. but I connected a bench supply to it and the same happened. The bench supply was only being drawn 300mA in any case.

author: PauloConstantino
author_rank: Regular Contributor
timestamp: June 02, 2017, 07:13:01 am
content: Ok something WEIRD just happened!I changed the input voltage from 5V to 3V and the circuit works fine.First person who tells me what's happening will get a prize.

author: MK14
author_rank: Super Contributor
timestamp: June 02, 2017, 07:13:24 am
content: Quote from: PauloConstantino on June 02, 2017, 06:59:29 am3Hz is NOTHING, when your connections are good. E.g. 100KHz should be fineBut if a connection is nearly open-circuit, and is 1,000,000 Ohms (made up hypothetical value), because the breadboard pin or jumper has gone high resistance. Then the million ohms will take perhaps a second to charge/discharge the big stray capacitance. So that would explain why it works at 1Hz, but at 3Hz it starts to get increasingly glitchy.CMOS has a huge input resistance, allowing such effects to occur. But the old 74 series, had much lower input impedances, so such effects would be much less likely to occur.But there are many other possible reasons, why it is not working out for you. This is just one of them.

author: Ian.M
author_rank: Super Contributor
timestamp: June 02, 2017, 07:19:26 am
content: When an unloaded single 74HC gate switches it pulls a current spike of about 40mA, more if there is significant capacitance on its output. If you have a significant number of gates switching at the same time with a common ground connection, even a few tenths of an Ohm extra resistance can cause serious problems. e.g. if its a MSI logic function using 10 simple gates, it could pull several times that current while switching. (Not 10 times as purely internal gates will use smaller transistors.). Take 10 such ICs without adequate decoupling right at each IC and good grounding, clock them synchronously, and you can easily get 1A peak transients in the supply and ground wiring. The combination of inductive coupling disturbing input levels and ground bounce due to excessive connection resistance and lead inductance can easily use up all your noise margin and cause other inputs that *should* be a steady level at that clock edge to glitch.The cure is local decoupling directly across the Vdd and Gnd pins of *EVERY* IC to keep the switching transient currents out of the supply rails, and a low resistance, low inductance ground, usually a ground plane to minimise ground bounce. As it isn't practical to use a ground plane with solderless breadboards*, the best you can do is a heavy copper wire grid or mesh, with each intersection soldered, running round the edge of each breadboard section with short 'pigtails' soldered to it then plugged into each end of each ground bus strip.* Unless you go to the extreme of taking an Xacto knife and cutting and stripping the self adhesive insulation strip from the back of each ground bus strip, then applying self-adhesive copper tape (with a highly conductive adhesive) over the whole back of each breadboard, or applying anisotropic conductive tape to each ground bus strip then sticking all the boards down on a tinned copper sheet.

author: PauloConstantino
author_rank: Regular Contributor
timestamp: June 02, 2017, 07:31:59 am
content: Yep, it's running at a high frequency now no problems! But the voltage is 2.6 volts. Any takes ?

author: MK14
author_rank: Super Contributor
timestamp: June 02, 2017, 07:35:39 am
content: Quote from: PauloConstantino on June 02, 2017, 07:31:59 amHow high a frequency is that ?Lower voltage for CMOS, tends to slow it down, somewhat. But I'm not sure why your problem apparently goes away at lower voltages.

author: PauloConstantino
author_rank: Regular Contributor
timestamp: June 02, 2017, 07:38:25 am
content: Quote from: MK14 on June 02, 2017, 07:35:39 amIts running now at a few kilohertz! At 2.5 volts

author: PauloConstantino
author_rank: Regular Contributor
timestamp: June 02, 2017, 07:40:23 am
content: I appreciate everyone's in depth responses.But please listen to this now.The CPU is running at a few kilohertz now with no problems. Perfect so far, but I had to set the voltage to 2.5V.If the voltage is over 3V or so, it doesn't work.Any ideas?

author: MK14
author_rank: Super Contributor
timestamp: June 02, 2017, 07:40:36 am
content: Quote from: PauloConstantino on June 02, 2017, 07:38:25 amA hopefully SILLY thought, does come to mind. You have fully used 5V supply rail, compatible components, throughout ?(not trying to be annoying, just thinking out loud).EDIT:Many components these days, are expecting lower supply voltages, such as 3.3V. When I say all components, especially things like the Ram/Flash and other things. They are harder to get in 5V form, these days.

author: Ian.M
author_rank: Super Contributor
timestamp: June 02, 2017, 07:51:51 am
content: I doubt the issue is 3.3V components - they typically operate up to 3.6V and if its failing around 3V, it more or less rules them out. Lower than 3.3V logic is almost invariably not available in DIP packages.Low voltage slows 74HC CMOS down. At 2V it will typically be a factor of five slower than at 5V, and the switching currents will be reduced by a much greater factor due to the combo of slower switching current and much higher MOSFET Rds_on due to the reduced gate drive. Transients will thus be orders of magnitude lower, and although the absolute noise margin reduces in proportion to the supply voltage, the relative noise margin will be much improved. Therefore its not unexpected for your circuit to operate better at a lower voltage.

author: PauloConstantino
author_rank: Regular Contributor
timestamp: June 02, 2017, 08:22:51 am
content: So, my RAM chip is actually from 2.7 to 3.6V.My EEPROMS are a single 5V supply rating.For some reason I thought my RAM chip operated at 5V. But it doesn't.However it's still strange because the circuit does work if the voltage is around 2.3 volts, which is lower than the RAM's minimum Vcc, and much lower than the EEPROMS Vcc.Why would this ever be

author: MK14
author_rank: Super Contributor
timestamp: June 02, 2017, 08:25:48 am
content: Quote from: PauloConstantino on June 02, 2017, 08:22:51 amWhen a datasheet says a component should be running on a supply of say 4.5V to 5.5VThey mean that is what they GUARANTEE it to work 100% of the time at, and meet ALL the datasheet specifications.But it may still work (but perhaps slower and not meeting all the other datasheet specifications), at just 2.8V (hypothetically).There is just no guarantee that it does from the manufacturer. It is best to stick to what the manufacturer recommends in their datasheets.Your Ram chip could well be the problem then ?

author: PauloConstantino
author_rank: Regular Contributor
timestamp: June 02, 2017, 08:43:45 am
content: Im not hopeful because if the RAM was the problem the circuit would operate at higher than 2.4V or so. But it doesn't.

author: MK14
author_rank: Super Contributor
timestamp: June 02, 2017, 08:46:56 am
content: Quote from: PauloConstantino on June 02, 2017, 08:35:53 amDon't worry, it is all too easy to misread a datasheet from time to time.Probably just about every hobbyist/Professional, has done it many times.If it is only rated for 3.3V, it is best to change it for a proper 5V rated RAM chip, anyway.Hopefully, you have solved your issue. If so, Congratulations!

author: PauloConstantino
author_rank: Regular Contributor
timestamp: June 02, 2017, 08:48:19 am
content: Quote from: MK14 on June 02, 2017, 08:46:56 amWould it be ok to make a voltage divider at 3V and feed it into the RAM chip ?

author: MK14
author_rank: Super Contributor
timestamp: June 02, 2017, 08:49:00 am
content: Quote from: PauloConstantino on June 02, 2017, 08:43:45 amSometimes/often, you have to go down many, many false paths. When trying to debug/fix faulty electronics. Especially when it is a custom/new design.If you have been overvoltaging the RAM chip, you may have damaged it. So that it needs lower voltages to work reliably now. Theoretically possible, but I'm NOT certain though.

author: MK14
author_rank: Super Contributor
timestamp: June 02, 2017, 08:52:46 am
content: Quote from: PauloConstantino on June 02, 2017, 08:48:19 amI also thought of that. But the problem is that its inputs must NOT see higher voltages than the supply voltage. So you would have to make sure all outputs feeding it, never go above its supply voltage.Maybe the easiest/quickest solution. Is to get and put in a 5V rated RAM chip, as that is the best thing to do anyway.Overvoltaging chips, against the datasheet specifications, is a bad idea. As it can easily break the chip. The absolute maximum ratings, will give you an idea, as to if 5V has broken it.My gut feeling is, it is well worth trying/using a proper 5V rated RAM chip, but there could easily be other things wrong with your setup. So please don't raise your hopes too high.Debugging things can be a rather unpleasant task, until you fix it! Then joy, joy, JOY!

author: grumpydoc
author_rank: Super Contributor
timestamp: June 02, 2017, 09:14:17 am
content: I'm pleased that you have got things working and are happy!However looking at the photo of your setup youdoappear to have at least some unconnected pins.I can't see, obviously, whether these are inputs or outputs but if you are using 74HC you really must make sure all unused inputs are connected to either VCC or ground.Bipolar 74 series (74xx, 74F/S/LS/ALSxx) inputs which are open circuit pretty reliably go high as it takes a fairly high current to pull the input low but HC inputs are very high impedance and tend to drift more unpredictably - they either flip rapidly from 1 to 0 or sit in the indeterminate region between logic 1 & logic 0 which means that both output FETs are conducting - this yields random oscillations and overheating chips. One unused gate doing thiswillaffect others in the same package and you will get random odd failures that you can't explain.I would also echo the comments about tidying up the wiring - if for the only reason that you can't get a 'scope probe on a pin with out having to move lots of wire aside, which may well then make or break random connections in your circuit.

author: keshab.patel
author_rank: Contributor
timestamp: June 02, 2017, 09:33:57 am
content: Never seen such a complex design/wiring on bread board.Better to make it simpler by partitioning blocks by blocks.

author: PauloConstantino
author_rank: Regular Contributor
timestamp: June 02, 2017, 09:41:26 am
content: Nope.... changed the RAM to a 5V one, but the problem still occurs.... I am very mad now!

author: tautech
author_rank: Super Contributor
timestamp: June 02, 2017, 09:44:32 am
content: Quote from: PauloConstantino on June 02, 2017, 09:41:26 amCan it for now and fix that scope.

author: PauloConstantino
author_rank: Regular Contributor
timestamp: June 02, 2017, 11:23:06 am
content: PROBLEM SOLVED !The problem actually 2 bad connections. A very small jumper connection made with a resistor lead that was going to ground on one of the address pins of my microcode proms was not connected. It was offset from the correct pin. Another jumper got disconnected somehow, inside the jumper forest, so I never saw it. I saw it today after spending a lot of time looking around and testing IC pins with a logic probe.The CPU is now running at light speed correctly without crashing. The moment I connected the bad connections it started working.HUUURAAAAAYY !!!!Like I said, I was skeptical the problem was inductive or capacitive coupling and so on.I appreciate everyone's help a lot.Stupid me. Apologize for kinda wasting your time on this. But it was very hopeless to be lost in the forest of illusion (super mario world pun intended).

author: ebclr
author_rank: Super Contributor
timestamp: June 02, 2017, 05:23:48 pm
content: You already proved, you have a very big patient, making this forest of jumpers, that even workNow go the next level of patient, and remake like this

author: grumpydoc
author_rank: Super Contributor
timestamp: June 02, 2017, 05:29:59 pm
content: Quote from: ebclr on June 02, 2017, 05:23:48 pmThe back of that must be fun

author: PauloConstantino
author_rank: Regular Contributor
timestamp: June 02, 2017, 05:37:19 pm
content: Heres a video of my cpu working:

author: MK14
author_rank: Super Contributor
timestamp: June 02, 2017, 06:51:51 pm
content: Quote from: PauloConstantino on June 02, 2017, 09:41:26 amSince you discovered that you had inadvertently put in a lower (3.3V supply voltage) one, and it was NOT working properly above around 3V. Trying the proper 5V one, was a good thing to try. But was not necessarily going to fix all problems.Quote from: PauloConstantino on June 02, 2017, 11:23:06 amDebugging/fixing things often needs lots of messing around, and trying/testing things, until you find the real problem(s).As others (and I) have said. Better layouts and construction techniques, may have made the debugging easier.The stray capacitance/inductance and cross-talk etc can be big headaches, especially at ever higher frequencies. So I think it was worth pointing out.Anyway, congratulations on fixing it!

author: MK14
author_rank: Super Contributor
timestamp: June 02, 2017, 07:08:27 pm
content: Quote from: PauloConstantino on June 02, 2017, 05:37:19 pmThanks!I've enjoyed watching the video. It was very nice seeing that program run, and a brand new and freshly designed cpu, making the light of day.I'm amazed at how quickly you have designed and built it. I assumed/thought that it had been built up over a period of months, rather than a week.If I can be JOKINGLY slightly rude about a tiny part of the video. I love the bit where you have the camera over it and it shows a massive mass of wires of incredible size and complexity, when you say something like "It is only a SIMPLE cpu/computer". N.B. This is NOT a criticism, just poking a tiny bit of fun, at it. You have done EXTREMELY WELL!In fairness, you are RIGHT. It is only a simple cpu, especially compared to the massive (number of transistors) modern cpus, such as the Intels latest ones. But all those wires makes it look like something big and highly complicated.I can see that you have had a lot of fun, designing and building the cpu. So good luck!

author: ebclr
author_rank: Super Contributor
timestamp: June 02, 2017, 08:00:01 pm
content: Would be nice to have parts list

author: PauloConstantino
author_rank: Regular Contributor
timestamp: June 03, 2017, 12:05:48 am
content: Quote from: ebclr on June 02, 2017, 08:00:01 pmSchematics available

author: Audioguru
author_rank: Super Contributor
timestamp: June 03, 2017, 02:38:55 am
content: That is the messiest circuit I have ever seen BY FAR! Of course it has problems.I made some very complicated high speed digital circuits soldered on stripboard. The layout was planned then the strips were all cut to be as short as possible and formed half of a pcb wiring. The parts and a few short jumper wires formed the other half. The compact circuits worked perfectly and looked good enough to be sold as the finished product.

author: PauloConstantino
author_rank: Regular Contributor
timestamp: June 03, 2017, 07:11:39 am
content: Quote from: Audioguru on June 03, 2017, 02:38:55 amIf you have read my last posts the problem has been **SOLVED**. Duh.

author: PauloConstantino
author_rank: Regular Contributor
timestamp: June 03, 2017, 07:14:17 am
content: Quote from: ebclr on June 02, 2017, 05:23:48 pmThis is what I plan to do:

author: MK14
author_rank: Super Contributor
timestamp: June 03, 2017, 07:39:45 am
content: Wire wrapping can take quite a long time. I'd suggest you seriously consider PCB.The costs of getting the boards made externally have generally come down a lot, over the years (and decades), since the 1970's.There are many options for automated PCB design software (from free to hobbyist affordable to expensive).You could use a number of standardized size PCBs, and some sort of back-plane or something to connect it all together.One big PCB is also possible.If the chips were all socketed, you could even go through different stages of design level. If you had any rarer TTL type devices. With no extra cost for the TTL (e.g. 74HC) chips. Although the same would be true for wire wrapping, except it can take ages to make a new generation of wire-wrapped boards.

author: PauloConstantino
author_rank: Regular Contributor
timestamp: June 03, 2017, 07:45:00 am
content: Quote from: MK14 on June 03, 2017, 07:39:45 amThe magic of it is building it manually. I advise you to consider wirewrap when designing yours. ohhhh boy its all so easy

author: BrianHG
author_rank: Super Contributor
timestamp: June 03, 2017, 08:28:06 am
content: Quote from: PauloConstantino on June 03, 2017, 07:14:17 amQuoteWhen I did some work for a company called RCS Management back a good 20 years ago, they made a 68040 accelerator CPU card for Amiga 2000s, with 32mb 32 bit ram modules. They showed me their prototype and it was a functional 25Mhz wire-wrap board. The ram was running at 50Mhz. Wire-wrap works...Attached is the production version of the Fusionforty accelerator board...

author: PauloConstantino
author_rank: Regular Contributor
timestamp: June 03, 2017, 08:40:00 am
content: Quote from: BrianHG on June 03, 2017, 08:28:06 amThat's really awesome! Yes wirewrap rules!