Skip to content

Latest commit

 

History

History
131 lines (110 loc) · 7.21 KB

README.md

File metadata and controls

131 lines (110 loc) · 7.21 KB

Deck65

Homebrew 6502-based single-board computer with WiFi, built-in mechanical keyboard, uSD card adapter, I2C/SPI, EEPROM, & RTC.

Deck65 SBC Deck65 SBC Deck65 SBC

Pull with git pull --recurse-submodules.

Memory map

+--------------+-------+------------------+------+------------------------------------------+
| RANGE        | TYPE  | ADDR             | SIZE | Notes                                    |
+--------------+-------+------------------+------+------------------------------------------+
| $0000..$0FFF | RAM   | 0000------------ | 32 K | /EN = A15                                |
| $1000..$1FFF |       | 0001------------ |      | $0000..$1000 - zeropage & video buffer   |
| $2000..$2FFF |       | 0010------------ |      | $1000..$7FFF - programs from SD Card     |
| $3000..$3FFF |       | 0011------------ |      |                                          |
| $4000..$4FFF |       | 0100------------ |      |                                          |
| $5000..$5FFF |       | 0101------------ |      |                                          |
| $6000..$6FFF |       | 0110------------ |      |                                          |
| $7000..$7FFF |       | 0111------------ |      |                                          |
+--------------+-------+------------------+------+------------------------------------------+
| $8000..$8FFF | LOROM | 1000------------ | 16 K | /EN = NAND(A15, NAND(A14))               |
| $9000..$9FFF |       | 1001------------ |      | Contains OS ("MicroREPL")                |
| $A000..$AFFF |       | 1010------------ |      |                                          |
| $B000..$BFFF |       | 1011------------ |      |                                          |
+--------------+-------+------------------+------+------------------------------------------+
| $C000..$CFFF | N/C   | 1100------------ | 4 K  | Unused, may add extra '138 with /GA=/A13 |
+--------------+-------+------------------+------+------------------------------------------+
| $D000..$DFFF | I/O   | 1101------------ | 4 K  | G = A12, /GA = A13, /GB = NAND(A15, A14) |
|              |       | 1101-000-------- | 256B | $D000..$D0FF - RAM banking register      |
|              |       | 1101-001-------- | 256B | $D100..$D1FF - 6522 VIA                  |
|              |       | 1101-010-------- | 256B | $D200..$D2FF - 6551 ACIA                 |
|              |       | 1101-011-------- | 256B | $D300..$D3FF - T6963C LCD (240x64)       |
+--------------+-------+------------------+------+------------------------------------------+
| $E000..$EFFF | HIROM | 1110------------ | 8 K  | /EN = NAND(/NAND(A15, A14), A13)         |
| $F000..$FFFF |       | 1111------------ |      | Contains Kernel ("Kore")                 |
+--------------+-------+------------------+------+------------------------------------------+

LOROM (10xx) || HIROM (111x):
/EN = A15 && (/A14 || (A14 && A13))
/EN = NAND(A15, /A14 || /NAND(A14, A13))
/EN = NAND(A15, NAND(A14, NAND(A14, A13)))

Features

  • W65C02, 512 KB RAM (32KB visible to CPU, banked into 4 x 8 KB segments)

  • 240x64 LCD display (T6963C)

  • Built-in mechanical PS/2 keyboard, powered by ATmega328P

  • Internet! Works through ESP-01

  • VIA W65C22N(6TPG-14)

    Provides:

    • SPI (used for Micro SD Card adapter)
    • I2C (used for RTC & EEPROM)
    • PS/2 host (used for built-in or external keyboard)
  • ACIA W65C51N(6TPG-14)n

    Provides:

    • Communication with ESP-01
    • Communication with external devices through pin header

    Note: I'm using NMOS-compatible versions of VIA & ACIA (N suffix) with open-drain /IRQ line.
    See http://archive.6502.org/datasheets/wdc_w65c22_sep_13_2010.pdf (page 25) for more details.

  • Address decoder & underclocking - ATF16V8B-15PU

    Main crystal is 16 MHz, and the CPU runs at either 8 MHz or 2 MHz.
    Reason for this is that T6963C LCD can only operate on up to 2.75 MHz.
    So when CPU needs to acccess the LCD, ATF16V8 divides clock speed by 4, bringing it down to 2 MHz.
    This is done by implementing a 2-bit counter using registered outputs.

  • Memory banking: 74LS670

    Entire RAM (first 32 KB) is divided into 4 x 8 KB segments.
    Each segment can use one of its own 16 banks.
    This allows to selectively bank parts of RAM in and out.
    Using a machine-tooled socket actually allows to connect JCO-8 or JCO-14 oscillators.

  • Traco Power TSR 1-2450 (drop-in replacement for 7805)

    It runs much cooler than L7805 since it's a switching regulator.
    I use them a lot, although they are not as cheap as 7805.

V2.0 schematic: 65c02s SBC PCB

ROM

Kernel code currently provides the following features:

  • Simple REPL shell to monitor memory & run programs
  • 128x64 LCD (through VIA)
  • PS/2 keyboard (through VIA)
  • Micro SD Card in SPI mode (through VIA)
  • I2C & SPI support
  • Basic FAT16 support - listing root folder, loading/executing programs

Resources

So what can you do with it?

Playing snake, for example:

Snake on 65C02 SBC

Credits & references

Links