I would like to build a 6502 based computer. I'm not very experienced so it wil be quite an ambitious project. I wanted to share my plans with you all so you have an idea about what it is I want to achieve. I have a lot of loose ends that I need to solve I will need to make a lot of choices but I have a general idea. So here is my plan.
I want to build a computer that is a bit like the early home computers from the 70's and early 80's. I want it to be in a 3D printed case with a build in parallel ascii keyboard. I want it to have two controller/joystick ports (Sub-D 9). I want to be able to control the computer via a terminal from a modern laptop. And I want it to have some kind of storage to store programs. And it also should have color video output of some kind. And also I want it to have an audio output. I want to use this computer for game development as well as os development so that is why I want to have video/audio output. I'm from 1980 so I'm a bit spoiled I just like color better than only grayscale.
Now I already did a lot of research but there are many options so here are some options I consider and ideas of what I want to achieve.
ClockI want to use a 10.738635MHz clock that I want to divide by 3 as a system clock. I need the 10.738635MHz clock for my video chip which I will discus later. By diving it by 3 it can also be used for the sound chip I would like to use. This way I would have a 3.579545MHz system clock.
The memory mapI want to build something similar as Dirk Grappendorf did with his 6502 home computer
https://www.grappendorf.net/projects/6502-home-computer/#table-of-contents. I have a 28c256 ROM chip and 62256 SRAM chip that I want to use. I want to use the same memory map:
$0000 - $00FF RAM - Zero page
$0100 - $01FF RAM - Stack
$0200 - $7EFF RAM
$7F00 - $7F1F VIA 1
$7F20 - $7F1F VIA 1
$7F40 - $7F5F ACIA
$7F60 - $7F7F Video
$8000 - $FFFF ROM
But I want to add a second 65C22 and a 65C51 chip. Here is a screenshot simulation made in Digital:
Attachment:
File comment: Address decoding
Schermafbeelding 2024-05-01 om 10.31.11.png [ 369.01 KiB | Viewed 1551 times ]
The parallel ASCII keyboardI want to build the keyboard from logic chips and Cherry MX style switches. The idea is to create a keyboard that outputs 7-bit ASCII codes that I want to connect up to a 6522 via. I have found an old schematic in an old Brochure of the Cherry B70 Pro keyboard on bitsavers
http://bitsavers.trailing-edge.com/components/cherry/keyboards/B70-05AB_Pro_Keyboard/PRO-977-2_B70-05AB_Pro_Keyboard_Brochure.pdf. This keyboard is quite complex and it has a lot of optional parts that I'm not interested in. I want to try to create something similar but a lot simpler. I like the combination of the 4-bit counters and the 74150 (16-line to 1-line data selector/multiplexer) and 74154 (4-to-16 line decoder/demultiplexer, inverting outputs) to scan a keyboard matrix. But the logic for the shift/Caps Lock (Alpha Lock in the schematic) is quite complex and I don't really understand what is going on. I did an attempt to replicate the circuit in Digital here is the result:
Attachment:
File comment: Attempt to replicate the Cherry B70 Pro keyboard logic
Schermafbeelding 2024-05-01 om 11.24.05.png [ 485.77 KiB | Viewed 1551 times ]
But unfortunately it does not work. I added an extra flip-flop to for keeping the caps lock on after clicking the key once and turn it of when clicking a second time. Unfortunately Cherry does not make alternate action switches any more since 2015
https://deskthority.net/wiki/Cherry_MX_Lock.
As I could not figure out how the logic of the Cherry B70 Pro works I tried to get something working myself. The theory is quite simple. I found the article Things Every Hacker Once Knew
http://www.catb.org/esr/faqs/things-every-hacker-once-knew/#_ascii there is a explanation about the workings of ASCII together with the Wikipedia page about the Control key
https://en.wikipedia.org/wiki/Control_key I found out how this could work. The Caps lock/Shift key toggles bit 32 or bit 16 dependent on the key you clicked (for 0-9 and keys : ; < = > ? bit 16 is toggled and for keys a-z and ` { | } ~ DEL bit 32 is toggled). The control key could be implemented by doing a bitwise AND on the key value with 0x1F.
I have a working simulation made in Digital but it doesn't take bit-5 into account yet and the clock circuit is not there yet I wanted to keep it as simple as possible and just focus on the shift/caps lock and control logic. Here is an screenshot taken from the simulation. It has tests and they all pass but the implementation is not correct. Perhaps someone has some tips or suggestions.
Attachment:
File comment: Image of the simulation in Digital
Schermafbeelding 2024-05-01 om 10.04.45.png [ 148.71 KiB | Viewed 1551 times ]
The keyboard will be on a separate PCB.
Serial connectionI'm not really sure how to get this to work as I did not researched this part but I guess it can be done the way Ben Eater did or perhaps I could use another option and use something like what was done in the W65C02SXB SBC hook up a 65C22 via up to a FT245RL and have a USB connection. But the FT245RL is a SMD chip and I'm not sure if I'm able to solder these I guess my soldering iron is not suitable for the job. I once did an attempt and failed badly. Perhaps it will be much more doable if I use a hot air gun for soldering SMD components?
Controller/joystick portsThis should be doable by connection the ports up to one of the 65C22 VIA chips. I'm not sure how to do this the proper way I guess I need to add some multiplexing. Can I use the same port of the 65C22 for both the controllers and the keyboard? I also found a sound chip and perhaps some storage device which I want to hook up to a VIA so I might need the other port for that or use the second VIA.
Audio/VideoI have a SN76489 chip for audio. I think I need to hook this up to the 65C22 to make this work. It also needs a clock
I want to use the TMS9918 chip for video output there are some schematics that can be found that use SRAM for this chip so I just can use that.
These two chips can still be found easily now, but I don't know if that will always be the case. These are old chips that are no longer made the same applies to the SN76489.
I'm a bit worried that I wont be able to replace them if one of them breaks. So I'm not really sure if I would use these chips or just use something like a Pi Pico to emulate them.
I can also get a VGA output with the Pi Pico. When I decide to use the Pi Pico I can use another clock as well. I now plan to use a 10.738635MHz clock because it is needed for the TMS9918 and when dividing it by 3 I can use it for the SN76489 and as a system clock of 3.579545MHz.
I think it is a good idea make a separate PCB for the audio and video so I will be able to replace it. This way I can also try out multiple options.
StorageKeeping it in memory and losing it when turning off the machine is a shame. So I also want to be able to store programs I write on the machine somewhere.
I don't like the idea to buy and old tape drive of floppy drive to store data so I'm looking for a more modern solution. I'm thinking about using a SD-card reader or using a compact disk but I havent decided yet. I have an old 32mb compact and a compact disk to IDE adapter that I could use. But I also have a SD-card reader breakout board.
Pfiew this was a lot of writing!
If anyone has tips, suggestions or comments I really like to hear what you all think.
Thanks!