My 6502 SBC

For discussing the 65xx hardware itself or electronics projects.
User avatar
argonn
Posts: 13
Joined: 22 Mar 2017
Location: KO04SD
Contact:

My 6502 SBC

Post by argonn »

It works! After some time, and with second attempt. First one was classical "I want everything there", which failed.
Image
Image
Image
Image

After soldering most part I found two data lines shorted, and one wire desoldered while I was fixing first bug. After that it was executing the code from ROM; well, this is FLASH chip, but it's read-only here. While accessing the RAM chip it wasn't very happy. I didn't understand it: on the bus I saw (using oscilloscope ofc.) ROM still holding data, and suddenly RAM started talking (RAM's HIGH level is a bit lower). No matter what I did, access to RAM was causing two things to talk at once, showing all kinds of trapezoid lines, and causing CPU to reset after a few cycles. Interrupts were redirected to RESET, 'cause I tested it with ROM only and didn't have RAM to save return address into. It looked very weird. Surprisingly, at higher speeds (5MHz) things were going fine, lower speeds were causing RAM and CPU to to drive the data bus at once, also I/O didn't work.
My Φ2 is generated by 74HC74, and it's going to both CPU and logic, so I connected logic to CPU's Φ2 output. Suddenly everything started working perfectly. I found the error soon: CPU was getting clock shifted by 180°. I guess it was mind eclipse, I do not know how and why did I do it this way. By the way I found that my old MOS6502AD can run at 5.33MHz, until it warms up (5MHz limit then). Not so bad.

Next thing: I had to replace 74HC688 with 74AC521, above 6MHz it didn't work. I have only SMD ones, with 0.65mm leads pitch, so I made this funny looking franken-chip, that fits in a DIP socket. It works.

Some schematics:
Image
Address decoder

Image

Address decoder:
Previous idea was to put only 32K of RAM, 16K of ROM, and to drive all I/Os from address lines. I changed my mind, though, it still could be done that way without much trouble. Also there is easy option to copy ROM to RAM, and switch the RAM in, so I'd have 64KB - 256B of RAM, and 256B for I/O. ROM is selected for reads, RAM for writes, select line is pulled up for now. Maybe I'll change it someday.

What next? I have 640x480 black-and-white LCD (without a driver yet, but there is an idea how to make one), I'll also connect UART to have a serial console. There is a small RS232 text printer laying around, which might be useful too.

Surprisingly ringing isn't an issue, there is some light overshoot and undershoot, but nothing too serious. I guess diodes at inputs of chips clamp that.

Clock generator:
It was designed to divide input clock by any four-bit binary number having at most two bits set, and then by two again (74HC74): 2, 4, 6, 8, 10, 12, 16, 18, 20, 24. 74HC chips used here have trouble getting things right at higher frequencies, and from somewhere between 16MHz and 30MHz they start losing one pulse. By setting divider to 4 with 32MHz input I get 5.33MHz, not 8MHz as it should, so it in fact divides by 6. Higher-speed dividers are: 4, 6, 8, 10, 12, 14, 18, 20, 22 and 26.

Finally, a photo of the machine running some CPU tests. It displays whether CPU is 6502 or 65C02 on TIL311, then continues counting up from 0 to F. Original 74HC688 fitted in:
Image

You might notice that CPU looks funky: Rockwell part with date code 1426. That's another subject.

Credits:
Thank you Garth Wilson for primer and valuable input, BigDumbDinosaur for some ideas, and others. I hope that this is only beginning.
User avatar
BigEd
Posts: 11463
Joined: 11 Dec 2008
Location: England
Contact:

Re: My 6502 SBC

Post by BigEd »

Nice work! Great to see a working project.
User avatar
Elminster
Posts: 16
Joined: 17 Jun 2017
Location: England, United Kingdom

Re: My 6502 SBC

Post by Elminster »

I was just looking at starting a project to learn more how the bbc hangs together, looks like you are very advanced. I would be very interest to see a developer blogs, design notes etc.
jazz
Posts: 7
Joined: 11 Apr 2017
Location: UK

Re: My 6502 SBC

Post by jazz »

You know - I wish everyone would throw those rediculous rapberry Pi's in the bin where they belong and go back
to building acorn atoms or BBC's or whatever. at least they'd be learning something that way.
How that scam ever came to fool the charity commission beats me.
User avatar
BigEd
Posts: 11463
Joined: 11 Dec 2008
Location: England
Contact:

Re: My 6502 SBC

Post by BigEd »

Hmm, if you don't like something, that others clearly do like, it's best to remain silent. Otherwise you'll just get a fruitless argument. You'll note that the conversations here on 6502.org are generally good ones: informative, respectful, helpful. I'd like to see it remain that way - other corners of the internet are less civil, and are a good place to go if you like that sort of thing.
Tor
Posts: 597
Joined: 10 Apr 2011
Location: Norway/Japan

Re: My 6502 SBC

Post by Tor »

You can program the Pi on the bare metal, no operating system needed. Lots to learn there. In any case I've also found them incredibly useful for various purposes. As a console interface to my 1987 minicomputer, as a (wi-fi accessible) printer server, as interface to other (e.g. camera) projects. Etc. Sooner or later I'll have all my old computers and SBCs accessible over the net with the help of a Pi3 (or, if I can get my hands on one, PiZero/W). They're useful tools, in addition to what I said above in the first sentence.

(And there's that incredible 6502 emulation on a Pi/Zero too, over at Stardot. Very low-level as far as programming is concerned!)

On topic: Thanks for posting, argonn! Looks great (or looked great, when I read it from home - dropbox links are blocked from my current location, unfortunately. You can attach images directly on this forum if you wish - they'll not "disappear" with time, as happens too often with external sites)
whartung
Posts: 1004
Joined: 13 Dec 2003

Re: My 6502 SBC

Post by whartung »

I (finally - they kept going out of stock) got my Pi3 on order.

My hope is to use it as a platform to learn SPI interfacing, with the eventual goal to extend some OTS 6502 simulator to talk to the Pi3 GPIO pins and to write a nascent 6502 SPI driver.
User avatar
cbmeeks
Posts: 1254
Joined: 17 Aug 2005
Location: Soddy-Daisy, TN USA
Contact:

Re: My 6502 SBC

Post by cbmeeks »

I commend you on your soldering patience. I consider myself pretty good with the soldering iron but my eyes don't allow me to put multiple wires on the same pin unless I have plenty of space around it. Sucks getting old. ;-)
Cat; the other white meat.
DerTrueForce
Posts: 483
Joined: 04 Jun 2016
Location: Australia

Re: My 6502 SBC

Post by DerTrueForce »

It's a pain in the neck when you're fairly young, too. PLCC sockets are a particular annoyance, because the pins are so closely spaced. I suspect the data bus on my SBC is flaky, and that it's going dodgy in the rat's nest of wires under one of the PLCCs.
User avatar
BigDumbDinosaur
Posts: 9425
Joined: 28 May 2009
Location: Midwestern USA (JB Pritzker’s dystopia)
Contact:

Re: My 6502 SBC

Post by BigDumbDinosaur »

DerTrueForce wrote:
It's a pain in the neck when you're fairly young, too. PLCC sockets are a particular annoyance, because the pins are so closely spaced. I suspect the data bus on my SBC is flaky, and that it's going dodgy in the rat's nest of wires under one of the PLCCs.
Pin spacing in standard PLCC sockets is 100 mils. That's not close, even to me who is partially blind.
x86?  We ain't got no x86.  We don't NEED no stinking x86!
DerTrueForce
Posts: 483
Joined: 04 Jun 2016
Location: Australia

Re: My 6502 SBC

Post by DerTrueForce »

I know, but with a DIP, you only have single rows. With a PLCC, you get double rows.
That's what causes me the trouble. I have to go over other pins, which forces me to solder them in a certain order. It also got awkward to bring my soldering iron to bear without melting the insulation or bridging the pins, because the wires were so closely spaced. I could have used a PLCC-to-DIP adapter, but I didn't. Maybe I should have.
Of course, this is all completely moot if you're using a PCB. (I'm not, yet)
User avatar
GARTHWILSON
Forum Moderator
Posts: 8773
Joined: 30 Aug 2002
Location: Southern California
Contact:

Re: My 6502 SBC

Post by GARTHWILSON »

Wire-wrap PLCC sockets solve that, although they're expensive and kind of hard to find.
WW_PLCC_44.jpg
WW_PLCC_44.jpg (13.3 KiB) Viewed 6784 times
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 6502 SBC

Post by BigEd »

Seconded the point about the double rows. Also, even with glasses on, I can find it a bit tricky to see where the pins are in the presence of lots of shiny pyramids of solder. Perhaps I need new glasses! As we've said before, a magnification arrangement can help a lot, whether desk-mounted or head-mounted.
User avatar
cbmeeks
Posts: 1254
Joined: 17 Aug 2005
Location: Soddy-Daisy, TN USA
Contact:

Re: My 6502 SBC

Post by cbmeeks »

BigEd wrote:
Also, even with glasses on, I can find it a bit tricky to see where the pins are in the presence of lots of shiny pyramids of solder.
I have this problem with wire-wrapping. Much more than soldering. Not sure why.

But when I see a lot of wire-wrap pins all over the place, they start to run together and I have trouble individualizing each pin. Even with magnification. I liken it to snow blindness for pins. :-)
Cat; the other white meat.
User avatar
BigDumbDinosaur
Posts: 9425
Joined: 28 May 2009
Location: Midwestern USA (JB Pritzker’s dystopia)
Contact:

Re: My 6502 SBC

Post by BigDumbDinosaur »

DerTrueForce wrote:
I know, but with a DIP, you only have single rows. With a PLCC, you get double rows.
That's what causes me the trouble. I have to go over other pins, which forces me to solder them in a certain order. It also got awkward to bring my soldering iron to bear without melting the insulation or bridging the pins, because the wires were so closely spaced. I could have used a PLCC-to-DIP adapter, but I didn't. Maybe I should have.
Of course, this is all completely moot if you're using a PCB. (I'm not, yet)
When I solder PLCC sockets I use a soldering iron tip whose end I have ground flat. I press the tip to the end of the pin only and let the pin propagate the heat.
x86?  We ain't got no x86.  We don't NEED no stinking x86!
Post Reply