Page 1 of 1
First build
Posted: Thu Oct 15, 2020 7:47 pm
by deanflyer
Thought I'd share my first ever build. I used to do a lot of C64 assembly programming back in the day, so have a fondness for the 6502. I've never had much to do with electronics, but was always interested in learning more about the underlying hardware. I have had a go at a 6502 build and I've got it to the point where everything is working.
It has been an interesting few weeks and I've learnt a lot. The main difficulties were trying to run before I could walk, and breaking the build down to small steps. I also had lots of issues with random errors but once I'd changed the power to a radial fan-out design it seems more stable now. I guess I dont know what I dont know!
I didnt want to waste RAM addresses so have the following address scheme:
$0200-$02FF - 6522 and future I/O
$0000-$7FFF - RAM
$8000-$FFFF - ROM
The address decoding isn't the most efficient, but at 1MHz it doesn't need to be. I've got some GAL22V10s and I'll replace the address decoder with one, as the propagation delay worst case is currently around 60ns on the 74 logic. It is okay for now, but I want to get a PCB designed (already got the schematic and layout done) and get it running faster.
Next step will be to add some type of monitor software and get a serial line to my PC working. I'd like some way to automatically download programs from my PC to the 6502. I thought about doing a ROM emulator at first, but think I'll keep the ROM for a minimal type BIOS/OS and then get something working to hijack the 6502, tri-state it, load to SRAM and then re-activate the 6502 bus. Reprogramming the EEPROM gets boring very quickly! Reading on the forum here seems as though it wont be too difficult hopefully.
Re: First build
Posted: Thu Oct 15, 2020 8:02 pm
by drogon
Looks good to me!
I'd probably suggest taking a page out of the ROM area rather than the RAM area to save that "precious" RAM - but possibly because traditionally, well, in my own designs and the commercial 6502 systems I used back "in the day" all did it that way. My own 6502/65816 boards decode $FE00 - $FEFF for IO, so the top page is for hardware (and software) vectors leaving th rest of my "ROM" space for the OS, BASIC, etc.
I use a single 22v10 GAL for my decoding. you should be able to replace those 3 TTL chips with a single GAL if that's your aim.
-Gordon
Re: First build
Posted: Thu Oct 15, 2020 8:45 pm
by floobydust
As Gordon said, looks good! Congrats on getting an initial system working.
I also have a simple view on how to divide up the address space on the 65(c)02. From a logical view, you need memory at the bottom end, as Page Zero is a special place, followed by the Processor Stack. Likewise, you need ROM at the top, as that's where the vectors for Reset/NMI/IRQ(BRK) are. I also take the approach of using page $FE for I/O and use a 32KB Static RAM for the lower 32KB and a 32B EEPROM for the upper 32KB. I use an ATF22V10CQZ PLD for a single glue chip. My config results in 5- I/O selects that are 32 bytes wide each, a RAM and ROM select, plus PH2 qualified Read and Write signal. This gives good flexibility and you can easily change the RAM and ROM ranges.
Best of luck in making some upgrades to your initial system... and perhaps implement a version on a PCB.
Re: First build
Posted: Fri Oct 16, 2020 11:33 am
by deanflyer
Thanks.
I tidied up the electrical distribution last night and it now runs at over 9MHz, quite surprised! That is with 55ns SRAM and the standard 74HC address decoder. I'll see how I get on with having the GAL22V10 as the decoder.
Good idea about using ROM space for the I/O, as it's in higher address space the decoding will be simpler.
Re: First build
Posted: Fri Oct 16, 2020 1:25 pm
by floobydust
My older 65C02 system runs fine at 10MHz with 74HC logic, 70ns RAM/ROM and has a short ribbon cable between the CPU board and the I/O board. These are both 2-layer boards as well.
Back to using a 22V10 decoder... here's how mine is configured (thanks to cbscpe for changes):
Code: Select all
Name Glue3 ;
PartNo 01 ;
Date 10/31/2017 ;
Revision 01 ;
Designer KM ;
Company Analogue Technologies ;
Assembly SBC2 ;
Location ;
Device g22v10 ;
/* *************** INPUT PINS *********************/
PIN 1 = CLK ; /* */
PIN 2 = A15 ; /* */
PIN 3 = A14 ; /* */
PIN 4 = A13 ; /* */
PIN 5 = A12 ; /* */
PIN 6 = A11 ; /* */
PIN 7 = A10 ; /* */
PIN 8 = A9 ; /* */
PIN 9 = A8 ; /* */
PIN 10 = A7 ; /* */
PIN 11 = A6 ; /* */
PIN 13 = A5 ; /* */
PIN 23 = RW ; /* */
/* *************** OUTPUT PINS *********************/
PIN 14 = !IO1 ; /* */
PIN 15 = !IO2 ; /* */
PIN 16 = !IO3 ; /* */
PIN 17 = !IO4 ; /* */
PIN 18 = !IO5 ; /* */
PIN 19 = !ROM ; /* */
PIN 20 = !RAM ; /* */
PIN 21 = !MWR ; /* */
PIN 22 = !MRD ; /* */
/** Declarations and Intermediate Variable Definitions **/
FIELD ADDRESS = [A15..0];
RAM = ADDRESS:['h'0000..7FFF];
IO1 = ADDRESS:['h'FE00..FE1F];
IO2 = ADDRESS:['h'FE20..FE3F];
IO3 = ADDRESS:['h'FE40..FE5F];
IO4 = ADDRESS:['h'FE60..FE7F];
IO5 = ADDRESS:['h'FE80..FE9F];
ROM = ADDRESS:['h'8000..FDFF]
# ADDRESS:['h'FEA0..FFFF];
/** Logic Equations **/
MWR = (CLK & !RW);
MRD = (CLK & RW);
Re: First build
Posted: Fri Oct 23, 2020 4:32 pm
by deanflyer
Had some time today to play with WinCupl and the GAL22V10. Had a few doh! moments, but its working fine now with the GAL in place and it has reduced the size of the board now that I've got rid of the 74 logic. My wavegen only goes to 10MHz but its running stable at that speed, and im happy with that for now. I got 10 x GAL22V10 from Aliexpress for £7 so cant complain!
I also tried using the FIELD value for inputting addresses directly in WinCupl but it kept complaining about intermediate values.
Code: Select all
Name decoder1 ;
PartNo 00 ;
Date 23/10/2020 ;
Revision 01 ;
Designer Engineer ;
Company Dean ;
Assembly None ;
Location ;
Device g22v10 ;
/* *************** INPUT PINS *********************/
PIN 1 = CLK ; /* */
PIN 2 = A15 ; /* */
PIN 3 = A14 ; /* */
PIN 4 = A13 ; /* */
PIN 5 = A12 ; /* */
PIN 6 = A11 ; /* */
PIN 7 = A10 ; /* */
PIN 8 = A9 ; /* */
PIN 9 = A8 ; /* */
/* *************** OUTPUT PINS *********************/
PIN 18 = !RAM_CS ; /* */
PIN 19 = !ROM_CS ; /* */
PIN 20 = !VIA_CS ; /* */
/* *************** EQUATIONS *********************/
ROM_CS = A15;
VIA_CS = !A15 & !A14 & !A13 & !A12 & !A11 & !A10 & A9 & !A8;
RAM_CS = CLK & !ROM_CS & !VIA_CS;
Re: First build
Posted: Fri Oct 23, 2020 4:54 pm
by Shawn Odekirk
Nice!
I also tried using the FIELD value for inputting addresses directly in WinCupl but it kept complaining about intermediate values.
If you post what you tried for FIELD there are a couple of us who might be able to help.