6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Oct 06, 2024 11:32 pm

All times are UTC




Post new topic Reply to topic  [ 35 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
PostPosted: Sat May 20, 2017 9:02 am 
Offline

Joined: Wed Nov 18, 2015 8:36 am
Posts: 102
Location: UK
Hello all sorry for the delay in replying have been away due to work. I'll check the old CPU again with the cap to check. It's a good suggestion because both malfunctioning CPUs exhibit the same odd behaviour, and it does seem suspicious that they would fail in exactly the same way.

Will report back, thanks for the idea.


Top
 Profile  
Reply with quote  
PostPosted: Sat May 20, 2017 3:08 pm 
Offline

Joined: Wed Nov 18, 2015 8:36 am
Posts: 102
Location: UK
Well, I tried the following:
- Carefully removed my working CPU without caps fitted
- Fitted the non-working CPU which has caps pre-soldered. On testing this I found same as before - the system boots up but exhibits strange software behaviour
- Snipped the cap off the CPU. On testing, this worked fine!!!
- Placed a 0.1uF capacitor, but to the board not the CPU (this is the same CPU that wasn't working with a cap). On testing - still works!???!???
- Solder a 0.1uF capacitor back on this CPU. On testing, starts mis-behaving as before.

So what the heck is going on I wonder. I managed to reproduce the problem I was seeing but only by re-soldering the cap to the CPU. Putting the cap on the board seems to be ok - although I thikn there is still something odd happening as I am sure the odd glitch is occurring but very hard to replicate.

Why is this happening!? I am happy that my computer is working apparently fine without a cap, but not happy that I do not know the route cause of the issue. Seems that my CPUs are all fine, but there is something to do with capacitors across 5v and GND causing some kind of issue.

Any enlightenment or theories welcome!!


Top
 Profile  
Reply with quote  
PostPosted: Sat May 20, 2017 3:12 pm 
Offline
User avatar

Joined: Tue Nov 16, 2010 8:00 am
Posts: 2353
Location: Gouda, The Netherlands
Can you post a picture of the CPU + cap ?


Top
 Profile  
Reply with quote  
PostPosted: Sat May 20, 2017 3:35 pm 
Offline

Joined: Wed Nov 18, 2015 8:36 am
Posts: 102
Location: UK
I haven't tried uploading images so hope you can all see it ok. This shows my 65c02 in place on the breadboard. If you look carefully, the old solder remains of the snipped cap can be seen on VDD and VSS. Also, you can see the replacement 0.1uF cap which plugs in to the breadboard rather than soldered on the CPU - I needed to extend the capacitor leg with some black wire so it could reach across easily.

So what I have found is that the system is working completely reliably without any cap (as per the configuration in the picture). With the cap on the breadboard, it seems much more reliable but I am definitely getting some odd behaviour but far less obvious and hard to replicate.

I have made another change to the board in the recent past which is that originally I was getting +5V from the USB (which also has lines for the serial in/out). However, after encountering all sorts of weird glitches, I reverted to a mains transformer stepping down to 9V DC, and then using a simple 7805 voltage regulator and smoothing caps to give me my 5V. The ground of the USB is connected to the ground of the 9V transformer.


Attachments:
File comment: CPU with cap soldered..
IMG_20170520_162841.jpg
IMG_20170520_162841.jpg [ 3.2 MiB | Viewed 976 times ]
File comment: CPU without cap..
IMG_20170520_161538.jpg
IMG_20170520_161538.jpg [ 3.4 MiB | Viewed 976 times ]
Top
 Profile  
Reply with quote  
PostPosted: Sat May 20, 2017 3:54 pm 
Offline
User avatar

Joined: Tue Nov 16, 2010 8:00 am
Posts: 2353
Location: Gouda, The Netherlands
What are you using for oscillator ?


Top
 Profile  
Reply with quote  
PostPosted: Sat May 20, 2017 4:16 pm 
Offline

Joined: Wed Nov 18, 2015 8:36 am
Posts: 102
Location: UK
I have a 21.47727Mhz crystal, which is fed in to 74HC04 NAND gates of which the boosted output then is fed in to a 74HC161 counter. The various outputs of the counter is used to feed:
- VDP at 10.738635MHz (i.e. crystal divided by 2 ) required by the TMS9918 video chip
- 65c02 PHI2 at 2.684MHz (i.e. divided by 8 )
- AY-3-8910 (sound chip) and BBC keyboard clock at 1.342MHz (i.e. divided by 16 )

The timing circuit is a bit Heath Robinson, but seems to be working fine - any instability in the clock would be visible on the screen at the TMS9918 would be sending out irregular timing signals to the monitor?


Top
 Profile  
Reply with quote  
PostPosted: Sat May 20, 2017 10:57 pm 
Offline
User avatar

Joined: Wed Mar 01, 2017 8:54 pm
Posts: 660
Location: North-Germany
That's a bit odd - but somehow I expected that ;)
Although I have an idea why this happens, I would like you to try something more: can you add some 100nF caps into the supply rails running across the board - I have painted two places into your photo:[img]IMG_20170520_161538.png[/img]
You don't need to solder them, just plug them into the board.

If you still have one of your cpu's with soldered cap, you may try this: use the cap-soldered cpu (=> system becomes unstable), then add (as shown) additional caps to the supply rails - does the system becomes stable again?


Attachments:
IMG_20170520_161538.png
IMG_20170520_161538.png [ 33.84 MiB | Viewed 960 times ]
Top
 Profile  
Reply with quote  
PostPosted: Sun May 21, 2017 12:12 am 
Offline

Joined: Wed Nov 18, 2015 8:36 am
Posts: 102
Location: UK
I think I am understanding your line of enquiry, so tried added 0.1uF caps one by one using the CPU that has a soldered cap on it.

I have got at far as 6 0.1uF ( 100nF ) capacitors across the power rail near the CPU - but seemed to have no effect on making things better :?

So, still not sure what the heck is going on here. Very frustrating!


Top
 Profile  
Reply with quote  
PostPosted: Sun May 21, 2017 12:56 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8521
Location: Southern California
It sure is hard to tell what's happening. Performancewise, solderless breadboards are the worst of all worlds for this kind of work. I was trying to remember if you said elsewhere that you'll be laying out a PC board for this. Even wire-wrap is much better than solderless breadboards for this kind of work. I do like the solderless breadboards for slow analog work though.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
PostPosted: Sun May 21, 2017 2:54 am 
Offline
User avatar

Joined: Wed Mar 01, 2017 8:54 pm
Posts: 660
Location: North-Germany
To be honest, I thought a couple of caps would cure the effect but obviously it doesn't :(

I think you are observing a very subtle effect that happens and causes your system to hang. I think that every time when a state change happens (that occurs not only (but most prominent) at every clock edge) the required current causes a very narrow voltage dip to your CPU and the other components. To avoid this, every one (including me) would tell you: place caps as near as possible to the power pins to stabilize the supply. But this time this doesn't work as it is expected!

Now there are two effects that occur when the voltage drops: first the signals drops, the driving voltage as well, and that would cause the transistors within the chip to act slower and having a higher on state resistance. The latter will reduce the current demands and the voltage drop as well on one hand but also causes the signals to become less accurate. The former will change the signal timing, most likely the delays increase, but not much because due to the reduced supply voltage the switching levels will change as well. And once the switching is over the current requirements will drop so the voltage could recover causing the signals to recover as well.

These somehow weaker and slower changing signals have to travel to other chips. They do not necessarily suffer from that voltage dip, as they themselves didn't switch so far. They may tolerate these weaker signals and as long as the timing margins are sufficient the system still works.

What does an additional capacitor change? It acts as a small accumulator, delivering the charge the CPU is demanding. The voltage should not drop as much, timing and signal quality should not suffer significantly - so far everything should be fine. Now the cap requires its charge back from the supply. This current goes through both supply wires causing a voltage drop there over a lengthy period. And during this time, the CPUs VDD and GND references differ from the remaining system, causing the signal levels to differ as well. I assume this is, what causes the malfunction: your CPU is sometimes (after certain state changes) unable to deliver acceptable signals to the system.

I don't know whether one could proof this "theory". Perhaps this way: you are using again a CPU with capacitor across its pins. You verify that your system is still unstable. +see below+. Then you solder say 3 or 4 additional wires on each leg of the capacitor and stick the other end to the power rails (where a fat 10µ ceramic should be placed as well). This way these multiple connections should be of such low impedance (or inductance) that the voltage drops are getting insignificant.

On the other hand: now that you know your system is working fine without a cap, just go on and use it :) It may serve you well this way. And knowing that you are running on the edge may push you enough to consider to switch to a pcb solution, once your hardware evaluations are finished :D

Good luck so far!


edit(1):
Add another cap parallel to the ceramic one. Use a 10µ electrlytic or tantalum type (pay attention to their polarity!) - these sort of caps do have a higher ESR so they didn't response quick enough but their higher charge may help the temporary voltage drop to become insignificant. Perhaps this alone will cure the situation, otherwise reduce the inductance by adding several wires directly from the caps to the supply rails as said above.


Top
 Profile  
Reply with quote  
PostPosted: Sun May 21, 2017 7:32 am 
Offline
User avatar

Joined: Wed Mar 01, 2017 8:54 pm
Posts: 660
Location: North-Germany
GARTHWILSON wrote:
It sure is hard to tell what's happening. Performancewise, solderless breadboards are the worst of all worlds for this kind of work. I was trying to remember if you said elsewhere that you'll be laying out a PC board for this. Even wire-wrap is much better than solderless breadboards for this kind of work. I do like the solderless breadboards for slow analog work though.


I could only say: 100% ACK

:)


Top
 Profile  
Reply with quote  
PostPosted: Sun May 21, 2017 7:44 am 
Offline
User avatar

Joined: Tue Nov 16, 2010 8:00 am
Posts: 2353
Location: Gouda, The Netherlands
Another possibility is that a wire isn't plugged in correctly. I once made a circuit that where I had misplaced a wire by one column, but because of the crosstalk it still picked it up, and appeared to work.

Or maybe there's a floating input somewhere, like IRQ or NMI. Make sure you check all of those, and tie them to the appropriate rail.

A simple test to uncover those kinds of problems is to touch each pin with your finger (using a piece of bare wire), and see if certain pins can make the problem worse.


Top
 Profile  
Reply with quote  
PostPosted: Sun May 21, 2017 9:22 am 
Offline

Joined: Wed Nov 18, 2015 8:36 am
Posts: 102
Location: UK
I'm really grateful for the interest and advice in trying to get to the bottom of this curious situation. However, further developments have occurred...
- This morning, checked using the CPU with soldered cap - confirmed that it is unstable*. Seems the behaviour is not temperature related as the system had been off all night.
- So I start looking for things off the board. I replace the variable voltage mains transformer providing 9V 300mA to the LM7805 with another, although this one outputs 12V DC @ 3000mA
- System works fine now with the same CPU ?!
- So I revert back to the 9V supply - CPU continues to work fine!
- So I use a CPU with no caps at all - also works fine!

So now I am back to having a CPU with soldered cap, using the same mains transformer I have always been using. And it works. Grrr.

I am attaching a picture of my main board in case anyone has further ideas. I know it looks horrific but it has been working pretty ok for a long time. You can see my nutty 5V regulated power board - the LM7805 has a strange heat sink which I used out of whatever was in my parts bin (I think they are brackets for the kitchen). It's quite an extensive board, but fits inside a hacked BBC case. I have had odd issues from time to time - think the board is sensitive to internal and external sources of interference.

*When I say unstable, it pretty much does exactly the same thing each time - I have a 3 byte counter at locations 05,06,07 which get incremented every VDP interrupt. The cursor flash routines use this counter but the cursor stops flashing after about 4 seconds, which at 60Hz (NTSC) refresh rates equates to about 255 ticks. In fact when diagnosing this, I output the value of the counter each interrupt and found the software failed exactly where the counter flows over from 255 to 256. This has been working fine for months though, and with other odd effects like seeing spurious IRQ triggers, I know this is a H/W not S/W problem.


Attachments:
File comment: Main board
IMG_20170521_100312.jpg
IMG_20170521_100312.jpg [ 3.38 MiB | Viewed 932 times ]
Top
 Profile  
Reply with quote  
PostPosted: Sun May 21, 2017 9:38 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10949
Location: England
Would it be fair to say that you've seen inconsistent results and the system is unreliable? While some breadboard builds seem to go OK, maybe it's worth considering that this breadboard build is not OK. Could you bear to tear down and rewire it piece-by-piece? Or, as Garth suggests, take the design you have and re-implement it with a more solid technology? (Verowire, wire-wrap, point-to-point protoboard, PCB - there are many possibilities.)

Perhaps it's modular enough that you could reimplement it piecewise?

Edit: I do understand the desire to analyse and explain what's happening! It's very tempting to think there's a simple explanation and a simple fix, if only it can be found.


Top
 Profile  
Reply with quote  
PostPosted: Sun May 21, 2017 9:58 am 
Offline
User avatar

Joined: Tue Nov 16, 2010 8:00 am
Posts: 2353
Location: Gouda, The Netherlands
Do you have a stable 5V (lab) supply that you can use instead of the regulator ?


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 35 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 39 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: