6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri Nov 22, 2024 9:55 am

All times are UTC




Post new topic Reply to topic  [ 30 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Tue Jun 21, 2022 3:45 pm 
Offline

Joined: Sat Apr 30, 2022 7:13 pm
Posts: 159
Location: Devon. UK
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.

Top
 Profile  
Reply with quote  
PostPosted: Tue Jun 21, 2022 4:31 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
(Did you mean to say IRQ somewhere in there? That's the only thing CLI might interact with, I'd think.)


Top
 Profile  
Reply with quote  
PostPosted: Tue Jun 21, 2022 5:14 pm 
Offline

Joined: Sat Apr 30, 2022 7:13 pm
Posts: 159
Location: Devon. UK
I did mean IRQ, not NMI. My excuse is I am getting old *sigh*


Top
 Profile  
Reply with quote  
PostPosted: Tue Jun 21, 2022 5:22 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
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.


Top
 Profile  
Reply with quote  
PostPosted: Tue Jun 21, 2022 6:16 pm 
Offline

Joined: Sat Apr 30, 2022 7:13 pm
Posts: 159
Location: Devon. UK
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.


Top
 Profile  
Reply with quote  
PostPosted: Tue Jun 21, 2022 6:42 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
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


Top
 Profile  
Reply with quote  
PostPosted: Tue Jun 21, 2022 7:02 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8505
Location: Midwestern USA
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!


Top
 Profile  
Reply with quote  
PostPosted: Tue Jun 21, 2022 7:11 pm 
Offline

Joined: Sat Apr 30, 2022 7:13 pm
Posts: 159
Location: Devon. UK
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.


Top
 Profile  
Reply with quote  
PostPosted: Tue Jun 21, 2022 7:37 pm 
Offline

Joined: Sat Apr 30, 2022 7:13 pm
Posts: 159
Location: Devon. UK
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.


Top
 Profile  
Reply with quote  
PostPosted: Tue Jun 21, 2022 10:32 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
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


Top
 Profile  
Reply with quote  
PostPosted: Wed Jun 22, 2022 12:37 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8543
Location: Southern California
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?


Top
 Profile  
Reply with quote  
PostPosted: Wed Jun 22, 2022 11:52 am 
Offline

Joined: Sat Apr 30, 2022 7:13 pm
Posts: 159
Location: Devon. UK
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!


Top
 Profile  
Reply with quote  
PostPosted: Wed Jun 22, 2022 3:18 pm 
Offline

Joined: Fri Mar 18, 2022 6:33 pm
Posts: 491
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


Top
 Profile  
Reply with quote  
PostPosted: Wed Jun 22, 2022 3:49 pm 
Offline

Joined: Sat Feb 19, 2022 10:14 pm
Posts: 147
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.


Top
 Profile  
Reply with quote  
PostPosted: Wed Jun 22, 2022 7:10 pm 
Offline
User avatar

Joined: Fri Dec 12, 2008 10:40 pm
Posts: 1007
Location: Canada
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.

Attachment:
IMGP9871.jpg
IMGP9871.jpg [ 194.1 KiB | Viewed 899 times ]

Attachment:
IMGP9875.jpg
IMGP9875.jpg [ 188.2 KiB | Viewed 899 times ]

_________________
Bill


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

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 23 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: