6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Tue Jul 09, 2024 12:03 am

All times are UTC




Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Newbie shopping list
PostPosted: Sat Mar 11, 2017 2:22 am 
Offline

Joined: Sat Mar 11, 2017 1:56 am
Posts: 276
Location: Lynden, WA
Hello, I'm a hobbyist who recently got the itch to do a retro computer build. I've been lurking the net, and have just enough scattered knowledge on 6502 builds to be dangerous, but not enough to pull the trigger on some parts. I plan on using Mouser (out of habit I guess), but I'm open to suggestion.

Okay, first the 6502. MY first romantic notion was to get a few original MOS parts. I still have a romantic notion of doing his, but have convinced myself that a modern CMOS part is a more reasonable direction. WDC seems to be the name I see the most, but they have more than one option.

So I want as close to an original 6502 experience I can get with a modern CMOS part. Which WDC part fills that bill?

My next question might determine the answer to the last one. What logic family for glue logic will be the most trouble free? I plan to run at 1 Mhz. Would 74HC be fine?

Ok, every video I see the builder never seems to specifically say what RAM and ROM chips they use. I have no idea what to get. I just want something that works. The ROM I'd think EEPROM, and hopefully one that can be written without to much extra hardware. Are there such chips?

About the PIA. I'm not completely clear what its for, since every video I see, there is some sort of micro-controller being used with it. I guess my question is, what does the PIA do, and what is the micro-controller doing? My immediate goal is just to get a working computer that can talk to my modern computer via a serial connection. I plan to use a Bus Pirate as a serial to USB adapter, but I'm not clear exactly how to get the serial from the CPU. I know the PIA is part of that equation, just not exactly which part. I also thought a seven segment display driven by an AVR (that's the MCU I'm most familiar with) would be nice. I'm thinking maybe a Raspberry PI for getting keyboard/screen I/O. Open to suggestion on all of this.

Long term goal is a computer that is not dependent on modern interfaces for keyboard/screen/storage. That's a distant goal. I just want to get something working for now. Ok, with those goals in mind, what is my Mouser shopping list for chips? What CPU, what PIA, and how much more do I need to get a serial I/O interface with my Bus Pirate?

Thanks for your patience!


Top
 Profile  
Reply with quote  
 Post subject: Re: Newbie shopping list
PostPosted: Sat Mar 11, 2017 2:33 am 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1938
Location: Sacramento, CA, USA
Dan, welcome.

Before you get much further, I would like to strongly recommend Garth's excellent primer pages:

http://wilsonminesco.com/6502primer/index.html

Get yourself a cup of coffee and go for a browse ... I promise that you won't regret it.

Mike B.


Top
 Profile  
Reply with quote  
 Post subject: Re: Newbie shopping list
PostPosted: Sat Mar 11, 2017 4:04 am 
Offline

Joined: Sat Mar 11, 2017 1:56 am
Posts: 276
Location: Lynden, WA
Thanks. I did stumble upon that, and it's definitely the most complete resource I've found yet.

I'm not even likely to start just yet. I have another more modern project that I need to see through before I get side tracked. I just want to have the parts. On hand so I can hit it on a whim :D


Top
 Profile  
Reply with quote  
 Post subject: Re: Newbie shopping list
PostPosted: Sat Mar 11, 2017 4:33 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8258
Location: Midwestern USA
Dan Moos wrote:
Hello, I'm a hobbyist who recently got the itch to do a retro computer build. I've been lurking the net, and have just enough scattered knowledge on 6502 builds to be dangerous, but not enough to pull the trigger on some parts.

Firstly, welcome to our 6502 world. Don't be afraid to ask questions...we're never afraid to give answers. :D

Quote:
I plan on using Mouser (out of habit I guess), but I'm open to suggestion.

Mouser is a fine choice, as is Digi-Key and to a lesser extent, Jameco. Prices vary and one vendor may not have everything that another vendor has, but between the three of them, you will find everything you need.

Quote:
So I want as close to an original 6502 experience I can get with a modern CMOS part. Which WDC part fills that bill?

You would want WDC part number W65C02S6TPG-14, which is the 65C02 in a DIP40 package. An alternative if you plan to do this on a printed circuit board is W65C02S6TPLG-14, which is in a PLCC44 package. There are pros and cons with using either package.

Quote:
My next question might determine the answer to the last one. What logic family for glue logic will be the most trouble free? I plan to run at 1 Mhz. Would 74HC be fine?

74HC logic is suitable to 8 MHz in most cases. Beyond 8 MHz, 74AC logic is best used, but will require better physical layout and design to avoid problems with ringing and other switching-related maladies. Assuming you stick with all CMOS parts, you don't need or want 74HCT or 74ACT logic. Also, do not use 74LS or 74F logic, for various reasons that are best explained elsewhere.

Quote:
Ok, every video I see the builder never seems to specifically say what RAM and ROM chips they use. I have no idea what to get. I just want something that works.

Most hobby builds are equipped with static RAM (SRAM), which is straightforward to interface to the 65C02, using standard glue logic. It is possible to use dynamic RAM (DRAM), but then you have to provide refresh circuitry, which can be a pain to set up. As the 65C02 cannot address more than 64KB and as you need address space for the ROM and some I/O hardware, you probably can do fine with a 32Kb × 8 SRAM (giving you 32 kilobytes), such as this Mouser item.

Quote:
The ROM I'd think EEPROM, and hopefully one that can be written without to (sic) much extra hardware. Are there such chips?

Your options are limited with an EEPROM. The logical choices for your build would be a 28C64 (8KB) or a 28C256 (32KB), both of which are obtainable in a PDIP28 package. The main thing to consider with any EEPROM is its relatively slow access time, which will set a hard limit on circuit speed, although that won't be too much a consideration in a first build running at no more than a few megahertz.

It is possible to reprogram an EEPROM in-circuit, but it's not a trivial matter to set up such a thing. I recommend that you invest in an inexpensive EPROM programmer and do it that way. There are sources on eBay.

Quote:
About the PIA. I'm not completely clear what its for...

The 65C21 peripheral interface adapter (PIA) is used to drive an external device from your system. The PIA provides two eight bit parallel ports whose individual bits can be programmed as inputs or outputs. For example, a PIA could be used to interface a parallel port printer to a 65C02 system. That said, most builds use the more capable 65C22 versatile interface adapter (VIA) due to it including a precision timer and a bi-directional serial shift register, as well as the two parallel ports of the PIA.

Although not something about which you should think as you design your first build, there are lots of I/O devices that can be interfaced to a 65C02. You're not limited to just the WDC products.

Quote:
My immediate goal is just to get a working computer that can talk to my modern computer via a serial connection. I plan to use a Bus Pirate as a serial to USB adapter, but I'm not clear exactly how to get the serial from the CPU. I know the PIA is part of that equation, just not exactly which part. I also thought a seven segment display driven by an AVR (that's the MCU I'm most familiar with) would be nice. I'm thinking maybe a Raspberry PI for getting keyboard/screen I/O. Open to suggestion on all of this.

A TIA-232 (aka RS-232) serial link is usually established with a universal asynchronous receiver/transmitter (UART), which is designed to convert parallel input into a serial bit stream output and convert a serial bit stream input to parallel output. The only UART in the 6502 family is the 65C51, currently available as WDC part number W65C51N6TPG-14. Be aware that although the WDC part is up-to-date as far as fabrication goes, it is a very old design reflecting mid-1970s technology, and has a hardware bug involving the transmitter. Better UARTs are available, but adapting them to the 65C02 bus is not as simple as using the 65C51.

Ultimately, what you do depends on how much a purist you want to be and how much dependence on other hardware you are willing to accept. Some builders have used MCUs as I/O devices or even as bus logic controllers. My opinion is offloading that stuff to an opaque piece of hardware takes away some of the learning opportunity you would get working with basic discrete logic devices. Modern MCus do offer convenience—you just have to decide how much convenience you want vs. how much learning experience you want.

Quote:
Long term goal is a computer that is not dependent on modern interfaces for keyboard/screen/storage.

The easiest route to take for a beginner would be to connect your 65C02 system's serial port to a PC and run terminal emulation software on the latter. That way you can focus most of your attention on getting your contraption running and getting your firmware refined.

First thing for you to do, however, is read Garth's primer in its entirety, which will stimulate your thought processes and give you a broad picture of the world of 65C02 computing.

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


Top
 Profile  
Reply with quote  
 Post subject: Re: Newbie shopping list
PostPosted: Sat Mar 11, 2017 4:41 am 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3366
Location: Ontario, Canada
Dan Moos wrote:
I just want to have the parts. On hand so I can hit it on a whim :D

I can relate to that. Of course, it's best to have some sort of shopping list. (I see BDD has noted some items while I was preparing this post.)

Another excellent site you can check out is Daryl Rictor's. Daryl (aka 8BIT) is another of our forum members, and you may just decide to build one of the projects he has listed there.

Welcome!

_________________
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  
 Post subject: Re: Newbie shopping list
PostPosted: Sat Mar 11, 2017 4:42 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10839
Location: England
Welcome Dan!

Finding a way to program your first ROM is a bit of a hurdle... I think your options are
- buy a programmer
- build a programmer
- ask someone to burn a ROM for you and post it

As a starting point, perhaps try this thread:
Any suggestions for an EEPROM Programmer?


Top
 Profile  
Reply with quote  
 Post subject: Re: Newbie shopping list
PostPosted: Sat Mar 11, 2017 5:18 am 
Online
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8464
Location: Southern California
BigDumbDinosaur wrote:
The 65C21 peripheral interface adapter (PIA) is used to drive an external device from your system. The PIA provides two eight bit parallel ports whose individual bits can be programmed as inputs or outputs. For example, a PIA could be used to interface a parallel port printer to a 65C02 system. That said, most builds use the more capable 65C22 versatile interface adapter (VIA) due to it including a precision timer and a bi-directional serial shift register, as well as the two parallel ports of the PIA.

Another disadvantage I found the '21 PIA has compared to the '22 VIA is that access to the data-direction registers on the PIA is only indirect, requiring more instructions, making it pretty clumsy to emulate open-drain outputs when needed. The way to to it is to set the output register's bit to a 0 and then change the data direction, so that even in "output" mode, sending a 1 is accomplished by making the pin an input so the external pull-up resistor can bring the line up. (The output register bit is left as 0.) This is valuable for example when bit-banging an I²C or PC-keyboard interface. The VIA is much more efficient at this. (Note to self: The above comments make me think I should add a section about programming EPROMs and EEPROMs to the 6502 Primer.)

_________________
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  
 Post subject: Re: Newbie shopping list
PostPosted: Sat Mar 11, 2017 5:41 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8258
Location: Midwestern USA
GARTHWILSON wrote:
Another disadvantage I found the '21 PIA has compared to the '22 VIA is that access to the data-direction registers on the PIA is only indirect, requiring more instructions, making it pretty clumsy to emulate open-drain outputs when needed.

You mentioning this aspect of the device reminds me of the hoops the designers of the Xetec Lt. Kernal jumped through in bit-banging the SASI bus. The host adapter interface the SASI bus through an MC6821, rather than the equivalent MOS Technology part, for reasons I have long forgotten (probably cost or availability, although the 6821's faster bus timing may have been a factor). As SASI is bi-directional, the indirect access to the data direction registers made for some less-than-optimum driver code. Despite that, the Lt. Kernal achieved a raw bus speed of 38KB/sec on a C-64 and about 65KB/sec on a C-128 running in FAST mode, which was pretty darn good for a bit-banging interface running on an eight bit, 2 MHz machine (the actual transfer rate to/from core was slower, averaging about 65 percent of the raw bus speed).

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


Top
 Profile  
Reply with quote  
 Post subject: Re: Newbie shopping list
PostPosted: Sat Mar 11, 2017 6:13 am 
Offline

Joined: Sat Mar 11, 2017 1:56 am
Posts: 276
Location: Lynden, WA
I'm not necessarily going for "purist", but I'm leaning more that way. So using that buggy chip from the '70s has a certain attraction. I for sure like to do as much myself as I can, so while I might start with an MCU just to prove the thing is working, I do want more period correct stuff eventually. I'm thinking an incremental approach that becomes more "purist" as my chops grow.

My background in the hobby is varied. I started building tube guitar amps, so in some ways an 8 bit computer is a move up in time! My current project is an AVR driven guitar pedal switching system.

I have a decent lab setup with a few decent scopes, a logic analyzer, and the usual stuff, so I think my cost of entry is gonna be pretty cheap here. Get the appropriate big chips, a kit full of 74HC logic, and a few appropriate crystal oscillators.


Top
 Profile  
Reply with quote  
 Post subject: Re: Newbie shopping list
PostPosted: Sat Mar 11, 2017 6:28 am 
Online
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8464
Location: Southern California
Dan Moos wrote:
so I think my cost of entry is gonna be pretty cheap here. Get the appropriate big chips, a kit full of 74HC logic, and a few appropriate crystal oscillators.

As you go through the 6502 primer, you'll find you don't even need a "kit full of 74HC logic." You could do with as little as a single 74HC00 quad NAND gate. You could even go without a crystal time base, but you'll eventually want it for certain things where an RC-based clock is not accurate enough.

_________________
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  
 Post subject: Re: Newbie shopping list
PostPosted: Sat Mar 11, 2017 8:26 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8258
Location: Midwestern USA
GARTHWILSON wrote:
Dan Moos wrote:
so I think my cost of entry is gonna be pretty cheap here. Get the appropriate big chips, a kit full of 74HC logic, and a few appropriate crystal oscillators.

As you go through the 6502 primer, you'll find you don't even need a "kit full of 74HC logic." You could do with as little as a single 74HC00 quad NAND gate. You could even go without a crystal time base, but you'll eventually want it for certain things where an RC-based clock is not accurate enough.

As Garth noted, you can build a working machine with very little glue logic. Your limitation with that approach will be a rather "coarse" memory map and limited I/O, although that is certainly not a handicap in a first design effort. As always, there are trade-offs to be considered.

When I designed my POC V1 unit, I decided to give it as much contiguous memory as possible, 52KB, stretching from $0000 to $CFFF. I put the I/O block at $D000-D7FF and ROM at $E000-$FFFF, 8KB worth. It was patent that such a memory map couldn't be realized with minimal glue logic. Since some of the challenge was to venture out into the unknown (the machine has a 65C816 instead of the more common 65C02—the '816 adds some design challenges), I decided that figuring out the required glue logic would be good exercise for the cerebrum. Accordingly, there is a complement of six glue logic chips:

  • 74AC00 quad two-input NAND
  • 74AC04 hex inverter
  • 74AC08 quad two-input AND
  • 74AC20 dual four-input NAND
  • 74AC32 quad two-input OR
  • 74AC138 3-to-8 decoder

Not on this list is a 74AC74 dual flip-flop, which is part of the clock generator circuit—it's not glue logic in the literal sense and could be eliminated if concern about the quality of the Ø2 clock signal isn't a factor (Garth discusses Ø2 generation in one part of his 6502 primer). I also could have deleted the 74AC04 and used the two otherwise-unused sections of the 74AC00 NAND as inverters, reducing the glue logic count to five devices.

As finally worked out, there are no more than two gates between the address bus and individual devices, which keeps the propagation delay down to a minimum. Although your first machine probably won't be run fast enough for prop delay to be a performance limiter, figuring out the total prop delay is a worthwhile exercise in understanding how it all works.

Obviously, you don't need to be this elaborate on a first build—I was going for a machine that would have enough oomph to run some fairly complicated software, as well as leave some room for I/O expansion—hence the 74AC138 decoder. Also, I just like to design and build complicated stuff. :D however, I'm a firm believer in learning how to make a single-engine plane fly before building that four-engine jumbo jet. In fact, we usually discourage a first-time builder from designing too elaborate a system, as doing so will increase the likelihood of the unit either failing to operate, or being unstable at any speed above a crawl. Let your feel for your knowledge and skill level be your guidance.

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


Top
 Profile  
Reply with quote  
 Post subject: Re: Newbie shopping list
PostPosted: Sat Mar 11, 2017 9:45 pm 
Online
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8464
Location: Southern California
BigDumbDinosaur wrote:
As Garth noted, you can build a working machine with very little glue logic. Your limitation with that approach will be a rather "coarse" memory map and limited I/O

The I/O is limited to characteristically 65-family devices which have both a CS input and a CS\ input, plus a Φ2 input. If you stick with these, you can still have up to ten of them without adding any further logic.

_________________
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  
 Post subject: Re: Newbie shopping list
PostPosted: Sat Mar 11, 2017 10:06 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8258
Location: Midwestern USA
GARTHWILSON wrote:
BigDumbDinosaur wrote:
As Garth noted, you can build a working machine with very little glue logic. Your limitation with that approach will be a rather "coarse" memory map and limited I/O

The I/O is limited to characteristically 65-family devices which have both a CS input and a CS\ input, plus a Φ2 input. If you stick with these, you can still have up to ten of them without adding any further logic.

The highlighted phrase was what I meant by "limited."

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


Top
 Profile  
Reply with quote  
 Post subject: Re: Newbie shopping list
PostPosted: Sun Mar 12, 2017 1:39 am 
Offline

Joined: Sat Mar 11, 2017 1:56 am
Posts: 276
Location: Lynden, WA
Thanks for all the great help guys! I went ahead and ordered some stuff. Even if some of it turns out to be not correct, I get a warm fuzzy feeling the more parts I have in my drawers, so I still win (people doing spring cleaning of their drawers please contact me!)

Here's what I ordered.

From Mouser:

2x W65C02S6TPG-14 CPUs
2x W65C22S6TPG-14 VIAs
2x W65C51N6TPG-14 Asynchronous Comm
4x 71256SA15TPG 32x8 SRAM
4x ECS-2100-AX-1.0 mHz oscillators
4x ECS-2200-AX-2.0 mHz oscillators

From Amazon:

1x AT 28C256 32k by 8 eeprom
This eeprom programmer:
https://www.amazon.com/gp/aw/d/B00K73TS ... ref=plSrch

And a kit with a large assortment of 74HC logic, so I can be prepared for anything.

Also got one of those UV eeprom erasers, just in case I ever go that route. (What is the advantage of the eproms with the UV window over the one I got anyway?)

Assuming my lab is well stocked with passives, LEDs, seven segs, breadboard supplies, a regulated PSU, and decent test gear, and a few options to connect a UART to a PC, is this all I need to get something going? (besides actual firmware to put in the ROM of course)


Top
 Profile  
Reply with quote  
 Post subject: Re: Newbie shopping list
PostPosted: Sun Mar 12, 2017 1:45 am 
Offline

Joined: Sat Mar 11, 2017 1:56 am
Posts: 276
Location: Lynden, WA
BTW, as you can see, I got extras of everything except the ROM (Mouser didn't have any, and I got the last one Amazon had Prime on)

3 reasons:
I won't be stopped if some magic smoke escapes

I don't have to disassemble the breadboard prototype when it's PCB time. That way I still have a working unit to reference.

I bet this won't be the last one of these I do! :lol:


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

All times are UTC


Who is online

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