DANI-I 6502 SBC

Topics related to the SBC- series of printed circuit boards, designed by Daryl Rictor and popular with many 6502.org visitors.
Post Reply
ChaseHQ85
Posts: 38
Joined: 21 Feb 2017

DANI-I 6502 SBC

Post by ChaseHQ85 »

Hey All,
Been on this forum for quite some time (since the beginning of my venture into 6502). I have finally completed my project in it's entirety and wanted to share it with you all, especially due to all the tips and tricks I've learned from the community along the way. My project will be completely open sourced (for the most part, I just have to upload my KiCad schematics and gerber files to github). Here was my design guidelines and the things I was able to tackle.

For the Main System
  • 6502 CPU
  • 32k SRAM
  • Real Time Clock
  • 6522 VIA
  • PS2 Keyboard Support
  • 16k ROM
  • Custom Monitor
  • EhBasic Ported
  • SD Card support (Load/Save)
For the Graphics
  • Custom VGA GPU via FPGA
  • Character based graphics
  • 6-bit color
  • Dual Port RAM (4k) for VRAM
  • 32k SRAM for character RAM with programmable characters up to 256
For development
  • Custom ROM Flasher
  • Device for stepping through the 65c02 and viewing ADDR bus & Data Bus
  • cc65 target for compiling C code against it
Keep in mind when I started this project, I had zero knowledge of VHDL & zero knowledge of 6502 assembly. By trade I'm a network engineer with background in Computer Science and I have always loved tinkering with electronics as a hobby. I cannot believe as I look back at this list that I put out for myself that I was able to complete all the things listed in any way shape or form. I knew my sights were ambitious but with enough stick-to-itiveness I guess anything is possible. If you do get a chance to look over my VHDL code for my VGA GPU and my 6502 assembly for my Monitor please keep in mind I am a newbie so you very may well come across areas that could cause you to scratch your head. For many parts of this it was my first time ever developing/engineering for these things. I can express how much I have learned doing this. If you are on the brink of starting a project and you say to your self, "Hmmm, I'm not sure I can do that." just try. You will learn more failing at what you don't know than continuing to tinker with what you do know.

Here are some of my milestones in pictures -

First time getting HSYNC and VSYNC working on the FPGA to get a 640x480 signal recognized by a monitor
FPGA Start
FPGA Start
I got 6-bit color working! Displaying the full palette
2.png
I have my pseudo registers working, and able to tell the VGA GPU to save my Characters to Character SRAM
3.png
The Dual Port RAM is now interfacing with a VGA debugging device I created, It is accurately showing text on screen
4-ed.png
The day I placed the 65C02 on the breadboard, exciting moment
5.png
Adding the SRAM, ROM, and the Glue Logic to select everything
I never really realized how important placement is on a bread board until months later
6.png
Wiring the busses up
Months later I would realize using this type of wiring was horrible, I wish I cut hookup wire and did it all properly. All part of learning though
7.png
Custom Debugging board
I created this custom debugging board to allow me to step the 65C02 and look at what is on the data bus as well as the address line through the 7 Segment LEDs
8.png
Hello World
Another huge moment for me, getting some 6502 code assembled and have it print Hello World on screen
9.png
The beginning of DANI-I Monitor
It had ROM functions for printing strings, clearing the screen and showing simple tile based graphics
10.png
Keyboard Support!
At this point I had placed the VIA, used a Port on it, Set up a PIC16F1509 to translate keyboard scan codes into bytes that could pull the interrupt on the VIA and send it to an input buffer. I implemented simple commands like Peek & Poke and the monitor was really taking shape.
Keyboard Support
Keyboard Support
Drive & RTC Implemented
At this point the sky was the limit, I had implemented a PIC18F that would communicate over i2c to a RTC & over SPI to a SDCard. Then a simple protocol that could talk to it over the VIA port. Suddenly the world opened up as I was able to Read / Write to SD Cards & have a working clock. Shortly after I ported over EhBasic and implemented LOAD & SAVE commands
12.png
Version 2.0 Of The DANI-I Monitor
Introduced EhBasic, DUMP Command, WRITE commands, JMPR, LOAD, SAVE, DIR - basically everything i needed to load programs off of SDCARD as a binary, or from basic and execute them
DUMP
DUMP
Directory
Directory
KiCAD & Schematics
Probably the most fulfilling point of this project was when these guys came in, I designed, routed and sent off for PCB's to be printed. I checked the mail every day for them to come in.
14.png

Solderfest 2022
15.png
16.png
The payoff
Hooking it up and booting up for the first time was insanely nerve wracking for some reason. It felt great to finally see this through tho.
17.png
In action... via gif (Click on me to see it work!)
At this point I forked CC65 and created a target for my system. I started to build all sorts of small projects and games in C. Seeing it working and interfacing with my ROM functions felt out of this world
DANI-I.gif
What an incredible feeling guys. Like I said I am such a complete newbie at this but it was such a great learning experience. I will add my github repo's below, and as I said earlier, try not to laugh too much at my code, I am no way shape or form an experienced 6502 developer. And please leave me some questions or comments I'd love to discuss some things i've learned along the way.

Github: DANI-I-SYSTEM-ROM
Github: DANI-I-Keyboard Controller Firmware
Github: DANI-I-Drive Controller Firmware
Github: DANI-I-VGA VHDL FPGA Source
Github: CC65 Fork with DANI-I Support as a Target
DANI-I SBC.pdf
PDF of the DANI-I SBC Schematics
(476.41 KiB) Downloaded 213 times
Last edited by ChaseHQ85 on Fri Jul 22, 2022 11:16 am, edited 6 times in total.
User avatar
BigDumbDinosaur
Posts: 9428
Joined: 28 May 2009
Location: Midwestern USA (JB Pritzker’s dystopia)
Contact:

Re: DANI-I 6502 SBC

Post by BigDumbDinosaur »

Man, you've been busy! Looks great.
x86?  We ain't got no x86.  We don't NEED no stinking x86!
User avatar
BigEd
Posts: 11464
Joined: 11 Dec 2008
Location: England
Contact:

Re: DANI-I 6502 SBC

Post by BigEd »

Wonderful! Congratulations for learning all the things you needed and for finishing the project - and thanks indeed for sharing the story with pictures - and the code!
User avatar
Proxy
Posts: 746
Joined: 03 Aug 2018
Location: Germany

Re: DANI-I 6502 SBC

Post by Proxy »

very impressive to go from 0 to your own SBC!

though, personally i find it better to have 1 github repository for a project instead of multiple repositories for each part of a project.
keeps everything tidy and in one place for convenience, and makes it easier to find any specific thing as you don't need to go searching through the user's profile.

also i can't seem to be able to find any schematic files. in Kicad you can export a Schematic as a Monochrome PDF under File -> Plot -> PDF, which you can then directly upload to here, so people can look at it without going to an external site. (and the Monochrome part is because some people on here are color blind)

but besides those, that is a pretty good looking project, many things to play around/experiment with! for example, did you implement an existing file system to access your SD Card, or something custom? if it's custom then one idea is to try and implement the FAT16 file system so you can move files between your PC and SBC.
also if you ever feel the need to go for a version 2 or even a completely new SBC desing, one idea i can give you is trying to figure out how you could replace the Dual Port RAM with regular SRAM (as it's usually much cheaper and comes in greater capacities, and more VRAM = more potential for Graphics like a Bitmap Mode). you do have an FPGA so there are a billion ways to do it, and there already are some projects on here that do use regular SRAM for VRAM and share it between the CPU and Video Circuit.
So i'm sure you can think of something.
ChaseHQ85
Posts: 38
Joined: 21 Feb 2017

Re: DANI-I 6502 SBC

Post by ChaseHQ85 »

Proxy wrote:
also i can't seem to be able to find any schematic files.
Sorry! I have now added the Schematics as a PDF, it's the last link on my original post
Proxy wrote:
if it's custom then one idea is to try and implement the FAT16 file system so you can move files between your PC and SBC.
Yes! The filesystem is Fat32! It's how In my gif I compile a program i've made with CC65, xfer it over to my SBC and run it. Once I had that up and running, it was such a breeze to continue to write and test code on my SBC. I even have it read the disk label when you do a Dir listing and show it on screen. The only thing i currently do not support are directories other than the root.
ChaseHQ85
Posts: 38
Joined: 21 Feb 2017

Re: DANI-I 6502 SBC

Post by ChaseHQ85 »

BigDumbDinosaur wrote:
Man, you've been busy! Looks great.
BigEd wrote:
Wonderful! Congratulations for learning all the things you needed and for finishing the project - and thanks indeed for sharing the story with pictures - and the code!
Thanks, and a thank you to you guys! I know there are a couple of times in forum posts you both played a part in overcoming a bug that I encountered!
plasmo
Posts: 1273
Joined: 21 Dec 2018
Location: Albuquerque NM USA

Re: DANI-I 6502 SBC

Post by plasmo »

ChaseHQ85 wrote:

Yes! The filesystem is Fat32! It's how In my gif I compile a program i've made with CC65, xfer it over to my SBC and run it. Once I had that up and running, it was such a breeze to continue to write and test code on my SBC. I even have it read the disk label when you do a Dir listing and show it on screen. The only thing i currently do not support are directories other than the root.
Developing usable FAT filing system and use it to transfer updated programs between workstation and 6502SBC is a great idea. My background in CPM caused me to think serial transfer as the way to develop new computer, but serial port is extra hardware and I always need to arbitrate inputs from serial port or keyboard as well as output to serial port and video port. Well done!
Bill
User avatar
drogon
Posts: 1671
Joined: 14 Feb 2018
Location: Scotland
Contact:

Re: DANI-I 6502 SBC

Post by drogon »

plasmo wrote:
Developing usable FAT filing system and use it to transfer updated programs between workstation and 6502SBC is a great idea. My background in CPM caused me to think serial transfer as the way to develop new computer, but serial port is extra hardware and I always need to arbitrate inputs from serial port or keyboard as well as output to serial port and video port. Well done!
Bill
A non 65xx system I'm working on where I have serial terminal attached, I'm working on a "thingy" that allows block transfers to/from a file on the host system. (Note a file and not files).

So from the SBC side, it has the FAT filesystem code which at it's lowest level calls "read block X" or "write block X" and maybe "select block device Y" so that can be sent to an SD card, CF, etc. or multiple devices or partitions... or to a bit of software that sends a code down the serial line - and at the other end of the serial line is my "smart" terminal which is doing stuff like graphics, text and so on, so the magic code is just another thing to interpret where it then reads the block from a large fixed-size file (say 32MB) and sends the block down the wire (or reads the block up the wire and writes it).

Under Linux this file can be loopback-mounted so it's then easy to read/write files into it as a mounted filesystem. At the SBC end, it's no different and writing he serial block device driver is probably less work than an SPI block device driver for e.g. SD card.

I know this technique has been used elsewhere, but it's not hard if you already have a Linux terminal program to work with.

-Gordon
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/
ChaseHQ85
Posts: 38
Joined: 21 Feb 2017

Re: DANI-I 6502 SBC

Post by ChaseHQ85 »

plasmo wrote:
ChaseHQ85 wrote:

Yes! The filesystem is Fat32! It's how In my gif I compile a program i've made with CC65, xfer it over to my SBC and run it. Once I had that up and running, it was such a breeze to continue to write and test code on my SBC. I even have it read the disk label when you do a Dir listing and show it on screen. The only thing i currently do not support are directories other than the root.
Developing usable FAT filing system and use it to transfer updated programs between workstation and 6502SBC is a great idea. My background in CPM caused me to think serial transfer as the way to develop new computer, but serial port is extra hardware and I always need to arbitrate inputs from serial port or keyboard as well as output to serial port and video port. Well done!
Bill
The moment Fat32 was implemented the speed of development skyrocketed. The ability to assemble some code and run it instantly via an SD-Card was amazing.
Post Reply