Do I have a faulty 65C02?

For discussing the 65xx hardware itself or electronics projects.
adrianhudson
Posts: 169
Joined: 30 Apr 2022
Location: Devon. UK
Contact:

Do I have a faulty 65C02?

Post 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."
Last edited by adrianhudson on Tue Jun 21, 2022 5:12 pm, edited 1 time in total.
User avatar
BigEd
Posts: 11463
Joined: 11 Dec 2008
Location: England
Contact:

Re: Do I have a faulty 65C02?

Post by BigEd »

(Did you mean to say IRQ somewhere in there? That's the only thing CLI might interact with, I'd think.)
adrianhudson
Posts: 169
Joined: 30 Apr 2022
Location: Devon. UK
Contact:

Re: Do I have a faulty 65C02?

Post by adrianhudson »

I did mean IRQ, not NMI. My excuse is I am getting old *sigh*
User avatar
BigEd
Posts: 11463
Joined: 11 Dec 2008
Location: England
Contact:

Re: Do I have a faulty 65C02?

Post 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.
adrianhudson
Posts: 169
Joined: 30 Apr 2022
Location: Devon. UK
Contact:

Re: Do I have a faulty 65C02?

Post 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.
User avatar
Dr Jefyll
Posts: 3525
Joined: 11 Dec 2009
Location: Ontario, Canada
Contact:

Re: Do I have a faulty 65C02?

Post 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
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
User avatar
BigDumbDinosaur
Posts: 9425
Joined: 28 May 2009
Location: Midwestern USA (JB Pritzker’s dystopia)
Contact:

Re: Do I have a faulty 65C02?

Post 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.
x86?  We ain't got no x86.  We don't NEED no stinking x86!
adrianhudson
Posts: 169
Joined: 30 Apr 2022
Location: Devon. UK
Contact:

Re: Do I have a faulty 65C02?

Post 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.
adrianhudson
Posts: 169
Joined: 30 Apr 2022
Location: Devon. UK
Contact:

Re: Do I have a faulty 65C02?

Post 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.
User avatar
Dr Jefyll
Posts: 3525
Joined: 11 Dec 2009
Location: Ontario, Canada
Contact:

Re: Do I have a faulty 65C02?

Post 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
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
User avatar
GARTHWILSON
Forum Moderator
Posts: 8773
Joined: 30 Aug 2002
Location: Southern California
Contact:

Re: Do I have a faulty 65C02?

Post 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.
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?
adrianhudson
Posts: 169
Joined: 30 Apr 2022
Location: Devon. UK
Contact:

Re: Do I have a faulty 65C02?

Post 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!
Paganini
Posts: 516
Joined: 18 Mar 2022

Re: Do I have a faulty 65C02?

Post 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!
"The key is not to let the hardware sense any fear." - Radical Brad
tmr4
Posts: 147
Joined: 19 Feb 2022

Re: Do I have a faulty 65C02?

Post 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.
User avatar
BillO
Posts: 1038
Joined: 12 Dec 2008
Location: Canada

Re: Do I have a faulty 65C02?

Post 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
Bill
Post Reply