Page 1 of 2

Do I have a faulty 65C02?

Posted: Tue Jun 21, 2022 3:45 pm
by adrianhudson
I have a 65C02 with the IRQB pin jumpered to +5V. If I include a CLI instruction in the startup sequence it crashes. If I take the CLI out everything runs normally.

Why?

(I have 'scoped the NMIB pin and it is solid +5V)

Edit: I should say NMIB is also wired high (always has been). Also edited to say "I have a 65C02 with the IRQB pin jumpered to +5V." not "I have a 65C02 with the NMIB pin jumpered to +5V."

Re: Do I have a faulty 65C02?

Posted: Tue Jun 21, 2022 4:31 pm
by BigEd
(Did you mean to say IRQ somewhere in there? That's the only thing CLI might interact with, I'd think.)

Re: Do I have a faulty 65C02?

Posted: Tue Jun 21, 2022 5:14 pm
by adrianhudson
I did mean IRQ, not NMI. My excuse is I am getting old *sigh*

Re: Do I have a faulty 65C02?

Posted: Tue Jun 21, 2022 5:22 pm
by BigEd
Have you double-double checked which pin is which? Whatever it is, it feels more likely to have some circuit error than a bad chip.

Having said which, of course chips can be damaged by static, and maybe that's happened. I'm not sure what to expect of a damaged pin, whether for example it would be low, or unpredictable, or what.

Do you have an interrupt handler of any kind? Even if the IRQ vector points to an RTI instruction, that should be enough, I think, for the interrupt to be mostly benign. (It will cost some cycles.)

Do you have a scope or logic analyser? A sign of an interrupt being taken is three write cycles in succession.

Re: Do I have a faulty 65C02?

Posted: Tue Jun 21, 2022 6:16 pm
by adrianhudson
Hi BigEd and thanks for the reply.

I have double-double-DOUBLE checked the pins - I even got someone else to check over my shoulder.

There is an interrupt handler for IRQ and an RTS for NMI. The IRQ interrupt handler updates a realtime clock as per Garth's Interrupt primer and it used to work. I ran the computer for several days while away on holiday to check the stability of the circuit and came back and was somewhat amazed that it was within a second of the correct time. Then, one day it just stopped working and seemingly went haywire. I will admit to poking a wire or two (it's on breadboard (shhh)) but have really checked it properly. I determined it was something to do with interrupts so I jumpered IRQ high (and checked it with a meter). Still didn't work so changed CLI to SEI in the startup which DID make it run (albeit with no RTC of course).

So. that's where we are. IRQ and NMI jumpered high and checked with meter. Computer runs as long as interrupts are programmatically inhibited. Allow interrupts and poof!!

I will see what I can see with the 'scope.

Re: Do I have a faulty 65C02?

Posted: Tue Jun 21, 2022 6:42 pm
by Dr Jefyll
It's just a hunch, but perhaps you have an address line that no longer connects properly from the CPU to memory. As a result, some code (which doesn't require that line to toggle) will run seem to run properly, while other code which does require the line to toggle -- for example, your ISR? -- will fail.

-- Jeff

Re: Do I have a faulty 65C02?

Posted: Tue Jun 21, 2022 7:02 pm
by BigDumbDinosaur
adrianhudson wrote:
There is...an RTS for NMI.

Interrupt handlers are normally terminated with RTI. Dunno that has anything to do with the problem you are experiencing, but it can’t hurt to fix it.

Re: Do I have a faulty 65C02?

Posted: Tue Jun 21, 2022 7:11 pm
by adrianhudson
Dr Jefyll, that sounds very plausible! I have just determined that there is something VERY strange about some addresses. A subroutine is refusing to return but it seems to depend on where in memory it is. A couple of NOPs above it and it fails, remove them and it returns. That could be explained by the situation you describe. I need to get my multimeter out and measure some resistences.

BDD - sorry, typo. I meant RTI. Getting tired now - have been messing with this thing for ages - beginning to forget what I have tried and what not.

Re: Do I have a faulty 65C02?

Posted: Tue Jun 21, 2022 7:37 pm
by adrianhudson
Checked all the address and data lines to all chips. All okay.

Going to give up for today. 65C05 chips aren't expensive. I'll replace this one just to prove things and if it still doesn't work I will rebuild the whole lot on new breadboard.

Will update you in a few days.

Re: Do I have a faulty 65C02?

Posted: Tue Jun 21, 2022 10:32 pm
by Dr Jefyll
adrianhudson wrote:
[...] and if it still doesn't work I will rebuild the whole lot on new breadboard.
Be aware that not all breadboards are created equal. I've heard there's some real junk out there.

Radical Brad recommends those made by Twin Industries, so that's what I use (on the infrequent occasions when I bother with breadboards at all).

-- Jeff

Re: Do I have a faulty 65C02?

Posted: Wed Jun 22, 2022 12:37 am
by GARTHWILSON
The contacts on the Chinese solderless breadboards are not shaped right, or made of the right material. I've always used the American ones with a lifetime warranty, and never had any problems. I would not use solderless breadboard for making computers though. I did use it for my first 65c02 computer in 1986, but that was with 2MHz 65c02 and '22, and 74HC logic. Nothing faster.

Re: Do I have a faulty 65C02?

Posted: Wed Jun 22, 2022 11:52 am
by adrianhudson
Thanks Jeff, yes, I have heard the same about breadboard. Twin Industries board are appx $12 each here in the UK (ouch). I suppose I will have to bite the bullet.

Garth, I'll be more than happy if I get something working at 1Mhz... I can go faster if or when I go to PCB. It all depends how demoralised I get with the breadboard :-) :-)

I'd like to wirewrap but the prices for simple things like a 40 pin wirewrap socket are ridiculous - 50% more than the chip to go in them!

Re: Do I have a faulty 65C02?

Posted: Wed Jun 22, 2022 3:18 pm
by Paganini
Hi Adrian,

I never did pinpoint the problem exactly, but a few weeks ago I was struggling with something *very* similar to what you're describing. I tracked it down to having something to do with power line noise / interference. I was going to point you here, and then I noticed you are already there. :D So if you already have a bunch of bypass capacitors and a ground return network like in Garth's picture there, I wonder if maybe your power supply is noisy.

Also, I recently ordered some wire-wrap supplies from Phoenix Enterprises. The prices are a bit more expensive than what you'd pay on Mouser for regular soldertail, but not excessive, IMO. At least, not like some eBay sellers who are asking $5 - $10 for a single IC socket!

Re: Do I have a faulty 65C02?

Posted: Wed Jun 22, 2022 3:49 pm
by tmr4
I've had good success with BusBoard breadboards. A downside is they are a bit more pricy. I've run my breadboard builds up to 10 MHz before having stability issues.

Re: Do I have a faulty 65C02?

Posted: Wed Jun 22, 2022 7:10 pm
by BillO
I've had good luck with 3M (A P Products) and Global Specialties. Equal sized boards from Global Specialties are about 1/4 the cost the the 3M ones and you can get bare breadboards (not mounted.) for under $15. The ones below are what I use. The 3M one dates back to the 80s and is still working great. Neither is cheap though. Your looking at $400+ these days. The G-S one has a 3 voltage supply built in. Just the mounted boards would run about $100.
IMGP9871.jpg
IMGP9875.jpg