6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Nov 23, 2024 2:44 pm

All times are UTC




Post new topic Reply to topic  [ 33 posts ]  Go to page 1, 2, 3  Next
Author Message
PostPosted: Fri Jul 02, 2021 12:50 am 
Offline

Joined: Sun May 30, 2021 2:16 am
Posts: 375
Hi, guys. Thanks for all your help - I'm up and soldering!

So, I'm attempting to design my first PCB, for which I just decided to do a basic 65c02 SoC. Whether I actually have it fabricated, or not, is another story, but I just want to do it to learn how to do it. Frankly, I have no idea what I'm doing. I just finished the basic main bus schematic (no power supply yet or peripheral chips):

https://github.com/jmstein7/65c02_errata/blob/main/Schematic_Six%20Five%20See%20Oh%20Two%20Alpha_2021-07-01.pdf

If any of you could take a few minutes to criticize it, I would really appreciate the feedback. Tell me everything I'm doing wrong :lol:

Thanks in advance for the help, as always!

Jon


Top
 Profile  
Reply with quote  
PostPosted: Fri Jul 02, 2021 2:08 am 
Offline
User avatar

Joined: Sat Sep 29, 2012 10:15 pm
Posts: 904
I only glanced at your circuit for a few seconds... Garth's http://wilsonminesco.com/6502primer/ is a great reference.

Generally speaking (from personal experience), PCBs are cheap, and you should design your computer to do exactly what you want to do now, not worrying about expandability and the future. When the future comes, you will want to do things slightly differently anyway, so the effort to make your computer expandable with connectors, switches etc. will just go to waste anyway. So keep it minimal, and if there is a cheap way to make something expandable (like using pullup resistors instead of connecting directly, so you could bodge a signal later), do so, but otherwise, just keep it simple.

I am a bit confused by the 'tie high or not' section. I can't think of a good reason to manipulate signals like Bus Enable with a switch... It is much more sensible to just pull these up or down with a resistor. Each signal should have its own resistor. Pulling up the way the circuit shows, by ganging up multiple signals through an LED is not a good idea.

At 8MHz, I would probably not drive the clock directly, and instead put a 16MHz oscillator though a flip-flop...Do you really want a switch on your board that switches off the clock? Is it to allow an external clock? You can always pull out the oscillator out of the socket and save yourself the trouble. Finally, I doubt that whatever drives the external clock connector needs or can use PH0/PHI1...I would just use the oscillator socket as an external clock connector.

Your computer will probably not reset correctly on powerup; a 3-pin reset controller chip is a good investment.

_________________
In theory, there is no difference between theory and practice. In practice, there is. ...Jan van de Snepscheut


Top
 Profile  
Reply with quote  
PostPosted: Fri Jul 02, 2021 5:47 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8509
Location: Midwestern USA
Jmstein7 wrote:
So, I'm attempting to design my first PCB...

https://github.com/jmstein7/65c02_errata/blob/main/Schematic_Six%20Five%20See%20Oh%20Two%20Alpha_2021-07-01.pdf

If any of you could take a few minutes to criticize it, I would really appreciate the feedback. Tell me everything I'm doing wrong :lol:

I'd love to :D I but don't do github. Can you attach something to your next message?

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


Top
 Profile  
Reply with quote  
PostPosted: Fri Jul 02, 2021 2:13 pm 
Offline
User avatar

Joined: Tue Mar 05, 2013 4:31 am
Posts: 1385
Well, first... I'll applaud your desire to design and build something. Second, I'll endorse your self quote (Frankly, I have no idea what I'm doing).

In addition to what Enso said:

1- The section for Tie High or Not. This makes no sense. Also adding an LED is of no value... either interrupt (IRQ/NMI) happens so quickly you'll never see a flash. Just use 3.3K resistors (all separate) and tie the signals to Vcc.

2- Reset Circuit. In short, it's not a proper reset circuit and switch bounce will make it highly sporadic. Just get a DS1813 and use it.

3- Power Indicator circuit. Look at what you're doing.... a 22 ohm resistor driving the LED. That will result in about 150ma of current into the LED! It's either a beacon, very hot or burned out. It will also be pushing half a watt into the 22-ohm resistor. I use small LEDs that can run off of 1ma of current, so I use a 3.3K dropping resistor.

4- Clock circuit. Looks like you're using a clock oscillator with a enable pin... what's the purpose of doing this? If you want to stop the clock, perhaps look at circuitry that can reliably stop the clock in either a high or low state, i.e., not an open/floating pin.

5- Memory Decode circuit. You should probably show this as the individual gates, much easier for anyone to look at the actual gate function. Also, seems many newbies are trying to do some bare minimum variation on Garth's original circuit. It's a very simple design on purpose... but I think you need to figure out what the goal of your first design is supposed to do... and what you intend to do with it.

6- Processor. You seem fixated on using a soft-core on a FPGA, which is fine. However, never having built a 6502 system, perhaps using a real W65C02 first would be beneficial. Once you have a working design, you can start swapping out the real 6502 for the FPGA soft-core CPU.

I would strongly suggest looking at some designs that other have built over the years. That will give you more insight on what you might want to do. Writing down the design goals can be useful.

Another minimal design I always liked was Doug Beattie's. Granted, it used 2 chips for logic decode, but had a full 32KB of addressable RAM and additional I/O selects.

Attachment:
DIY6502A-pg1.gif
DIY6502A-pg1.gif [ 73.46 KiB | Viewed 906 times ]

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


Top
 Profile  
Reply with quote  
PostPosted: Fri Jul 02, 2021 2:36 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
( Ouch! This is better... )


Attachments:
DIY6502A-pg1.png
DIY6502A-pg1.png [ 62.61 KiB | Viewed 902 times ]

_________________
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: Fri Jul 02, 2021 2:38 pm 
Offline

Joined: Sun May 30, 2021 2:16 am
Posts: 375
floobydust wrote:
I would strongly suggest looking at some designs that other have built over the years. That will give you more insight on what you might want to do. Writing down the design goals can be useful.

Another minimal design I always liked was Doug Beattie's. Granted, it used 2 chips for logic decode, but had a full 32KB of addressable RAM and additional I/O selects.


Yes, that is neat! Thanks for the advice. On the LEDs (which really aren't that important here, anyway), I've always used 220 or 330 ohm resistors (in my breadboards). Is that wrong?

Jon


Top
 Profile  
Reply with quote  
PostPosted: Fri Jul 02, 2021 2:39 pm 
Offline

Joined: Sun May 30, 2021 2:16 am
Posts: 375
Dr Jefyll wrote:
( Ouch! This is better... )


Much easier on the eyes!


Top
 Profile  
Reply with quote  
PostPosted: Fri Jul 02, 2021 2:40 pm 
Offline

Joined: Sun May 30, 2021 2:16 am
Posts: 375
BigDumbDinosaur wrote:
I'd love to :D I but don't do github. Can you attach something to your next message?

I don't know why, but the forum won't let me upload a PDF.


Top
 Profile  
Reply with quote  
PostPosted: Fri Jul 02, 2021 2:58 pm 
Offline

Joined: Sun May 30, 2021 2:16 am
Posts: 375
floobydust wrote:
3- Power Indicator circuit. Look at what you're doing.... a 22 ohm resistor driving the LED. That will result in about 150ma of current into the LED! It's either a beacon, very hot or burned out. It will also be pushing half a watt into the 22-ohm resistor. I use small LEDs that can run off of 1ma of current, so I use a 3.3K dropping resistor.


Great catch on the resistors! I fixed that.

https://github.com/jmstein7/65c02_errata/blob/main/Schematic_Six%20Five%20See%20Oh%20Two%20Alpha_2021-07-02.pdf

Regarding the LEDs on the "optional" signals - they're only meant to light if the signals are tied high. At least, that is what I was trying to do.

Jon


Top
 Profile  
Reply with quote  
PostPosted: Fri Jul 02, 2021 3:38 pm 
Offline

Joined: Tue Sep 03, 2002 12:58 pm
Posts: 336
As it is, 1) those 'pull-up' LEDs won't light, because CMOS inputs draw next to nothing and there's no other path for the current through the LED to ground, and 2) if there was enough current, the voltage drop across the LED would take the input below the maximum guaranteed to be recognised as a logic '1'.

If you want LEDs that reflect the current state of the signals, drive them through buffers. If you want the LED to say that the pull-up is enabled (staying on even if something else pulls that signal low), you'll need to rethink that part of the circuit. Personally, I don't see any value in them and wouldn't bother. But I do admit that LEDs are pretty, and it's pleasing to have a few on a board.


Top
 Profile  
Reply with quote  
PostPosted: Fri Jul 02, 2021 4:08 pm 
Offline
User avatar

Joined: Tue Mar 05, 2013 4:31 am
Posts: 1385
In short, signals like IRQ, NMI, SOB, etc., will usually be tied high via a resistor value, as these signals become active when low. Having a LED indicator might be useful to see if one of these signals were triggered, but again, the timing is so short, you won't see it with the naked eye. If you use the active signal thru a buffer and drive a one-shot timer, you can set the LED on time to be a second or so. This will allow you to "see" when and IRQ or NMI has been triggered.

LED current is based on the specification for the specific LED. I use one for a power indication, so I found one that can light with 1ma. Wasting more current isn't necessary (for basic indication), so that's what I use. In any case, you can easily calculate the current required... 5.0V - ~1.7V (forward bias voltage for a typical LED) = 3.3V drop required, divide this by the required current (1ma = 0.001A) and you'll get the resistance value in ohms (3300 in this example). Just refer to the datasheet for your particular LED.

I would also recommend adding a UART to the circuit, this way you can connect to it via a terminal program and have an interactive session (requires some monitor code) which might be far more usable for initial testing and some software development.

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


Top
 Profile  
Reply with quote  
PostPosted: Fri Jul 02, 2021 5:23 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
floobydust wrote:
In short, signals like IRQ, NMI, SOB, etc., will usually be tied high via a resistor value, as these signals become active when low.
One nit-pick, Kevin; also a bit of clarification for Jmstein7. :roll: :)

NMI and SOB are not active-low; they are edge-sensitive, and trigger when they see a transition from high to low. Presuming these inputs are unused, you're free to tie 'em high or low, whichever happens to be most convenient for you.

The resistor is a separate question. Instead of directly tying an unused input high or low, it can be handy to do it through a resistor instead. For various reasons, you may later wish to temporarily drive the pin to the non-default state. That will entail cutting the PCB trace if no resistor was used.

-- 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: Fri Jul 02, 2021 5:46 pm 
Offline

Joined: Sun May 30, 2021 2:16 am
Posts: 375
Dr Jefyll wrote:
One nit-pick, Kevin; also a bit of clarification for Jmstein7. :roll: :)


Thanks, Jeff!

Jon


Top
 Profile  
Reply with quote  
PostPosted: Fri Jul 02, 2021 7:58 pm 
Offline

Joined: Sun May 30, 2021 2:16 am
Posts: 375
Okay, I updated the schematic again, taking your suggestions into account. And, yeah, I know this is a WIP and that there are some terrible inefficiencies here, but, c'est la vie.

https://github.com/jmstein7/65c02_errata/blob/main/Schematic_Six%20Five%20See%20Oh%20Two%20Alpha_2021-07-02.pdf

Yet another crappy attempt at a schematic and PCB :lol:

Jon


Top
 Profile  
Reply with quote  
PostPosted: Fri Jul 02, 2021 8:16 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8509
Location: Midwestern USA
Dr Jefyll wrote:
( Ouch! This is better... )

AMEN! :D

BTW, I spotted a small but important omission in Doug's circuit, one that could definitely cause some grief.

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


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

All times are UTC


Who is online

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