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

All times are UTC




Post new topic Reply to topic  [ 104 posts ]  Go to page Previous  1, 2, 3, 4, 5 ... 7  Next
Author Message
PostPosted: Wed Jul 24, 2024 2:42 am 
Online
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8546
Location: Southern California
Osric wrote:
Re: what I “want”: I’m trying to build the first computer I have ever built, for fun,

Gotcha.  It makes sense to not get overly ambitious then, just go for something functional first.

Quote:
I do not (yet) have sufficient interest to understand the magic of analog and AC circuits, which involve a *lot* of concepts I don’t understand at all … so I think trying to stick to slow clock speeds will help me not get into trouble.

Well, to repeat what's in the 6502 Primer, it's not the MHz that kills, but rather the fast edge rates (measured in single-digit nanoseconds) that are generated by parts that can do the higher MHz rates, and those fast edges can keep a poor layout from working even at a tiny fraction of a MHz.  That's why 74HC parts and a processor that's rated for only 2MHz and slowish memory will be a lot friendlier for getting a first design working at 1MHz that using fast parts at the same 1MHz rate will.  That's not to say every newbie's first construction will fail—not at all—but it does happen frequently, and we'd prefer to maximize the chance of success.

Quote:
VIA with 2-line LCD display attached that can display “Hello, world!”,

There's working sample code for interfacing to the common intelligent character LCDs in the 6502 Primer.  It should save you a lot of time and maybe frustration too.

_________________
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: Thu Jul 25, 2024 2:03 am 
Offline

Joined: Sat Jul 20, 2024 3:27 pm
Posts: 51
GARTHWILSON wrote:
Osric wrote:
Re: what I “want”: I’m trying to build the first computer I have ever built, for fun,

Gotcha.  It makes sense to not get overly ambitious then, just go for something functional first.
I thought I had something functional but reading your AC performance page makes it seem that I am deluding myself, as I have built the prototype on solderless breadboards and used long wires that ought to be a disaster area. I'll have to test at 1Mhz and see it fail. I'm not even sure how fast I've run the circuit so far - probably just 1Khz or 2Khz, so it "working" may be quite the overstatement.
GARTHWILSON wrote:
Quote:
I do not (yet) have sufficient interest to understand the magic of analog and AC circuits, which involve a *lot* of concepts I don’t understand at all … so I think trying to stick to slow clock speeds will help me not get into trouble.

Well, to repeat what's in the 6502 Primer, it's not the MHz that kills, but rather the fast edge rates (measured in single-digit nanoseconds) that are generated by parts that can do the higher MHz rates, and those fast edges can keep a poor layout from working even at a tiny fraction of a MHz.  That's why 74HC parts and a processor that's rated for only 2MHz and slowish memory will be a lot friendlier for getting a first design working at 1MHz that using fast parts at the same 1MHz rate will.  That's not to say every newbie's first construction will fail—not at all—but it does happen frequently, and we'd prefer to maximize the chance of success.
I also haven't really paid attention to what parts I'm using, it's a mishmash of what I had available and what I needed to order. There are very few parts though, so I could always replace them.
GARTHWILSON wrote:
Quote:
VIA with 2-line LCD display attached that can display “Hello, world!”,

There's working sample code for interfacing to the common intelligent character LCDs in the 6502 Primer.  It should save you a lot of time and maybe frustration too.
The code I saw seemed to be intended for an LCD that is connected to the bus. Mine is on the far side of a VIA, and is already working; I wasn't planning to do much with it so I considered that module finished.

P.S. Sorry for the slow response it took me a while to realize my post had a page 2 <blush>


Top
 Profile  
Reply with quote  
PostPosted: Thu Jul 25, 2024 6:56 am 
Offline
User avatar

Joined: Wed Feb 14, 2018 2:33 pm
Posts: 1488
Location: Scotland
Osric wrote:
I thought I had something functional but reading your AC performance page makes it seem that I am deluding myself, as I have built the prototype on solderless breadboards and used long wires that ought to be a disaster area. I'll have to test at 1Mhz and see it fail. I'm not even sure how fast I've run the circuit so far - probably just 1Khz or 2Khz, so it "working" may be quite the overstatement.


You can get to 2Mhz on breadboards without issues.

This works just fine:

Attachment:
IMG_20231215_115832_DRO.jpg
IMG_20231215_115832_DRO.jpg [ 722.27 KiB | Viewed 2144 times ]


-Gordon

_________________
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/


Top
 Profile  
Reply with quote  
PostPosted: Thu Jul 25, 2024 4:45 pm 
Offline

Joined: Fri Mar 18, 2022 6:33 pm
Posts: 491
drogon wrote:
You can get to 2Mhz on breadboards without issues.
Or even faster, with good construction. Blue Board runs at at least 5MHz (which is a slight overclocking of its vintage CMD parts.) I haven't tried to go faster.
Attachment:
PXL_20240517_162131113.jpg
PXL_20240517_162131113.jpg [ 2.72 MiB | Viewed 2129 times ]


Edit: That bit has to do with what Garth mentioned above. Those CMD parts are a lot more forgiving when it comes to edge rates than new WDC parts are!

_________________
"The key is not to let the hardware sense any fear." - Radical Brad


Top
 Profile  
Reply with quote  
PostPosted: Sun Jul 28, 2024 10:52 am 
Offline

Joined: Sun Jul 11, 2021 9:12 am
Posts: 155
Osric wrote:
BigEd wrote:
Yes, I’m using 55ns SRAM and plan to run the system at 1Mhz, so the RAM is about 20x faster than it needs to be.


On top of what Garth already pointed out, you are looking at half that estimate as you are dealing with accesses on both phases of the clock, so your RAM is effectively seeing a 2MHz system.

Then you have the 25nS delay for the address and data to be valid on the bus after BE goes high again. Playing with BE is an expensive transaction (See P25 of the datasheet). Meaning that you need to (or should) wait until you are half way through high phase of PHI2 (at 1MHz) to ensure you aren’t peppering the RAM with corrupted data.

Taking all of that in to account, your 55nS RAM starts getting tighter all of a sudden.

I only know all of this because I’m presently doing the same thing in my present project and have had to resort to some trickery to get my own 6502 homebrew running stable, which I only managed today in fact. :lol:


Top
 Profile  
Reply with quote  
PostPosted: Sun Jul 28, 2024 10:31 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8510
Location: Midwestern USA
Paganini wrote:
Edit: That bit has to do with what Garth mentioned above.  Those CMD parts are a lot more forgiving when it comes to edge rates than new WDC parts are!

All versions of the 65C02 prior to the ‘S’ series from WDC (‘S’ meaning static core) have outputs that are similar to that of 74HC logic.  Edges are relatively “gentle,” which improves the odds of a breadboard unit being stable at single-digit Ø2 rates.  With each die shrink, starting with WDC’s move from 2.0µ to 1.2µ in the 1990s and leading to the current 0.6µ geometry, the maximum Ø2 and edge rates increased.  Hence the same breadboard with a W65C02S6(T) has a much greater chance of being DOA or unstable.

WDC doesn’t publish the output edge rates for the current 0.6µ parts.  However, I have observed that the 65C816’s edges on my 275 MHz scope are not visible with the sweep running at maximum rate, which suggests an edge rate around 1 to 2 nanoseconds.  Such an edge rate is comparable to that of 74AC logic, which is “famous” for provoking ringing and instability in a less-than-sterling build.  While I won’t say a 1-2 ns edge rate is unworkable on a breadboard, such a build’s generally-sloppy wiring, as well as the lack of a ground plane, will likely trigger instability.

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


Top
 Profile  
Reply with quote  
PostPosted: Tue Jul 30, 2024 12:14 am 
Offline

Joined: Sat Jul 20, 2024 3:27 pm
Posts: 51
Unfortunately I’m on a hiatus from this project for a while so I haven’t had a chance to see if my breadboard can go fast or not, but I am using a static core part and so am expecting problems. Once I have those problems, it’d be nice to be able to solve them without understanding analog electronics … as I’m about to demonstrate my lack of knowledge in the futile quest for a solution:

I must not really understand the issue, because it seems to to me that putting a small capacitor to ground ought to enable me to soften any edge that’s too fast? Please bear in mind that I realize that what I am saying must be nonsensical but hopefully explaining to me why it won’t work will enlighten me (and perhaps others).

Let’s say we want to have edges that are 10 ns long, and we’ll use 500 ohm pull down resistors on all the address and data lines so that they’re never floating. Then we want T = 2 nanoseconds (because we need 5T to fully charge the capacitor) and T = RC so our capacitor needs to be 2e-9/500 = 1/250 e-9 = 4e-12, so we put 4 picofarad capacitors in series with the pull down resistors and now our rising edges are about 10-15 nanoseconds long, and similarly for our trailing edges. Or maybe 2k pull downs work making the capacitors 1pF instead, I’m not really clear on the right way to size pull down resistors either. Aside from the exact values that are desirable, there must be some other flaw in this approach that I don’t understand?

What’s the flaw in this approach to avoiding hard edges?


Top
 Profile  
Reply with quote  
PostPosted: Tue Jul 30, 2024 2:31 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8510
Location: Midwestern USA
Osric wrote:
Once I have those problems, it’d be nice to be able to solve them without understanding analog electronics … as I’m about to demonstrate my lack of knowledge in the futile quest for a solution:...

Unfortunately, some understanding of analog electronics is necessary when working with fast digital logic.  We’d like to think that digital circuits operate with crisp 1s and 0s, but it isn’t so.

BTW, attempting to slow the edges as you’re thinking will likely make things go from bad to worse.  That said, please experiment so you can benefit from the experience.

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


Top
 Profile  
Reply with quote  
PostPosted: Tue Jul 30, 2024 8:38 am 
Offline

Joined: Sun Jul 11, 2021 9:12 am
Posts: 155
Osric wrote:
Unfortunately I’m on a hiatus from this project for a while so I haven’t had a chance to see if my breadboard can go fast or not, but I am using a static core part and so am expecting problems.


I wouldn’t let posts deter you. I’d say give it a go.

I’ve personally had a stable-ish 38 MHz on a W65C02S on cheap and nasty breadboards alone. If you are looking at a few MHz you’ll have to do something really silly to stop it from working. And we are all here to bounce ideas and failures off anyway. We’ve all been there. :D

Give it a go. What’s the worst that can happen?


Top
 Profile  
Reply with quote  
PostPosted: Tue Jul 30, 2024 10:45 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
Experiment is good, but it can also be helpful to do some study - in particular, one can look at simple designs which already exist and which work.

I would note that one rarely sees pull-down resistors. Not never, but rarely. If you don't have a good reason to think you need them, based on some understanding or example, don't add them in. Similarly for other embellishments!

Good luck on your journey.


Top
 Profile  
Reply with quote  
PostPosted: Tue Jul 30, 2024 10:52 am 
Offline

Joined: Sun Jul 11, 2021 9:12 am
Posts: 155
BigEd wrote:
Experiment is good, but it can also be helpful to do some study - in particular, one can look at simple designs which already exist and which work.

I would note that one rarely sees pull-down resistors. Not never, but rarely. If you don't have a good reason to think you need them, based on some understanding or example, don't add them in. Similarly for other embellishments!


I agree on all fronts here. Pull-ups, in some cases like reset, RW, BE, etc. But pull-downs, not so much. Unless there is a specific goal in mind. Series resistors, sure, to take the edge off some signals. Not necessarily as requirement, but can be great for that fine tuning stage of the project.

Start with the KISS method and build from there, I say.

Garth’s primer, while awesome, can be an intimidating read. Making you feel that if you don’t have a dedicated ground plane or don’t use wire-wrap, that you are destined for failure. It’s not like that at all, I find the W65C02 to be quite forgiving. I’ve had masses of long wires all over the place on breadboards and still managed clock the chip easily beyond double or triple its specification.

Take the plunge, you won’t regret it. :D


Top
 Profile  
Reply with quote  
PostPosted: Tue Jul 30, 2024 8:56 pm 
Offline

Joined: Sat Jul 20, 2024 3:27 pm
Posts: 51
BigEd wrote:
I would note that one rarely sees pull-down resistors. Not never, but rarely. If you don't have a good reason to think you need them, based on some understanding or example, don't add them in. Similarly for other embellishments!
In my case, the pull downs are on the monitor module which contains the LEDs for all the address and data lines, and there's a pull up on RWB. The effect of this ought to be that in the transition from the CPU as the bus master to the video card as the bus master - which I intend to do on the rising edge of Φ1, which ought to be slightly after the falling edge of the clock - all that might happen is a spurious read of address 0. Now, the modules are meant to be removable, and of course the debug monitor is a prime example of a module I'd expect to be able to take out of the stack, so if it turns out these pull downs are actually necessary I will discover it only when running tests of the "production" system.

All the posts here have done so far is made me think I should write a simple ram test that I can run at speed before I bother adding more to the system, and that rather than adding the mono display next that I should add either the keyboard interface or a serial interface next, both of which are recognizably smaller increments than the mono video card (if less exciting). Everything seems to be working fine at the moment but I haven't tried running it at 1Mhz yet.

I do appreciate the encouragment :)


Top
 Profile  
Reply with quote  
PostPosted: Tue Jul 30, 2024 9:08 pm 
Offline

Joined: Sat Jul 20, 2024 3:27 pm
Posts: 51
J64C wrote:
Garth’s primer, while awesome, can be an intimidating read.


This. I have read a lot of it, but couldn't describe it as a 'primer'. It is more of a collection of pointers to things I don't understand and it's hard to suss out the priority of understanding those things as they are currently not getting in my way. Off the top of my head, here are a few things I don't know that the primer seems to assume I should know or will need to know:

- open drain vs open collector meaning and purpose
- familiarity with 74-family ICs
- what the function of a ground plane is and why twisted pairs couldn't serve the same purpose

and basically my experience of reading the primer is that I have to go do more research to understand each sentence. At the end of the day it's probably less productive but significantly more fun to actually wire up a working circuit, which is what I have, while worrying that it won't -stay- working without fixing the multitude of sins I have committed in the process.


Top
 Profile  
Reply with quote  
PostPosted: Tue Jul 30, 2024 11:07 pm 
Offline

Joined: Sun Jul 11, 2021 9:12 am
Posts: 155
Osric wrote:
At the end of the day it's probably less productive but significantly more fun to actually wire up a working circuit, which is what I have, while worrying that it won't -stay- working without fixing the multitude of sins I have committed in the process.


100% this. Get in there and start wiring things up. :D

He cops a bad rap around these parts for whatever reason, but I recommend checking out Ben Eater's videos. He does explain things simply and to the point and you'll get something that works if you follow along, barring things out of his control like dodgy connections etc.

Sure, there are things you'd improve upon and change over time, but when is a "Hello world" example ever intended to be a production run?


Top
 Profile  
Reply with quote  
PostPosted: Wed Jul 31, 2024 12:28 am 
Online
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8546
Location: Southern California
Osric wrote:
J64C wrote:
Garth’s primer, while awesome, can be an intimidating read.


This. I have read a lot of it, but couldn't describe it as a 'primer'. It is more of a collection of pointers to things I don't understand and it's hard to suss out the priority of understanding those things as they are currently not getting in my way. Off the top of my head, here are a few things I don't know that the primer seems to assume I should know or will need to know:

- open drain vs open collector meaning and purpose
- familiarity with 74-family ICs
- what the function of a ground plane is and why twisted pairs couldn't serve the same purpose

The primer says on the very first page,
Quote:
Expectations and nonExpectations

This primer is to give a good grasp of computer design basics, so that with good construction, you can make a computer that works on first try, with no hardware troubleshooting.  (There are troubleshooting helps in case it doesn't though.)

Intended for newcomers to the 6502 and hobbyists building their own computers, this primer is rather rudimentary, but assumes that the reader is acquainted with a few things like

  • binary and hexadecimal number bases
  • common 74-family logic ICs and their functions
  • wire-OR'able open-drain or open-collector logic
  • very basic DC circuit theory
  • even more-basic AC circuit theory (involving capacitance and, to a lesser extent, inductors)
  • what a stack is (a last-on first-off storage area in memory—it's in the software manual) (I do have a treatise on 6502 stacks on this site though.)
  • what the address and data buses are and generally how they are connected
  • Timing diagrams are in the data sheets and will not be repeated here.

then goes on to recommend a few good books for those, and then tells non-basic things it won't be getting into.

The Primer is logically organized into pages of various topics, each one building upon the previous ones; so I recommend going through them in order.  Because of the length, I have spent countless hours trying to make it more concise, finding ways to get all the important stuff through as clearly as I can without any more words than necessary.  I have a short page on why I do the website, and why I do it the way I do, at http://wilsonminesco.com/whydothis.html, and the last paragraph says,

Quote:
I try to get right into the subject on every page, not wasting your time like books that have their title page, copyright page, dedication page, acknowledgements page, the foreword, "About This Book" page, "About the Author" page, preface, table of contents, introduction, etc., before getting to the meat.  Everyone has too much material to read; so it's appropriate to just get to the point.  For more on how I work on the writing to make it the way it is, see this forum post

and one of the points I make there in that linked forum post is that I write far more than I post, and edit like crazy and remove everything that's not essential, ending up with something much shorter than I started with.  If it's left there, it's probably essential.

_________________
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  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 104 posts ]  Go to page Previous  1, 2, 3, 4, 5 ... 7  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 47 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: