{"id":15564165,"url":"https://github.com/and3rson/deck65","last_synced_at":"2025-04-09T17:05:18.031Z","repository":{"id":66108515,"uuid":"603595263","full_name":"and3rson/deck65","owner":"and3rson","description":"Simple SBC based on 65c02s","archived":false,"fork":false,"pushed_at":"2023-11-28T11:21:28.000Z","size":123161,"stargazers_count":13,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-09T17:05:01.934Z","etag":null,"topics":["6502","65c02","asm","ca65","digital","diptrace","gal","kicad"],"latest_commit_sha":null,"homepage":"","language":"Assembly","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/and3rson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-02-19T01:38:30.000Z","updated_at":"2025-03-09T04:02:11.000Z","dependencies_parsed_at":"2023-02-26T06:30:27.978Z","dependency_job_id":"969cf60b-f928-4735-8bf1-9a88575bd730","html_url":"https://github.com/and3rson/deck65","commit_stats":null,"previous_names":["and3rson/deck65"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/and3rson%2Fdeck65","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/and3rson%2Fdeck65/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/and3rson%2Fdeck65/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/and3rson%2Fdeck65/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/and3rson","download_url":"https://codeload.github.com/and3rson/deck65/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248074976,"owners_count":21043490,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["6502","65c02","asm","ca65","digital","diptrace","gal","kicad"],"created_at":"2024-10-02T16:39:06.388Z","updated_at":"2025-04-09T17:05:18.010Z","avatar_url":"https://github.com/and3rson.png","language":"Assembly","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deck65\n\nHomebrew 6502-based single-board computer with WiFi, built-in mechanical keyboard, uSD card adapter, I2C/SPI, EEPROM, \u0026 RTC.\n\n![Deck65 SBC](./img/case_9_live.jpg)\n![Deck65 SBC](./img/v2_0_assembled2.jpg)\n![Deck65 SBC](./img/v2_0_pcb3.jpg)\n\n- New discussion: \u003chttp://forum.6502.org/viewtopic.php?f=6\u0026t=7682\u003e\n- Original thread (old SBC version): \u003chttp://forum.6502.org/viewtopic.php?f=12\u0026t=7501\u003e\n\nPull with `git pull --recurse-submodules`.\n\n# Memory map\n\n```\n+--------------+-------+------------------+------+------------------------------------------+\n| RANGE        | TYPE  | ADDR             | SIZE | Notes                                    |\n+--------------+-------+------------------+------+------------------------------------------+\n| $0000..$0FFF | RAM   | 0000------------ | 32 K | /EN = A15                                |\n| $1000..$1FFF |       | 0001------------ |      | $0000..$1000 - zeropage \u0026 video buffer   |\n| $2000..$2FFF |       | 0010------------ |      | $1000..$7FFF - programs from SD Card     |\n| $3000..$3FFF |       | 0011------------ |      |                                          |\n| $4000..$4FFF |       | 0100------------ |      |                                          |\n| $5000..$5FFF |       | 0101------------ |      |                                          |\n| $6000..$6FFF |       | 0110------------ |      |                                          |\n| $7000..$7FFF |       | 0111------------ |      |                                          |\n+--------------+-------+------------------+------+------------------------------------------+\n| $8000..$8FFF | LOROM | 1000------------ | 16 K | /EN = NAND(A15, NAND(A14))               |\n| $9000..$9FFF |       | 1001------------ |      | Contains OS (\"MicroREPL\")                |\n| $A000..$AFFF |       | 1010------------ |      |                                          |\n| $B000..$BFFF |       | 1011------------ |      |                                          |\n+--------------+-------+------------------+------+------------------------------------------+\n| $C000..$CFFF | N/C   | 1100------------ | 4 K  | Unused, may add extra '138 with /GA=/A13 |\n+--------------+-------+------------------+------+------------------------------------------+\n| $D000..$DFFF | I/O   | 1101------------ | 4 K  | G = A12, /GA = A13, /GB = NAND(A15, A14) |\n|              |       | 1101-000-------- | 256B | $D000..$D0FF - RAM banking register      |\n|              |       | 1101-001-------- | 256B | $D100..$D1FF - 6522 VIA                  |\n|              |       | 1101-010-------- | 256B | $D200..$D2FF - 6551 ACIA                 |\n|              |       | 1101-011-------- | 256B | $D300..$D3FF - T6963C LCD (240x64)       |\n+--------------+-------+------------------+------+------------------------------------------+\n| $E000..$EFFF | HIROM | 1110------------ | 8 K  | /EN = NAND(/NAND(A15, A14), A13)         |\n| $F000..$FFFF |       | 1111------------ |      | Contains Kernel (\"Kore\")                 |\n+--------------+-------+------------------+------+------------------------------------------+\n\nLOROM (10xx) || HIROM (111x):\n/EN = A15 \u0026\u0026 (/A14 || (A14 \u0026\u0026 A13))\n/EN = NAND(A15, /A14 || /NAND(A14, A13))\n/EN = NAND(A15, NAND(A14, NAND(A14, A13)))\n```\n\n# Features\n\n- W65C02, 512 KB RAM (32KB visible to CPU, banked into 4 x 8 KB segments)\n- 240x64 LCD display (T6963C)\n- Built-in [mechanical PS/2 keyboard](./keyboard), powered by ATmega328P\n- Internet! Works through ESP-01\n- VIA W65C22\u003cins\u003eN\u003c/ins\u003e(6TPG-14)\n\n  Provides:\n  - SPI (used for Micro SD Card adapter)\n  - I2C (used for RTC \u0026 EEPROM)\n  - PS/2 host (used for built-in or external keyboard)\n- ACIA W65C51\u003cins\u003eN\u003c/ins\u003e(6TPG-14)n\n\n  Provides:\n  - Communication with ESP-01\n  - Communication with external devices through pin header\n  \u003e Note: I'm using NMOS-compatible versions of VIA \u0026 ACIA (\u003cins\u003eN\u003c/ins\u003e suffix) with open-drain /IRQ line.\u003cbr /\u003e\n  \u003e See http://archive.6502.org/datasheets/wdc_w65c22_sep_13_2010.pdf (page 25) for more details.\n- Address decoder \u0026 underclocking - [ATF16V8B-15PU](./gal)\n  \u003e Main crystal is 16 MHz, and the CPU runs at either 8 MHz or 2 MHz.\u003cbr /\u003e\n  \u003e Reason for this is that T6963C LCD can only operate on up to 2.75 MHz.\u003cbr /\u003e\n  \u003e So when CPU needs to acccess the LCD, ATF16V8 divides clock speed by 4, bringing it down to 2 MHz.\u003cbr /\u003e\n  \u003e This is done by implementing a 2-bit counter using registered outputs.\n- Memory banking: 74LS670\n  \u003e Entire RAM (first 32 KB) is divided into 4 x 8 KB segments.\u003cbr /\u003e\n  \u003e Each segment can use one of its own 16 banks.\u003cbr /\u003e\n  \u003e This allows to selectively bank parts of RAM in and out.\u003cbr /\u003e\n  \u003e Using a machine-tooled socket actually allows to connect JCO-8 or JCO-14 oscillators.\n- Traco Power TSR 1-2450 (drop-in replacement for 7805)\n  \u003e It runs much cooler than L7805 since it's a switching regulator.\u003cbr /\u003e\n  \u003e I use them a lot, although they are not as cheap as 7805.\n\nV2.0 schematic:\n![65c02s SBC PCB](./img/v2_0_schematic.png)\n\n# ROM\n\nKernel code currently provides the following features:\n- Simple REPL shell to monitor memory \u0026 run programs\n- 128x64 LCD (through VIA)\n- PS/2 keyboard (through VIA)\n- Micro SD Card in SPI mode (through VIA)\n- I2C \u0026 SPI support\n- Basic FAT16 support - listing root folder, loading/executing programs\n\n# Resources\n\n- [Kicad files](./kicad) - \u003chttps://www.kicad.org/\u003e\n- [DipTrace PCBs](./diptrace) - \u003chttps://diptrace.com/\u003e\n- [Circuits](./circuits) (created with [Digital](https://github.com/hneemann/Digital))\n- [ROM sources](./rom) (written in 6502 Assembly, requires [cc65](https://cc65.github.io/) compiler)\n- [SD Card programs](./sdcard) (written in 6502 C, requires [cc65](https://cc65.github.io/) compiler)\n- [Keyboard firmware](./keyboard) (written in C)\n- [GAL stuff](./gal) (hexadecimal 7-segment decoder, address decoder, etc using GAL16V8/GAL20V8, includes `galasm` as submodule)\n- [Composite video test](./compvid) using ATtiny45 (requires [avra](https://github.com/Ro5bert/avra))\n\n# So what can you do with it?\n\nPlaying snake, for example:\n\n[![Snake on 65C02 SBC](./img/snake_yt.jpg)](https://www.youtube.com/watch?v=boeysL1Isg4)\n\n# Credits \u0026 references\n- [6502.org community](forum.6502.org/) - Limitless help \u0026 support\n- https://www.masswerk.at/6502/6502_instruction_set.html\n- https://github.com/4x1md/kicad_libraries - Mini-DIN-6 symbol \u0026 footprint\n- http://39k.ca/reading-files-from-fat16/\n- https://laughtonelectronics.com/Arcana/KimKlone/Kimklone_opcode_mapping.html - cool illegal NOPs\n- https://octopart.componentsearchengine.com/part.php?partID=570717\u0026ref=octopart - Aries 28-526-10 footprint\n- https://github.com/daprice/keyswitches.pretty - MX switches\n- https://components101.com/sites/default/files/component_datasheet/Micro-SD-Card-Module-Datasheet.pdf - MicroSD card module datasheet \u0026 dimensions\n- http://static.cactus.io/docs/sensors/temp-humidity/mcp9808/25095A.pdf - MCP9808 I2C temperature sensor\n- https://ww1.microchip.com/downloads/aemDocuments/documents/MPD/ProductDocuments/DataSheets/24AA512-24LC512-24FC512-512K-Bit-I2C-Serial-EEPROM-20001754Q.pdf\n\n# Links\n- 6502 Primer: http://wilsonminesco.com/6502primer/\n- Address Selector: https://circuitverse.org/simulator/embed/6502-address-selector\n- Read-Write Selector: https://circuitverse.org/simulator/embed/6502-read-write-selector\n- SID (HVSC) format: https://gist.github.com/cbmeeks/2b107f0a8d36fc461ebb056e94b2f4d6\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fand3rson%2Fdeck65","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fand3rson%2Fdeck65","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fand3rson%2Fdeck65/lists"}