w65c02 default behavior is not expected

Building your first 6502-based project? We'll help you get started here.
Post Reply
4Dimensional
Posts: 2
Joined: 27 Jun 2024
Contact:

w65c02 default behavior is not expected

Post by 4Dimensional »

I am attempting to learn how the 6502 works, and I came across an online tutorial by Ben Eater: https://www.youtube.com/watch?v=LnzuMJLZRdU.
I've gotten stuck at 7:30 in the video, where he demonstrates the 6502 doing.. something. When I attempt to run mine, it just freezes with pins a0-a15 like so:
011111111111111
I tried to hit the reset button or hold the reset button, and changed to a 1mhz crystal oscillator. The oscillator had the same result and hitting the reset button
did make a faint buzz sound to tell me it was doing something, but the outputs remained the same. At certain points, the outputs have changed before but now they have halted and stay as described.
Any help would go a long way as I've been stuck here for a week now :(
(btw the LEDs are not wired correctly in the pic rel)
Attachments
the circuit
the circuit
User avatar
Yuri
Posts: 371
Joined: 28 Feb 2023
Location: Texas

Re: w65c02 default behavior is not expected

Post by Yuri »

Ben tends to play loose and free with how he wires things up.

You've left the data pins (26-33) of the 6502 floating, which means that it could be seeing just about anything when it's going through it's initial start sequence and reading the boot address. At the very least I'd tie those to ground, though later Ben will wire these to give the value of "EA" which is the instruction for "No Operation" on the 6502

It also appears that the BE (Bus Enable) pin 36 is also floating. Might want to make sure that's being pulled high. (A bit hard to tell with the blurriness of the picture if I'm seeing that one correctly or not though.)

Also, with the reset pin, you want to make sure that it's held low for at least two clock cycles.

On your 555 circuit, I'm not sure that's correct either. Looks like you have your POT going back to pin 4? Think that should be pin 7 (which looks like it isn't connected to anything).

Might double wiring check here:
https://www.allaboutcircuits.com/tools/ ... e-circuit/

Edit:
You could also hook up the 555 as a debouncer and just use a push button to cycle the clock manually.

Edit Edit:
Looks like you have the exact same brand/make of breadboard power supply I started with. Keep a close eye on those and make sure they are in fact putting out 5V. All of the ones in the pack I got eventually died and started outputting wildly wrong voltages. (Fired at least one of my parts as a result.)
User avatar
BigDumbDinosaur
Posts: 9425
Joined: 28 May 2009
Location: Midwestern USA (JB Pritzker’s dystopia)
Contact:

Re: w65c02 default behavior is not expected

Post by BigDumbDinosaur »

4Dimensional wrote:
I am attempting to learn how the 6502 works, and I came across an online tutorial by Ben Eater: https://www.youtube.com/watch?v=LnzuMJLZRdU...

What Yuri said, plus the 555 timer is a poor choice for a clock generator.  While a 555 will work with an NMOS 6502 or one of the older (1980s-vintage) 65C02s, it comes up short when used with a WDC 65C02.  WDC specifies that the clock’s rise and fall time should not exceed 5 nanoseconds, and must reach at least 80 percent of VCC on the high phase.  The 555 might satisfy the 80 percent requirement, but its rise/fall times are much too long.  You need to use a can oscillator or similar to get the quality clock signal that is needed.

It is not enough to simply pull reset low to get things started.  The reset push button must be debounced in order to achieve a clean reset.  There are a variety of ways to do that.

All inputs on the 65C02 MUST be terminated.  Open inputs will pick up noise, possibly leading to undefined behavior.

I don’t want to criticize, but Ben Eater’s videos leave something to be desired in thoroughness.  We frequently see visitors with DOA units who built their hardware using information seen in a Ben Eater video.  Details matter...and sometimes Mr. Eater’s videos gloss over them.  For plenty of detail on how to put together a successful 65C02 contraption, read all about it on Garth Wilson’s web site.

BTW, welcome to 6502.org!
x86?  We ain't got no x86.  We don't NEED no stinking x86!
4Dimensional
Posts: 2
Joined: 27 Jun 2024
Contact:

Re: w65c02 default behavior is not expected

Post by 4Dimensional »

Thanks for all the replies :mrgreen:
I'm definitely going to be switching over to the wilsonminesco website as it has much more information.
I also fixed the 555 timer, and it seems to be running at much more even on and off times.
As with the can oscillator, I wasn't able to find any with less than 5 nanoseconds of rise and fall :?
I was searching on jamesco, but the lowest I found was 9 nanoseconds. If anyone has anywhere they
found some that would be extremely helpful :mrgreen:
Also, pin 36 is connected to 5v, sorry for the bad photograph.
User avatar
Yuri
Posts: 371
Joined: 28 Feb 2023
Location: Texas

Re: w65c02 default behavior is not expected

Post by Yuri »

4Dimensional wrote:
If anyone has anywhere they found some that would be extremely helpful :mrgreen:
The following link is a good place to start:
viewtopic.php?f=1&t=1953

I get most of my fresh parts from either DigiKey or Mouser. Though I also have ordered from Rochester, and Arrow
https://www.digikey.com/
https://www.mouser.com/
https://www.rocelec.com/
https://www.arrow.com/

Jamaco is great for some older used/referb parts.

Finally there's Octopart, which isn't a supplier but an aggregate search of many different suppliers:
https://octopart.com/

Excellent if what you need is a bit more obscure.

Good luck! Look forward to seeing what you build!
Post Reply