6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun May 12, 2024 11:27 am

All times are UTC




Post new topic Reply to topic  [ 24 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Thu Aug 11, 2022 1:47 pm 
Offline

Joined: Tue May 17, 2022 12:53 pm
Posts: 7
Hello all,

I have something that is driving me crazy and normally I know something about electronics.
On my breadboard I have built a basic circuit for the 6502 which works wonderfully and after a reset and 7 clock cycles it jumps to the reset vector $FFFC/$FFFD. If I build the same circuit on a PCB, it jumps somewhere after the 7 clock cycles. I have spent days trying to find the error. Both circuits are built the same way.

I think I have not understood something and would like some advice.

Greetings

Erik


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 11, 2022 2:53 pm 
Offline
User avatar

Joined: Tue Mar 05, 2013 4:31 am
Posts: 1373
More information would help....

Perhaps post a schematic and some pics of the PCB... and any software that you are using to kick things off.

_________________
Regards, KM
https://github.com/floobydust


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 11, 2022 3:26 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10800
Location: England
"Jumps to the reset vector" jumps out to me as an odd phrase. The 6502 will fetch the initial value of the PC from the reset vector, which as you say is at FFFC (and FFFD). It's an indirect jump, if you want to think of it as a jump.

So you need a ROM or similar, mapped at the top of memory, with the right two bytes in it, in order to go to the code you intend.

If you want execution to start at $C000, for example, then you need $00 at FFFC and $C0 at FFFD.

So... you've built two systems, and they work differently, but you expected them to work the same. Which is right? Sounds like it could be the PCB version.

But what's the difference? I'd guess it's most likely the glue logic, which is what will cause the ROM to work. But it could be any of a number of possible wiring errors - swapped signals, or even shorts or open circuits.

What diagnostic equipment do you have? A continuity tester will allow you to check that everything which should be connected is connected, and no two adjacent pins which should not be shorted are indeed not shorted.


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 11, 2022 8:20 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8180
Location: Midwestern USA
As Flooby says: schematic and PCB layout. Without those we’re only guessing.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Fri Aug 12, 2022 6:40 am 
Offline

Joined: Tue May 17, 2022 12:53 pm
Posts: 7
Hello everybody,

here ist the circuit-diagram, and it's really simple for you guys. it's embarrassing for me!

So there's no code needed because of the $ea on the data-bus.
I inspected the address- and data-bus with the connected arduino, like Bean Eater did it.
As I said, on the breadboard it works fine, an on my pcb, it sometimes worked. Very seldom! I love these unpredictable errors :-(

Thanks a lot for your support!!

Best

Erik


Attachments:
SchaltplanArduinoMega002.jpg
SchaltplanArduinoMega002.jpg [ 214.52 KiB | Viewed 1276 times ]
Top
 Profile  
Reply with quote  
PostPosted: Fri Aug 12, 2022 6:59 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10800
Location: England
If your implementation works sometimes - even if not often - then you should check your construction. In particular, check the soldering, particularly for dry joints (the molten solder should have flowed over both parts of the joint, should be smooth and shiny.) For a small project, it might be worth simply re-soldering all the joints, with plenty of flux.


Top
 Profile  
Reply with quote  
PostPosted: Fri Aug 12, 2022 7:18 am 
Offline
User avatar

Joined: Tue Nov 16, 2010 8:00 am
Posts: 2353
Location: Gouda, The Netherlands
Maybe bounce on the reset button. I would hook up the reset button to an Arduino input pin, and then hook up an Arduino output to the reset line so you can generate a nice clean pulse.


Top
 Profile  
Reply with quote  
PostPosted: Fri Aug 12, 2022 12:55 pm 
Offline

Joined: Tue May 17, 2022 12:53 pm
Posts: 7
I cleaned up everything and re-soldered some connections. Now it's fine.

Thanks a lot!

Best Erik


Top
 Profile  
Reply with quote  
PostPosted: Fri Aug 12, 2022 1:32 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8180
Location: Midwestern USA
You need to debounce your reset switch with a Maxim DS1813 or similar. Without some kind of debouncing, there’s no assurance the MPU will execute a clean reset. The pullup resistor (R17) should be 3.3K, or thereabouts.

Also, RDY must not be directly wired to VCC. RDY is a bi-directional pin and if, by chance, a WAI (WAit for Interrupt) instruction is executed, intentionally or otherwise, RDY will try to sink VCC.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Fri Aug 12, 2022 2:57 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10800
Location: England
Empirically, this can't quite be so - I would think many people have just wired up a reset button and found it to work. If perhaps once in a while reset doesn't work, it would be natural and almost unconscious to press it again.

What I think you must mean, then, is that you yourself would be inclined to include such a chip, and you recommend that others do, in the case that they want a very reliable reset. You could perhaps say that it's a good idea to include such a chip.

I say this because I believe we don't need to encourage over-engineering, and we don't benefit the community by insisting that every project should be built as industrial grade.


Top
 Profile  
Reply with quote  
PostPosted: Fri Aug 12, 2022 4:48 pm 
Offline

Joined: Fri Dec 21, 2018 1:05 am
Posts: 1076
Location: Albuquerque NM USA
If you look at the output of the common, cheap reset button with a scope, you'll find it is surprisingly clean. Most of the times it produces single clean rising edge; by comparison a toggle switch is very noisy.
Bill


Top
 Profile  
Reply with quote  
PostPosted: Fri Aug 12, 2022 5:29 pm 
Offline
User avatar

Joined: Fri Dec 12, 2008 10:40 pm
Posts: 1001
Location: Canada
DS1813's are getting pricey. They are 1/3 of the cost of a W65C02 these days. The DS1233-15 is a more reasonably priced device. However, a small cap, a couple of resistors and a little MOSFET like a 2N7000 can provide a nice reset circuit for well under $1.

Attachment:
reset.jpg
reset.jpg [ 13.7 KiB | Viewed 1209 times ]

_________________
Bill


Top
 Profile  
Reply with quote  
PostPosted: Fri Aug 12, 2022 6:15 pm 
Offline

Joined: Fri Dec 21, 2018 1:05 am
Posts: 1076
Location: Albuquerque NM USA
I myself use MCP130. I buy 200 from Mouser at a time for around 50 cents each. I'm on my third batch of MCP130.
Bill


Top
 Profile  
Reply with quote  
PostPosted: Fri Aug 12, 2022 7:36 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8433
Location: Southern California
I've seen some awfully noisy, bouncy switches, including pushbutton. (They get worse as they age; so just because it works nicely when new doesn't mean it always will.) If you happen to get one of these and don't realize what's going on, it could be awfully discouraging. There's often (usually?) a spare gate section somewhere on the board, and especially if it has a Schmitt-trigger input, you can use it for a reset circuit with a few discretes that altogether cost a few pennies. I show such circuits on the reset page of the 6502 primer, at http://wilsonminesco.com/6502primer/RSTreqs.html .

BTW, the DS1813 does have an internal pull-up resistor which the data sheet says is typically 5.5K, and may be quite a bit lower. I don't think there's any point in adding an external one.

_________________
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: Fri Aug 12, 2022 9:50 pm 
Offline
User avatar

Joined: Fri Dec 12, 2008 10:40 pm
Posts: 1001
Location: Canada
plasmo wrote:
I myself use MCP130. I buy 200 from Mouser at a time for around 50 cents each. I'm on my third batch of MCP130.
Bill


Interesting. Can you add a reset switch to it? I can't find mention of that in teh data sheet.

_________________
Bill


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

All times are UTC


Who is online

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