Sorry this is a long one. Several people have kindly posted and I need to anwer them all propely.
BigDumbDinosaur wrote:
1 mA is feeble.
...
You should see about single-stepping the clock so you can measure bus voltages with a DVM. That should help in pinpointing the problem.
Thanks BDD for your very full answer. Very informative indeed.
I do have a simple oscilloscope. I assume you are suggesting single stepping because you are not aware of that or is it for some other reason?
BigEd wrote:
To summarise, perhaps, and to explain the causation: it's desirable for the RAM to be able to pull the output adequately high. So don't load it too much. In this case, don't load it with original type TTL chips.
But CMOS inputs take very very little current, and therefore there's no problem if all the loads are CMOS loads.
Original 74-series TTL inputs take a lot of current, so you'd need to select devices from a modern family if you hope to see adequate levels. In fact chips from a modern family might well have CMOS-technology inputs even though they respond to TTL logic levels.
Okay. I don't think I am overloading. I am using all HC glue chips and all WDC CMOS parts.
hoglet wrote:
I've been reading back through this thread, and this data point stood out.
adrianhudson wrote:
It also seems that it is the write that didn't work since, when I find a mismatch, I output the address, what I expect to find at that address and what I actually find at the address. Since I am storing an increasing set of values to all memory e.g. all $00, and check, all $01 and check all $02 and check, I "usually" (I haven't double checked it is "always", but it might be) get the preceeding value, I get, say, $54 when I should get a $55. By the way, the program occaisionally crashes, I guess through the stack itself becoming corrupted.
It's been suggested in the last few posts that the issue here is a mismatch in logic high thresholds between a particular manufacturer's SRAM and the W65C02.
I'm not convinced this is actually what's going on....
In a RAM test surely that fault would result in unreliable reads (i.e. a '1' occasionally reading back as a '0'). It would not result in missing writes, which is what Adrian observed with his test program (i.e. where the original value remained intact).
If possible I would go back and try to verify this result on the current hardware, as I think it's quite significant.
I will go back and re-test. I'm not at all sure whether its read or write faults any more. A lot of water has passed under the bridge since I made the "read error" statement.
hoglet wrote:
One possible fault that might cause writes to be missed is a clock integrity issue that caused additional clock transitions to be seen by the CPU. This might generate occasional, very short write cycles. It's possible that cross-talk from several drivers turning on at the same time (during a RAM write cycle) is getting coupled back onto the CPU clock.
Sometimes just adding capacitance (e.g. a scope probe) to the clock pin of the 6502 is sufficient to change the symptoms significantly.
What scope model do you have?
I have a handheld Owon HDS242S. Not a great scope but better than nothing.
hoglet wrote:
BTW, this is the sort of problem a cheap logic analyzer and the
6502 Decoder can help with. The 6502 Decoder maintains a model of memory, and checks this model on every read cycle. Any inconsistencies are flagged, and you can usually infer quite alot about the nature of a fault from the pattern of errors.
You may remember I PMed you a few days ago about the CY7C68013A-56 EZ-USB. I ordered one and it arrived today. Might take me a while to get it working - I have a Windows PC. The Windows Subsystem for Linux might be an option but I don't know about USB support.
Dr Jefyll wrote:
hoglet wrote:
One possible fault that might cause writes to be missed is a clock integrity issue that caused additional clock transitions to be seen by the CPU.
Yes, that seems to me to be a highly pertinent observation, Dave. The (presumably) NMOS '02 performs far better than the WDC 'C02... and one conspicuous difference between those two chips is the much superior ability of the NMOS chip to input TTL voltage levels.
But another very significant difference is the
speed of the manufacturing processes. It's plausible that WDC's modern CMOS process is fast enough to respond to a clock glitch (or contribute to the generation of the glitch, as there may be a regenerative effect from the drivers turning on, as you say). But the much slower NMOS process is comparatively sluggish, and thus much less likely to respond to or contribute to trouble of that nature.
On the subject of glitches, I wonder about the clock oscillator. Perhaps the oscillator itself is defective or not properly specified. But it's also possible that its connections to the CPU aren't optimal. We've devoted some attention to how the various ICs attach to the Gnd/Vcc network, but the oscillator can also deserves review in this respect.
-- Jeff
I received a REAL Rockwell R65C02 today (the last one I got was an NMOS 6502 in counterfeit markings). The new Rockwell works 100% perfectly. Has been running for three hours now doing a memory test with interrupt driven clock to the display and serial out.
This is the clincher for me. The issue HAS to be TTL/CMOS levels or noise somewhere doesn't it? Is there anything else it can be?
Regarding the clock. The oscillator can is right next to the 'C02 phi2 input pin.
In the attached image (sorry, its old but not much has changed) the 1mHz oscillator is just above the Alliance memory next to the CPU. Its even upside down so the output is nearer the phi2 pin! The wire is about 3/10th inch. I have a capacitor across the power/gnd of the oscillator. Is there anything else I can do to improve things from the point of the oscillator spewing unwanted rubbish out into the rest of the lines? I even (in my naiveity) tried to find micro miniature coax for the clock line. No such thing available as far as I can find.
When you say the oscillator might not be "properly specified". I didn't go to a lot of trouble I will admit. It is marked ECS-2100 and the datasheet says "The ECS-2100X Series clock oscillator offers low current drain and is compatible with HCMOS/TTL logic".