Close
0%
0%

ABNielsen.com 6502 SBC r0

Complete 6502 single board computer with 50x29 lines "VGA" output and PS/2 input

Similar projects worth following
Update: The new version is live on https://hackaday.io/project/184725-abn6502-sbc-r1

Reduce, reuse, recycle. Let's solve the global IC shortage! Instead of making a retrocomputer out of mostly factory new parts still in production this project aims to use as many reused parts as possible. Instead of sending more parts to a landfill when you're done with it, this computer takes landfill parts and puts them to practical use, learning to use a 6502.

It's very easy to get a 6502, 6522, along with 28 pin RAM and ROM from the usual Ebay/Aliexpress sources but since you can't be sure exactly what you get, this project has jumpers for CMOS or NMOS 6502's. It works with either 28 pin or 32 pin ROM, also jumper selectable.

The project uses Ben Eater's easy way of interfacing PS/2 to parallel.

Basic software features include a monitor program and IO commands to read, write and execute code.

Hardware revision 0 is missing a few features but is a complete prototype that makes it ease to write bitbanging SPI or connect a second 6522(and third) via the broken out address/data bus line of 2.54mm header - on r0 I forgot to break out the IO-select signal, so connecting multiple 6522's(or other IO) does require a bodge-wire to ~CS2.

One oddity of the build, I have to admit, is the choice of a PMS171b as a glue logic/V-sync generator. At the time I needed a working prototype and just grabbed the cheapest MCU I could find. I'm planning to replace some of the 74ls161's 4bit counters with 74hc590 8 bit counters - which should free up some board space and require fewer lines with tristate buffers (74hc245's). 

Hardware Memory Map

$0000-3FFF: ZP, Stack and RAM
$2000-27FF: Part of RAM is set aside for video RAM. Not all of it is used on screen but all is reserved. (For blanking etc)

$4000-7FFF: Input/output, etc. Onboard 6522 has address $6000.
A second, and third, and fourth 6522 can easily be added off board by using A13, A12, and A11 as CS1 and the same !CS2. The other VIA's would be addressable at $5000, $4800 and $4400.
$8000-FFFF: ROM (including reset, irq and nmi vectors at $FFFA-F)

OS Syntax

The OS isn't much for spitting out syntax errors or any help for that matter. 

Current commands are:

read <16 bit address, MSB-first>

The read command enters monitor starting at the specified address. 

write <start 16bit address, MSB-first> <data> [<data>..<data>]

The write command writes starting at the specified address and then enters monitor.

Exit monitor by pressing ESC

run (Jumps to the address contained in $30 and $31, LSB in $30 (!))

F1-key enters monitor without changing address.

  • 1 × 6502 CPU - either CMOS or NMOS.
  • 1 × 62256 RAM
  • 1 × 6522 VIA
  • 1 × pms171b Padauk OTP MCU (7 cent part, 100$ programmer)
  • 1 × w27c512 Memory ICs / EEPROMs

View all 20 components

  • Thanks for now! Please check out the ongoing new revision!

    Anders Nielsen04/13/2022 at 13:57 0 comments

    Thank you so much to everyone who followed and liked this project. 

    Even though this project is finished, the journey is far from over. 

    The project page for Revision 1 has been updated with lots of logs and I hope you will all check it out here: https://hackaday.io/project/184725-abn6502-sbc-r1

    -Anders

  • Revision 1 is now live on hackaday.io

    Anders Nielsen04/05/2022 at 11:50 0 comments

    I can proudly announce the project made it the hackaday.com blog right before it was officially completed and superseded by Revision 1. 

    https://hackaday.com/2022/04/05/wireless-bootloader-saves-you-from-swapping-rom-chips/

    All my efforts will now be focused on the new project page - you're welcome to follow that too :)

    https://hackaday.io/project/184725-abn6502-sbc-r1 

  • r0 is dead! Long live R1!

    Anders Nielsen04/04/2022 at 07:48 0 comments

    Github has been updated with R1 of my SBC.

    https://github.com/AndersBNielsen/abn6502

    Since this actually turned out to be a complete rerouting of the whole board, I finally got rid of the - now unobtainium - PMS171b, and the firmware also got quite an overhaul I'm finishing up this project and moving on... To R1! 

    R1 will get it's own project on hackaday.io because they are simply too different - naming-wise I'll just call it R1 :) 

    Check out one of the upgrades here - as you see the board is quite different:

    I'll post a final log here when R1 has it's own project page. 

  • Driving WS2812B LED's was fun... What's next?

    Anders Nielsen01/05/2022 at 15:36 0 comments

    As some people have noticed I managed to rainbow some WS2812B LED's with my SBC.

    Since I'm writing a wireless bootloader(surprise!) I think I will take the rainbow code and move it to "userland" instead of keeping it as a permanent part of the ROM..  Or maybe I will keep the basic "send pixel" subroutines so the firmware will still reset LED's on boot and you can call subroutine addresses from userland by simply setting R G and B zero page locations.

    Either way I don't feel code organization is my strong side and the current zero page layout can really use a manual defragmentation. 

    I always meant for my SBC to have a simple "monitor" firmware that is barely able to let the user type in assembly programs. 

    I have a feeling the upper limit of the firmware will be a(very) simple resident assembler + disassembler - typing mnemonics straight to RAM might be "fun". 

    As for hardware changes I still haven't had a chance to test the "VGA" output reset modification  and I really want to switch out the 4 bit counters with tristate 8 bit counters ( 74HC590's should work.. Right?) so I only need '245's on 6502 side... And for now sadly the PMS171B since I can't tristate that either.  That thing really has to go :) 

    Lot's of things to do and not much time to do them...

  • PCB Annotations added to silkscreen

    Anders Nielsen10/30/2021 at 12:26 0 comments

    I always tend try to get things into production fast. This has a tendency to involve limited redundant information - said another way: I don't add silkscreen information already present on the schematic.

     
    I believe I've reached a point where I know another revision of this board is coming eventually , so I decided to add some silkscreen text - if nothing else, so I don't forget that the broken out data and address busses have LSB on the left when the VGA port is pointing away from you :) 

    Note: The Gerbers.zip hasn't been updated this time - if you are about to send them off to manufacture, maybe replot them from Kicad :) 

  • Video online!

    Anders Nielsen10/30/2021 at 11:55 0 comments

    Yay! I finally pulled myself together and made a short video about my 6502 SBC :)

  • Untested fixes in r1

    Anders Nielsen10/21/2021 at 15:33 0 comments

    The new revision on Github has a few differences to the last tested version. 

    On r0 pin 15 of U20 (Chip enable of the VGA signal) is connected to ground. On r1 it is connected to the inverted reset signal(through a spare inverter on U14) through a pullup resistor. 

    Technically this should make it possible to RC-delay the VGA output signal until the VRAM is cleared by code - instead of having random data in the blanking periods that could damage a real CRT screen. 

    If this was really ~1979 I would definitely implement the VGA blanking periods in hardware.

  • [FANFARE]

    Anders Nielsen10/21/2021 at 08:56 0 comments

    The project files are now on Github!

    This included Kicad board files

    https://github.com/AndersBNielsen/abn6502

  • r0 photos uploaded

    Anders Nielsen10/21/2021 at 07:45 0 comments

    Photos of my SBC have now been uploaded - on r0 traces have been cut and A14 bodged to the RAM OE.

  • Code cleanup complete

    Anders Nielsen10/20/2021 at 13:34 0 comments

    Not that I'm particularly proud of my 6502 assembly, but I just managed to remove enough stub code that it only does the bare minimum - and doesn't have half-written subroutines for things coming in the future. 


    I guess it's ready for github :) 

View all 11 project logs

  • 1
    Send gerber files to your favorite board house

    The files are available from /hardware on the Github repo. You can also rebuild the files with Kicad. 

  • 2
    Build the project using assemble.sh

    This will also try to burn the main ROM using Minipro. Dependencies: [CC65] (https://github.com/cc65/cc65), the Padauk IDE (working on replacing the PMS171b with 7400 logic) and a way to burn the ROM's.
    If you don't like the movie reference, you can edit the welcome message in abn6502rom.s :)

  • 3
    Burn the ROMs and PMS171B

    I use a TL866II Plus variant for the actual ROMs and the Padauk official programmer for the PMS171B.

View all 7 instructions

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates