Author Topic: 8bit CPU project had problems - ***SOLVED***  (Read 21592 times)

0 Members and 1 Guest are viewing this topic.

Offline PauloConstantinoTopic starter

  • Regular Contributor
  • *
  • !
  • Posts: 154
  • Country: gb
Re: Circuit going nuts at very low frequency (need bypass capacitors)?
« Reply #50 on: June 02, 2017, 06:48:02 am »
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.

My old faithful hp 54501a scope has become uncalibrated and I'm waiting for a bnc cable to be able to calibrate it
 

Offline PauloConstantinoTopic starter

  • Regular Contributor
  • *
  • !
  • Posts: 154
  • Country: gb
Re: Circuit going nuts at very low frequency (need bypass capacitors)?
« Reply #51 on: June 02, 2017, 06:51:57 am »
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 a low-ohm meter, 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.

I 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 ?
 

Offline PauloConstantinoTopic starter

  • Regular Contributor
  • *
  • !
  • Posts: 154
  • Country: gb
Re: Circuit going nuts at very low frequency (need bypass capacitors)?
« Reply #52 on: June 02, 2017, 06:55:11 am »
Here's a photo of the cpu, i should have uploaded it before...

 

Offline PauloConstantinoTopic starter

  • Regular Contributor
  • *
  • !
  • Posts: 154
  • Country: gb
Re: Circuit going nuts at very low frequency (need bypass capacitors)?
« Reply #53 on: June 02, 2017, 06:59:29 am »
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.
 

Offline PauloConstantinoTopic starter

  • Regular Contributor
  • *
  • !
  • Posts: 154
  • Country: gb
Re: Circuit going nuts at very low frequency (need bypass capacitors)?
« Reply #54 on: June 02, 2017, 07:13:01 am »
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.
 

Offline MK14

  • Super Contributor
  • ***
  • Posts: 4586
  • Country: gb
Re: Circuit going nuts at very low frequency (need bypass capacitors)?
« Reply #55 on: June 02, 2017, 07:13:24 am »
Going fast on the circuit even at 3Hz might add to much to the potential time constant of these signals.

3Hz is NOTHING, when your connections are good. E.g. 100KHz should be fine

But 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.
« Last Edit: June 02, 2017, 07:17:05 am by MK14 »
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12923
Re: Circuit going nuts at very low frequency (need bypass capacitors)?
« Reply #56 on: June 02, 2017, 07:19:26 am »
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.
 
The following users thanked this post: MK14

Offline PauloConstantinoTopic starter

  • Regular Contributor
  • *
  • !
  • Posts: 154
  • Country: gb
Re: Circuit going nuts at very low frequency (need bypass capacitors)?
« Reply #57 on: June 02, 2017, 07:31:59 am »
Yep, it's running at a high frequency now no problems! But the voltage is 2.6 volts. Any takes ?
 

Offline MK14

  • Super Contributor
  • ***
  • Posts: 4586
  • Country: gb
Re: Circuit going nuts at very low frequency (need bypass capacitors)?
« Reply #58 on: June 02, 2017, 07:35:39 am »
Yep, it's running at a high frequency now no problems! But the voltage is 2.6 volts. Any takes ?

How 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.
 

Offline PauloConstantinoTopic starter

  • Regular Contributor
  • *
  • !
  • Posts: 154
  • Country: gb
Re: Circuit going nuts at very low frequency (need bypass capacitors)?
« Reply #59 on: June 02, 2017, 07:38:25 am »
Yep, it's running at a high frequency now no problems! But the voltage is 2.6 volts. Any takes ?

How 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.


Its running now at a few kilohertz! At 2.5 volts
 

Offline PauloConstantinoTopic starter

  • Regular Contributor
  • *
  • !
  • Posts: 154
  • Country: gb
Re: Circuit going nuts at very low frequency (need bypass capacitors)?
« Reply #60 on: June 02, 2017, 07:40:23 am »
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?
 

Offline MK14

  • Super Contributor
  • ***
  • Posts: 4586
  • Country: gb
Re: Circuit going nuts at very low frequency (need bypass capacitors)?
« Reply #61 on: June 02, 2017, 07:40:36 am »
Yep, it's running at a high frequency now no problems! But the voltage is 2.6 volts. Any takes ?

How 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.


Its running now at a few kilohertz! At 2.5 volts

A 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.
« Last Edit: June 02, 2017, 07:50:28 am by MK14 »
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12923
Re: Circuit going nuts at very low frequency (need bypass capacitors)?
« Reply #62 on: June 02, 2017, 07:51:51 am »
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. 
« Last Edit: June 02, 2017, 07:54:33 am by Ian.M »
 

Offline PauloConstantinoTopic starter

  • Regular Contributor
  • *
  • !
  • Posts: 154
  • Country: gb
Re: Circuit going nuts at very low frequency (need bypass capacitors)?
« Reply #63 on: June 02, 2017, 08:22:51 am »
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 ???
 

Offline MK14

  • Super Contributor
  • ***
  • Posts: 4586
  • Country: gb
Re: Circuit going nuts at very low frequency (need bypass capacitors)?
« Reply #64 on: June 02, 2017, 08:25:48 am »
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 ???

When a datasheet says a component should be running on a supply of say 4.5V to 5.5V
They 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 ?
« Last Edit: June 02, 2017, 08:33:10 am by MK14 »
 

Offline PauloConstantinoTopic starter

  • Regular Contributor
  • *
  • !
  • Posts: 154
  • Country: gb
Re: Circuit going nuts at very low frequency (need bypass capacitors)?
« Reply #65 on: June 02, 2017, 08:43:45 am »
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.
 

Offline MK14

  • Super Contributor
  • ***
  • Posts: 4586
  • Country: gb
Re: Circuit going nuts at very low frequency (need bypass capacitors)?
« Reply #66 on: June 02, 2017, 08:46:56 am »
The RAM datasheet says a maximum of 3.6V... I was operating it at 5V............... I HOPE that is the problem..... I really do.................

I will investigate further............

I had thought about this, but somehow I opened the wrong datasheet and it said 5V so I moved on! If this is the problem you will have been the person who solved it afterall :)

Don'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!
 

Offline PauloConstantinoTopic starter

  • Regular Contributor
  • *
  • !
  • Posts: 154
  • Country: gb
Re: Circuit going nuts at very low frequency (need bypass capacitors)?
« Reply #67 on: June 02, 2017, 08:48:19 am »
The RAM datasheet says a maximum of 3.6V... I was operating it at 5V............... I HOPE that is the problem..... I really do.................

I will investigate further............

I had thought about this, but somehow I opened the wrong datasheet and it said 5V so I moved on! If this is the problem you will have been the person who solved it afterall :)

Don'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!

Would it be ok to make a voltage divider at 3V and feed it into the RAM chip ?
 

Offline MK14

  • Super Contributor
  • ***
  • Posts: 4586
  • Country: gb
Re: Circuit going nuts at very low frequency (need bypass capacitors)?
« Reply #68 on: June 02, 2017, 08:49:00 am »
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.

Sometimes/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.
 

Offline MK14

  • Super Contributor
  • ***
  • Posts: 4586
  • Country: gb
Re: Circuit going nuts at very low frequency (need bypass capacitors)?
« Reply #69 on: June 02, 2017, 08:52:46 am »
Would it be ok to make a voltage divider at 3V and feed it into the RAM chip ?

I 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!
« Last Edit: June 02, 2017, 08:55:58 am by MK14 »
 

Offline grumpydoc

  • Super Contributor
  • ***
  • Posts: 2906
  • Country: gb
Re: Circuit going nuts at very low frequency (need bypass capacitors)?
« Reply #70 on: June 02, 2017, 09:14:17 am »
I'm pleased that you have got things working and are happy!

However looking at the photo of your setup you do appear 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 this will affect 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.
 
The following users thanked this post: Ian.M, MK14

Offline keshab.patel

  • Contributor
  • Posts: 22
Re: Circuit going nuts at very low frequency (need bypass capacitors)?
« Reply #71 on: June 02, 2017, 09:33:57 am »
Never seen such a complex design/wiring on bread board.
 |O

Better to make it simpler by partitioning  blocks by blocks.
 
 

Offline PauloConstantinoTopic starter

  • Regular Contributor
  • *
  • !
  • Posts: 154
  • Country: gb
Re: Circuit going nuts at very low frequency (need bypass capacitors)?
« Reply #72 on: June 02, 2017, 09:41:26 am »
Nope.... changed the RAM to a 5V one, but the problem still occurs.... I am very mad now!
 

Online tautech

  • Super Contributor
  • ***
  • Posts: 28719
  • Country: nz
  • Taupaki Technologies Ltd. Siglent Distributor NZ.
    • Taupaki Technologies Ltd.
Re: Circuit going nuts at very low frequency (need bypass capacitors)?
« Reply #73 on: June 02, 2017, 09:44:32 am »
Nope.... changed the RAM to a 5V one, but the problem still occurs.... I am very mad now!
Can it for now and fix that scope.
Avid Rabid Hobbyist.
Siglent Youtube channel: https://www.youtube.com/@SiglentVideo/videos
 
The following users thanked this post: Kilrah

Offline PauloConstantinoTopic starter

  • Regular Contributor
  • *
  • !
  • Posts: 154
  • Country: gb
Re: Circuit going nuts at very low frequency (need bypass capacitors)?
« Reply #74 on: June 02, 2017, 11:23:06 am »
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).
« Last Edit: June 02, 2017, 12:48:52 pm by PauloConstantino »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf