My first computer

Building your first 6502-based project? We'll help you get started here.
User avatar
Hobbit1972
Posts: 80
Joined: 10 Feb 2015
Location: Germany

My first computer

Post by Hobbit1972 »

Hello,

I'm new to the forum and wanted to say hello and introduce my little project. Mike, thank you for bringing me in!

As a young lad I learned programming 6502 (or to be more specific 6510 in C=64), but I never made it to the hardware level (or better: producing too much magic smoke :-( ). Back there a CBM 610 mainboard got in my hands. The board is disassembled and gone, but the parts still remain. I always wanted to build a little system from them, but never came to it. Now eventually it put it on a messy breadboard:
IMGP7418.JPG
It contains:
ATMega32 for accessing the memory from the PC.
CPU 6509A - not sure if still works, at least on port pin might be damaged.
2xSRAM 2kx8 (one mapped at 0000-3ffff, the other one at c000-cfff)
glue logic (LS139 - Garth, I read your excellent primer, but the only I/O I have so far are two 6525 TPIs behaving like SRAM, so I will have to gate phi2 in for them too).
clock circuit to generate the non-overlapping clock (might run at 2Mhz, but that might cause ringing, so for now I generate a 62kHz PWM, that seems to work).


Amazingly the computer works. :-)

Not amazingly, it shows some quirks. (At first my test memory writes produced a very odd result - two address lines from AVR were swapped; now I am able to write to the lower memory, but the writes to the higher one disappear - the memory locations written to by the CPU contain random data - I hope I will find a solution for that. But reads from there by CPU work fine.)


So much for now - I'm glad that I have not produced magic smoke so far. :-)


Ralf
User avatar
BigEd
Posts: 11463
Joined: 11 Dec 2008
Location: England
Contact:

Re: My first computer

Post by BigEd »

Welcome! And well done for making your machine work. I have parts and a breadboard but somehow never get started with the experimenting. Probably a common story.
JenniferDigital
Posts: 92
Joined: 25 May 2015

Re: My first computer

Post by JenniferDigital »

Welcome! I'm new here myself and building myself a computer from scratch myself. Interesting projects like this will teach us lots.
User avatar
GARTHWILSON
Forum Moderator
Posts: 8773
Joined: 30 Aug 2002
Location: Southern California
Contact:

Re: My first computer

Post by GARTHWILSON »

Welcome.
Quote:
glue logic (LS139 - Garth, I read your excellent primer, but the only I/O I have so far are two 6525 TPIs behaving like SRAM, so I will have to gate phi2 in for them too).
I've never used the 6525, but a quick look at my nth-generation photocopy of its data sheet shows there's no phase-2 input, so you can get away with that. It will not work with the '22 though. It's not just a matter of preference or recommendation. I also do not recommend 74LS. There's no reason not to use at least 74HC. LS has no advantages except that it's less sensitive to static; but the TPI, processor, and memory are ESD-sensitive anyway, so you still have to take the precautions. Good luck with the project.
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?
User avatar
Hobbit1972
Posts: 80
Joined: 10 Feb 2015
Location: Germany

Re: My first computer

Post by Hobbit1972 »

Quote:
Interesting projects like this will teach us lots.
For now it teaches me that breadboard is a severe limitation and I have to migrate at least to dot board: I exchanged some wires on the data bus with shorter ones - just to find out problems get worse. I'd suspected it the other way round...

My suspicion that 6509 might be damaged has not come true *phew* - it's port pins are working properly.

Quote:
It will not work with the '22 though.
Yes, I know - but so far I have no 6522s. I could throw in a 6581 and a 6551.
Quote:
There's no reason not to use at least 74HC
Reason was: in the neighborhood were only LS139AN.
User avatar
banedon
Posts: 742
Joined: 08 Sep 2013
Location: A missile silo somewhere under southern England

Re: My first computer

Post by banedon »

Hobbit1972 wrote:
Quote:
Interesting projects like this will teach us lots.
For now it teaches me that breadboard is a severe limitation and I have to migrate at least to dot board: I exchanged some wires on the data bus with shorter ones - just to find out problems get worse. I'd suspected it the other way round...

My suspicion that 6509 might be damaged has not come true *phew* - it's port pins are working properly.

Quote:
It will not work with the '22 though.
Yes, I know - but so far I have no 6522s. I could throw in a 6581 and a 6551.
Quote:
There's no reason not to use at least 74HC
Reason was: in the neighborhood were only LS139AN.
LS should be ok, but if you want the CPU to go fast you'll probably have to go for 74HCT or even better 74ACT (xxACT/HCT as opposed to xxAC/HC as you're using NMOS parts). Got to admit that I've never seen a 6509. Good that it's still working and usable :).

Good luck with your project! :)
User avatar
Hobbit1972
Posts: 80
Joined: 10 Feb 2015
Location: Germany

Re: My first computer

Post by Hobbit1972 »

banedon wrote:
LS should be ok, but if you want the CPU to go fast you'll probably have to go for 74HCT or even better 74ACT (xxACT/HCT as opposed to xxAC/HC as you're using NMOS parts). Got to admit that I've never seen a 6509. Good that it's still working and usable :).

Good luck with your project! :)
The CPU probably will not run much faster than 2MHz - NMOS gets pretty warm and I don't think there would be much room for overclocking. And I want the 6509 to stay alive for longer. :-)
JenniferDigital
Posts: 92
Joined: 25 May 2015

Re: My first computer

Post by JenniferDigital »

Hey! How's your project coming along?
User avatar
KC9UDX
Posts: 246
Joined: 07 Dec 2013
Location: The Kettle Moraine

Re: My first computer

Post by KC9UDX »

The 6509 is rarer than rare.

Unless you specifically need it for your project, you may want to consider selling it to someone who has a CBM-II machine with a dead 6509.
User avatar
Hobbit1972
Posts: 80
Joined: 10 Feb 2015
Location: Germany

Re: My first computer

Post by Hobbit1972 »

DigitalDunc wrote:
Hey! How's your project coming along?
Aww - not at all at the moment :-( - a general lack of time and lots of other things keep me from proceeding. Then my work space is struck by the heat wave, so it would be quite unbearable to spend time there. And finally my soldering gun is on holiday -- it requested some rework, which is done, but I haven't got it back till now. :|

KC9UDX wrote:
The 6509 is rarer than rare.

Unless you specifically need it for your project, you may want to consider selling it to someone who has a CBM-II machine with a dead 6509.
:mrgreen: Do you volunteer to buy it? :wink:

I don't specifically need it for my project - but for now it's the only 65xx CPU I have. (I tried to order some parts over aliexpress but sadly the never arrived and I had to go for the refund....)
JenniferDigital
Posts: 92
Joined: 25 May 2015

Re: My first computer

Post by JenniferDigital »

I bought a load of western design center 6502s from Jameco and have been very happy with them except for when I put one in an Electron which worked but wouldn't run half the programs. Some programs using illegal opcodes fall over as the WDC part isn't the same. I'll send you one if you like.

EDIT: just noticed that Mouser do them for £4.90 in qty 1 though there's sure to be charges for postage etc. If you go the mouser route it's worth loading the order with other bits or you'll be ripping yourself off.
User avatar
BigDumbDinosaur
Posts: 9425
Joined: 28 May 2009
Location: Midwestern USA (JB Pritzker’s dystopia)
Contact:

Re: My first computer

Post by BigDumbDinosaur »

DigitalDunc wrote:
I bought a load of western design center 6502s from Jameco and have been very happy with them except for when I put one in an Electron which worked but wouldn't run half the programs. Some programs using illegal opcodes fall over as the WDC part isn't the same.
The WDC product is actually a 65C02, not a 6502. All 65C02s treat the unsupported opcodes as NOPs, so you would run into the same problem with any 65C02, not just a WDC one.
x86?  We ain't got no x86.  We don't NEED no stinking x86!
User avatar
GARTHWILSON
Forum Moderator
Posts: 8773
Joined: 30 Aug 2002
Location: Southern California
Contact:

Re: My first computer

Post by GARTHWILSON »

and of course there will be new instructions and addressing modes that don't match the illegal ones of the NMOS. The CMOS one is definitely the better 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?
User avatar
BigEd
Posts: 11463
Joined: 11 Dec 2008
Location: England
Contact:

Re: My first computer

Post by BigEd »

But do note that DigitalDunc mentioned the 65C02 in the context of replacing the CPU in an old computer which needs to run old programs which use the NMOS CPU in an ill-advised but not uncommon fashion.
JenniferDigital
Posts: 92
Joined: 25 May 2015

Re: My first computer

Post by JenniferDigital »

Yep! I learned that one the hard way. Still. It just proved to me how many programs use illegal opcodes. Even in the firmware for the disc controller cartridge.
Post Reply