Skip to the content
2 layers69.9 × 74.3 mm6502 SBC, the printed circuit board in 3D

6502 Minimal Single Board Computer: CRAB APPLE

Size
69.9 × 74.3 mm
Copper layers
2
Thickness
1.6 mm
Parts
19
Nets
44
Pads
202
Tracks, vias
767, 76
Pours
2
Routed
Yes
KiCad
KiCad 5 (file 20171130)
Created
12 Jan 2023
Updated
6 Dec 2023

Overview

6502 SBC is an open-source printed circuit board by gcswales, from the gcswales/6502-CRAB-APPLE repository on GitHub, published under the GPL-3.0 licence. It is a 2-layer board of 69.9 × 74.3 mm with 19 parts on 44 nets, routed with 767 tracks and 76 vias.

It is built around the 71256SA25Y. Its parts include 5 capacitors, 5 resistors, 5 ICs, 2 connectors and 1 diode. It belongs with the computers and single-board computers and retro computing and games boards and the PIC boards of this library.

Main components

1

README

README.md

CRAB APPLE - A MINIMAL 6502 COMPUTER

6502_SBC

This project was initially intended as a personal project but due to the level of interest I have decided to publish the documentation.

Introduction

The Crab Apple is a very simple and minimalist computer, as such is ideal for the first-time builder wanting to build their own retro-computer.

Just to clarify; the system will run most software for the Apple I computer but, due to the minimalist nature of the design, it is NOT hardware compatible with the Apple I.

Ultimately the Crab Apple is minimum complexity, minimum cost and maximum fun!

Minimal

The Crab Apple is not emulated and does not use an FPGA; the architecture is fairly standard with the exception of an 8-bit microcontroller which will be explained later.

Memory

At the heart of the Crab Apple is a 65C02 microprocessor. This is the modern version of the classic 6502 device which has a wider operating frequency (you’ll see why later) and still readily available.

The system has 32k of RAM in the form of a 28-pin static RAM chip. It has a 28-pin 8k of ROM chip; this is an EEPROM rather than the older (and considerably more expensive) EPROMs.

Memory address decoding is achieved with a single 7400 (quad NAND gate) chip. This provides quite a loose decoding of the address space and isn’t very efficient but it does the job.

Memory Map:

Start AddressEnd AddressDescription
E000FFFF8K ROM FOR OS
8000DFFFUART
00007FFF32K RAM

UART

This is the biggest hack; Rather than use several chips the Crab Apple uses a single low-cost microcontroller to act as an all-in-one serial interface. When used in conjunction with a PC running suitable terminal software the system can display text and receive keyboard input.

The microcontroller used (PIC18F15Q41) runs off an internal oscillator at 64MHz (16MIPS), however it still does not have sufficient speed to access and respond to the 6502 data bus in real-time. To over-come this the PIC also provides the system clock to the CPU. When the PIC is selected by the data bus it halts the system clock (effectively freezing time for the 6502). This enables the PIC to leisurely read from/write to the data bus, before resuming the system clock.

Despite this momentary drop in CPU clock speed, this has a negligible affect on performance. The biggest ‘bottle-neck’ in the system is the serial BAUD rate. The PIC is capable of higher BAUD rates than older devices; up to 115200. Additionally the PIC can provide a CPU clock speed up to 4MHz, further boosting performance.

Because of this momentary drop is CPU clock speed it is recommended to only use the modern MOS 65C02 CPU. At high BAUD rates, especially when downloading software, serial flow control is essential to guard against data loss/corruption. The PIC handles this in two ways;

  • The PIC uses Xon/Xoff flow control. It is recommended to have this enables in any terminal software connected to the Crab Apple.

  • The PIC uses a 256-byte deep receiver buffer. Some USB-to-TTL serial modules insist on sending their entire packet (32 bytes) despite flow control. Once the PICs buffer is 75% full it issues an Xoff to pause the data. It still has room to receive 64 bytes, so no data is lost. The PIC issues the Xon to resume data once the receive buffer is down to 25% full.

CPU Clock

To reduce cost the PIC provides a user adjustable system clock. Clock speeds of 1MHz, 2MHz or 4MHz can be selected from the BIOS menu.

CPU Reset

To reduce board complexity the PIC also provides a clean reset, which is triggered on power-up or by the user pressing the reset button.

Building

IMPORTANT UPDATE: If using the WDC 6502, pin 1 is not connected to ground. It is used to indicate that an interrupt is happening (for DMA, etc). If using a WDC 6502 it is best to gently 'bend' pin 1 so it does not sit in the DIP contact.

The schematic and PCB have been created using KiCAD, these files can be found in the ELECTRONICS folder.

You can buy the PCB from here: PCBWay

The bill of material (BOM) uses Mouser codes and prices as on January 2023, however buying from Ebay will considerably reduce the cost (buyer be ware!).

I recommend using IC sockets so the ICs can be removed (especially the ROM for programming). As with any build; start with the smallest (profile) parts and build up to the taller components; resistors, capacitors, button, IC sockets, serial connector then LED last.

PIC18 Programming

To program the PIC18F you will need a PICKIT4 programmer, I do not think the PICKIT3 is compatible with the newer PICs. I cannot comment on the PICKIT3.5 clones.

You will also need to download and install the free programming IDE MPLABX: MPLABX

The source code is written in XC8, the compiler can be downloaded for free: XC8

If you prefer to keep it simple the HEX code is here: HEX

The PIC18 can be programmed in-circuit by connecting to the serial connector on the board. You will need to access the PICKIT4 options and enable the PICKIT4 to provide 5V power to the board.

SERIAL PINPICKIT4 PIN
1**
2ICSPDATA
3MCLR
4Vdd
5ICSPCLK
6GND

** PIN1 is the pin closest to the silk screen legend ‘J1’.

ROM Programming

You will need a suitable EEPROM programmer in order to program the EEPROM. There are many ROM images on line, I would recommend ensuring that whatever image you go for it has the obligatory WOZMON memory monitor in it. You will need to ensure the ROM image you use is targetted at the address range E000 – FFFF.

Serial Connection

The serial connections with a USB/TTL module are as follows:-

SERIAL PINPICKIT4 PIN
1**DTR
2RX
3TX
4Vcc
5CTS
6GND

** PIN1 is the pin closest to the silk screen legend ‘J1’.

image

IMPORTANT: POWER TO THE CRAB APPLE IS PROVIDED BY THE USB/TTL MODULE. ENSURE THE POWER JUMPER ON THE MODULE IS SET TO 5V AS IN THE IMAGE ABOVE.

The default BAUD rate is 19200. This can be modified by accessing the Crab Apple BIOS menu. To ensure data integrity it is recommended to enable software flow control (Xon/Xoff). A lot of Apple I software only sends carriage return (CR) without line feed (LF). For text to display correctly you may need to modify the setting in your serial terminal software to imply a LF for every CR received.

BIOS Menu

The Crab Apple BIOS menu is activated by pressing the space bar during the boot screen while the animated cursor is rotating. The menu enables the user to configure the CPU speed, serial BAUD rate and default text colour.

Here is a short video (no sound) showing the BIOS menu in action: YouTube Video

Thank you

I hope you enjoy the Crab Apple. Please post photos and comments online and feel free to modify/improve the system.

Best regards,

Geoffrey

Parts

19
QtyValueFootprintReferences
5100NCapacitor_THT:C_Disc_D5.0mm_W2.5mm_P2.50mmC1, C2, C3, C4, C5
51KResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR1, R2, R3, R5, R6
271256SAPackage_DIP:DIP-28_W15.24mm_Socket_LongPadsU3, U4
17400Package_DIP:DIP-14_W7.62mm_Socket_LongPadsU1
1Conn_01x06_FemaleConnector_PinSocket_2.54mm:PinSocket_1x06_P2.54mm_VerticalJ1
1Conn_02x20_Odd_EvenConnector_IDC:IDC-Header_2x20_P2.54mm_VerticalJ2
1LEDLED_THT:LED_D5.0mmD1
1PIC18F15Q41-IPPackage_DIP:DIP-20_W7.62mm_Socket_LongPadsU5
1SW_PushButton_Switch_THT:SW_PUSH_6mmSW1
1W65C02SPackage_DIP:DIP-40_W15.24mm_Socket_LongPadsU2

Similar boards

  • 2 layers43.9 × 27.7 mmTcd1304-4v, the printed circuit board in 3D

    Tcd1304-4v

    OpnTec/open-spectrometer-hardware

    Open source VIS spectrometer

    19 parts1.5k
  • 2 layers50 × 60 mmDebate Device, the printed circuit board in 3D

    Debate Device

    hackclub/OnBoard

    💡 Join 1,000 teenagers and make your first PCB with a $100 grant!

    19 parts915
  • 2 layers102.9 × 96.7 mmISA adapter, the printed circuit board in 3D

    ISA adapter

    polpo/picogus

    Emulation of ISA sound cards and CD-ROM on Raspberry Pi Pico (GUS, SB/Adlib, MPU-401, Tandy, CMS, Panasonic CD-ROM) with USB mouse/joystick support

    19 parts805
  • 2 layers60 × 39 mmPs2usb, the printed circuit board in 3D

    Ps2usb

    rasteri/HIDman

    Adapting USB devices to work on old computers

    19 parts432
  • 2 layers70.1 × 43.2 mmIaq device, the printed circuit board in 3D

    Iaq device

    nkitanov/iaq_board

    IAQ Board is a DIY (Do-It-Yourself) device for measuring internal air quality

    19 parts396
  • 2 layers80 × 80 mmGB BRK CPU G1, the printed circuit board in 3D

    GB BRK CPU G1

    Gekkio/gb-hardware

    Game Boy -related custom hardware by gekkio

    19 parts379CC-BY-4.0
  • 2 layers25.4 × 25.4 mmIna169, the printed circuit board in 3D

    Ina169

    Ardumower/ardumower

    Develop an open source robotic lawn mower (HW+SW reference platform)

    19 parts282
  • 2 layers58.4 × 28.6 mmNew rele, the printed circuit board in 3D

    New rele

    zmaker/arduino_cookbook

    gli sketch del nuovo progetto Arduino Cookbook e dei video di YouTube

    19 parts269

Questions

How big is the 6502 SBC PCB?

It measures 69.9 × 74.3 mm and has 2 copper layers, 1.6 mm thick.

What parts does the 6502 SBC use?

19 parts, built around the 71256SA25Y. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the 6502 SBC KiCad files?

From the gcswales/6502-CRAB-APPLE repository on GitHub, at the commit this page was made from: the board is ELECTRONICS/6502_SBC.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.

Can I use the 6502 SBC design in my own project?

Its repository publishes it under the GPL-3.0 licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).