RepositoryVHDL
MiSTle-Dev

MiSTle-Dev/C64Nano

Commodore C64 core for the Tang Nano 20K Primer 25K Mega 60k Mega 138K Pro Console60k/138k FPGA

145stars
21forks
13issues
1views

Featured achievements

The project's latest awards

1
TINIX TRENDING·Topic: c64

#1 Repository of the week

1
TINIX TRENDING·Topic: gowin

#1 Repository of the week

1
TINIX TRENDING·Topic: tang-nano

#1 Repository of the week

C64Nano

The C64Nano is a port of some MiST and MiSTer core components for the C64:

BoardFPGAsupportNote
Tang Nano 20kGW2ARHDMI / LCDDualshock or 2nd D9 Joystick via MiSTeryShield20k spare header
Tang Primer 25KGW5A-25HDMIno Dualshock, no Retro D9 Joystick, no MIDI
Tang Mega NEO 60k DockGW5AT-60HDMI / LCDtwin Dualshock
Tang Mega 138k ProGW5AST-138HDMI / LCDtwin Dualshock
Tang Console 60K NEOGW5AT-60HDMI / LCDtwin Dualshock, no Retro D9 Joystick
Tang Console 138K NEOGW5AST-138HDMI / LCDtwin Dualshock, no Retro D9 Joystick

This project relies on a MPU being connected to the FPGA. --> MiSTle-Dev wiki <--

[!NOTE] If you don't need the WIFI modem on a TN20K then even the onboard BL616 MPU (normally used for bitstream programming) can be used. A dedicated FPGA bitstream and FPGA companion firmware is needed in that configuration. The onboard BL616 MPU is presently supported for Nano 20k, Console 60k / 138k, Primer 25k, Mega 138k Pro and Mega 60k Dock. WIFI modem is supported on Console 60K / 138k and Mega 60k Dock too (requires I-PEX MHF4 connector antenna)

Original C64 core by Peter Wendrich and c1541 by darfpga.
All HID components and MPU firmware by Till Harbaum

Features:

image

Installation

The installation of C64 Nano on the Tang Nano 20k board can be done using a Linux PC or a Windows PC (Instruction).

c64 Nano on Tang Primer 25K

See Tang Primer 25K. PMOD TF-CARD V2 is required !

c64 Nano on Tang Mega NEO 60k Dock

See Tang Mega 60K NEO

c64 Nano on Tang Mega 138k Pro

See Tang Mega 138K Pro

c64 Nano on Tang Console 60k / 138k NEO

See Tang Console 60K / 138k NEO

c64 Nano with LCD and Speaker

See Tang Nano LCD

emulated Diskdrive c1541

Emulated 1541 on a regular FAT/exFAT formatted microSD card including parallel bus Speedloader Dolphin DOS 2.0. Add D64 or G64 images as you like and insert card in TN slot. LED 0 acts as Drive activity indicator.

[!TIP] Disk directory listing: (or F7 keypress)
command:
LOAD"$",8
LIST
Load first program from Disk: (or just LOAD if Dolphin Kernal active)
LOAD"*",8
RUN

c1541 DOS ROM can be selected from OSD (default Dolphin DOS 2.0, CBM DOS, SpeedDos Plus or JiffyDOS) In case a program don't load correctly select via OSD the factory default CBM DOS an give it a try.

Cartridge ROM Loader (.CRT)

Cartridge ROM can be loaded via OSD file selection.

[!TIP] Detach Cartridge by OSD: temporary Cartridge unload & Reset permanent No Disk, Save settings and System Cold Boot

[!IMPORTANT] Be aware that some Freezer Card CRT might require to use the standard C64 Kernal and the standard C1541 CBM DOS.

BASIC Program Loader (.PRG)

A BASIC Program *.PRG file can be loaded via OSD file selection. Auto RUN after load can be disabled via OSD.

Tape Image Loader (*.TAP)

A Tape *.TAP file can be loaded via OSD file selection In order to start a tape download choose C64 CBM Kernal (mandatory as Dolphin DOS doesn't support Tape). Best to save Kernal OSD selection via Save settings.

[!IMPORTANT] command: LOAD
___ Only if you have Exbasic Level II. CRT Basic loaded then use command: LOAD*
Screen will blank!

The file is loaded automatically as soon as TAP file selected via OSD (no need to press PLAY TAPE button) in case no TAP had been previously selected. As mentioned screen will blank for several seconds and then display briefly the filename of the to be loaded file. It will blank shortly afterwards again till load completed and take a lot of time... For Tape unload use OSD TAP selection No Disk and Reset or System Cold Boot

[!WARNING] After board power-up or coldboot a TAP file will not autoloaded even if TAP file selection had been saved or c64tap.tap mountpoint available ! Unblock loader by OSD TAP selection No Disk or simply select again the desired TAP file to be loaded after you typed LOAD

[!TIP] Check loaded file by command: LIST

[!IMPORTANT] command: RUN

[!NOTE] The available (muffled) Tape Sound audio can be disabled from OSD.

Kernal Loader (.BIN)

The build-in Dolphin Kernal is the power-up default C64 Kernal with an excellent C1541 speedloader.

In general Kernal ROM files *.BIN can be loaded via OSD selection. Copy a 8K C64 Kernal ROM .BIN to your sdcard and rename it to c64kernal.bin as default boot Kernal. Prevent Kernal load by OSD Kernal BIN selection No Disk and Save settings and do a power-cyle of the board. In this case the build-in Dolphin Kernal will by default be used after next power cycle.

SID Filter Curve (.FLT)

Custom Filters curves can optionally be loaded via OSD.

[!TIP]https://www.telnetbbsguide.com/bbs/software/image-bbs/ This is in most cases not needed and build-in filters curves are already an optimum.

[!NOTE] Remember to select the 6581 chip, not the 8580. Select 'Custom 1' as the filter to activate it. When a custom filter is loaded, there's no difference between custom options Custom 1, 2, and 3. Selecting 'Default' switches back to the built-in filter curve. https://www.telnetbbsguide.com/bbs/software/image-bbs/ Prevent Filter curve load by OSD Kernal FLT selection No Disk and Save settings and power-cyle of the board.

Core Loader Sequencing

The core will after power cycle/ cold-boot start downloading the images on the sdcard in the following order:

[!NOTE] (1) BIN Kernal, (2) CRT ROM, (3) PRG Basic and finally (4) FLT.

emulated RAM Expansion Unit REU 1750

For those programs the require a RAM Expansion Unit (REU) it can be activated by OSD on demand.

Playing Sonic the Hedgehog V1.2 Enable REU, and load the PRG.
Playing around with GEOS Enable REU, select c1541 CBM DOS ROM and load the PRG.

external IEC device

Use of an external IEC device e.g. C1541 / Printer and support of a selectable D9 Joystick port for hw interfacing is mutually exclusive.

[!NOTE] Best to use C64 stock Kernal as starting point but also Dolphin DOS was able to read directoy when both drives are active. External C1541 is typically factory configured for drive address #8.
Tang internal C1541 emulation also use by default address #8 so you need to change it via OSD to #9 so that there are no address conflicts. Internal drive becomes now #9 and external one #8.

In case MiSTeryShieldRpPico20k J3 spare connector is used for interfacing then a 5V level shifter / open collector driver is needed.
BiDir level shifter like: Converter based on commercial available I2C level shifter PCBA, Transistor circuit or TI TXS104E / TXS108E should be usable.

D9 Joystick port #1
No level shifter is needed as already available on the MiSTeryShield board (for 5V Joystick interfacing).

D9 Port #1

FPGATN20kSignalD9any ShieldPicoDualShockIEC
27J4‑8io(0)6BTN1DS2_CLKCLK (4)
28J4‑9io(1)2DOWNDS_MOSIDATA (5)
25J4‑10io(2)1UPDS_MISORESET (6)
26J4‑11io(3)4RIGHTDS2_CSATN (3)
29J4‑12io(4)3LEFT––
30J4‑13io(5)9BTN2––
--J4‑20GND8GND–GND (2)
--J7‑15V75V––

D9 Port #2 (or spare header J3 MiSTeryShieldPiPico)
Only MiSTeryShieldRpPico20k-dualD9 port has two D9 ports.

[!IMPORTANT] Connecting a IEC device to spare header J3 without level shifter will for sure damage the FPGA!

FPGATN20kSignalD9ShieldPico dual D9ShieldPico J3DualShockIEC
73J4‑1spare(0)6BTN11DS2_CLKCLK (4)
74J4‑2spare(1)2DOWN2DS_MOSIDATA (5)
77J4‑5spare(2)1UP3DS_MISORESET (6)
31J4‑14spare(3)4RIGHT4DS2_CSATN (3)
49J7‑12spare(4)3LEFT5–
52J7‑20spare(5)9BTN2–––
--J4‑20GND8GND6–GND (2)
--J4‑193V3––7––
--J7‑15V75V8––

Cable side !

PinNameDescription
1/SRQINSerial SRQIN
2GNDGround
3ATNSerial ATN In/Out
4CLKSerial CLK In/Out
5DATASerial DATA In/Out
6/RESETReset

Layout

Push Button utilization

  • S1 open OSD

  • S2 Reset

OSD

invoke by F12 keypress

Gamecontrol support

legacy D9 Digital Joystick.

OSD: Retro D9 1 Atari ST type of Joystick 2nd button supported using a MiSTeryNano shield buildin D9 connector.
Don't configure e.g. ArcadeR for C64 mode rather than normal digital 2nd button mode (2nd trigger button connect signal to ground)

OSD: Retro D9 2 Atari ST type of Joystick 2nd button supported using the MiSTeryNano shield spare J8 connector header and extra wiring. ->> wiki
Don't configure e.g. ArcadeR for C64 mode rather than normal digital 2nd button mode (2nd trigger button connect signal to ground)

USB Joystick(s).
OSD: USB #1 Joy or USB #2 Joy Also RII Mini Keyboard i8 left Multimedia Keys are active if USB #1 Joy selected.

Dualshock 2 Gamepad Stick or Dpad as Joystick..
OSD: DS #1 Joy or DS #2 Joy At the moment Dpad only for original Pad. Some clone devices support at the same time Dpad and left stick simultaniously. circle and cross Buttons as Trigger:

[!NOTE] TN20k: You have to select OSD DS2 #2 Joy or DS #2 Paddle for a MiSTeryShield20k configuration. In a MiSTeryShield20k configuration Dualshock is supported via the internal spare J8 pinheader. Multiplex supported in between DS2 or 2nd D9 retro Joystick. See MiSTeryShield20k DS2 Adapter / Cable for further information. Thx venice1200 !

Keyboard Numpad.
OSD: Numpad

NumpadNumpad
0 Trigger8 Up. Trigger 2
4 Left-6 Right
-2 Down-

Mouse.
OSD: Mouse USB Mouse as c1351 Mouse emulation.

Dualshock 2 Gamepad as Paddle
OSD: DS #1 Paddle or DS #2 Paddle Dualshock left Stick in analog mode as VC-1312 Paddle emulation. ANALOG Paddle mode will be indicated by DS 2 red light indicator.

[!NOTE] TN20k: single Dualshock support only 4 Paddles mapped to a single Gamepad (X/Y) and both Sticks. square , cross, circle and triangle used as 4 Trigger buttons Joyport 1: DS2 #1 Paddle Joyport 2: DS2 #1 Paddle or
Joyport 1: DS2 #2 Paddle Joyport 2: DS2 #2 Paddle

USB Paddle.
OSD: USB #1 Padd or USB #2 Padd Left Stick in X / Y analog mode as VC-1312 Paddle emulation. Button cross / square as Trigger

Keyboard

Layout PAGE UP (Tape Play) Key or the Tang S1 Button swap the Joystick Ports if OSD Swap Joys is set to Off mode.

F2,F4,F6,F8,Left/Up keys automatically activate Shift key.
F9 - arrow-up key.
F10 - = key.
F11 (RESTORE) Key as FREEZE. Typically used by Freezer Cards like Action Replay, Snappy Rom etc.
F12 OSD
Alt,Tab - C= key.

LED UI

LEDfunctionTN20KTP25KTM60KTM138K ProConsole60K/138k
0c1541 activityxxxxx
1D64 selectedxxxxx
2CRT selecedx--x-
3PRG selectedx--x-
4Kernal selectedx--x-
5TAP selectedx--x-

Solid red of the c1541 led after power-up indicates a missing DOS in Flash

Multicolor RGB LED

  • green      all fine and ready to go
  • red          something wrong with SDcard / default boot image
  • blue        MPU firmware detected valid FPGA core
  • yellow      FPGA core can't detect valid firmware
  • white      -

MIDI-IN and OUT

Type of MIDI interface can be selected from OSD. There is support for Sequential Inc., Passport/Sentech, DATEL/SIEL/JMS/C-LAB and Namesoft. You can use a MiSTeryNano shield to interface to a Keyboard. Note: Enabling persitent the MIDI interface will block other things like Multicard CRT ROMS.

Have a look: Wiki WIFI Modem

Most Terminal programs need the Kernal serial routines therefore select via OSD the CBM Kernal rather than default DolphinDOS.
In addition select OSD System RS232 mode Swiftlink DE. Also possible ACIA 6551 addresses are: $DE00 (default), $DF00 or $D700.

[!NOTE] Don't forget to active the PETSCII character input mode if you are sending commands to the modem !

For a PETSCII or ASCII/ANSI BBS you can use ccgms.
Press F8 and select modem Swiftlink DE and Baudrate of 38400.
You can press Shift F8 to toggle in between the different character modes.
Connect to you WIFI AP and have a try: ATD bbs.retrocampus.com:6510 or just have a look at telnetbbsguide and choose as you like.

For a more exotic Turbo56k protocol BBS use retroterm.

Note: Enabling persitent the Swiftlink-232 ACIA 6551 component at $FE00 will block other things like Multicard CRT ROMS. Adress $D700 doesn't block other HW.

RS232 Serial Interface VIC-1011/UP9600 <-> USB-C / external HW pins

The Tang onboard USB-C serial port can be used for communication with the C64 Userport Serial port in VIC-1011 or UP9600 mode. Terminal programs need the Kernal serial routines therefore select via OSD the CBM Kernal rather than default DolphinDOS. For a first start use UP9600 mode and a Terminal program like ccgms and on the PC side Putty with 2400 Baud.

OSD selection allows to change in between TANG USB-C port or external HW pin interface.

BoardRX (I) FPGATX (O) FPGANote
TN20k7576
TP25kK5L5J4-6 J4-5, share M0S Dock PMOD
TM60k NEOAB20AA19J24-6 J24-5, share M0S Dock PMOD
TM138k ProH15H14J24-6 J24-5, share M0S Dock PMOD

Remember that in + out to be crossed to connect to external device. Level are 3V3 tolerant.

Synthesis

Source code can be synthesized, fitted and programmed with GOWIN IDE Windows or Linux.

Alternatively use the command line build script gw_sh.exe / gw_sh.sh build_tn20k.tcl , build_tp25k.tcl or build_tm138k.tcl

HW circuit considerations

Pinmap TN20k Interfaces Sipeed M0S Dock, digital Joystick D9. TN20k DS2 JoyToDIP is not supported anymore. wiring

Pinmap D-SUB 9 Joystick Interface

  • Joystick interface is 3.3V tolerant. Joystick 5V supply pin has to be left floating !

pinmap

Joystick pinIOTang Nano pinFPGA pinJoystick Function
12J6 1025UP
21J6 928DOWN
34J6 1229LEFT
43J5 1126RIGHT
5---POT Y/ TRIGGER 3
60J5 827TRIGGER
7-n.cn.c5V
8-J5 20-GND
9--30TRIGGER 2

Pinmap Dualshock 2 Controller Interface

See MiSTeryShield20k DS2 Adapter / Cable

Getting started

In order to use this Design the following things are needed:

Sipeed M0S Dock or Raspberry Pi Pico RP2040 or ESP32-S2/S3
Sipeed Tang Nano 20k
or Sipeed Tang Primer 25k
and PMOD DVI
and PMOD TF-CARD V2
and PMOD SDRAM
and M0S PMOD adapter
or ad hoc wiring + soldering. or Sipeed Tang Mega 138k Pro
and PMOD SDRAM
and PMOD DS2x2
and M0S PMOD adapter
or Tang Mega 60K NEO
and PMOD SDRAM
and PMOD DS2x2
and M0S PMOD adapter
or Tang Console 60K/138k NEO
and PMOD DS2x2
and Sipeed M0S Dock and M0S PMOD adapter
or a PMOD RP2040-Zero

microSD or microSDHC card FAT32 formatted
TFT Monitor with HDMI Input and Speaker

Similar Projects

Discover other similar projects and AI models.

RepositoryVerilog
MiSTle-Dev/MiSTeryNano

Atari STE MiSTery core for the Tang Nano FPGAs

266
Nov 10, 2026
RepositoryVerilog
a2fpga/a2fpga_core

Apple II FPGA Co-Processor

81
Nov 16, 2026
RepositoryC++
trabucayre/openFPGALoader

Universal utility for programming FPGA

1.8k
Nov 28, 2026
RepositoryRust
sandlbn/ultimate64-manager

Desktop application for managing Commodore 64 Ultimate, Ultimate64 and Ultimate-II+ devices

182
Nov 18, 2026
RepositoryG-code
svenpetersen1965/C64-Diagnostic-Rev.-586220-Harness

A harness for the Diagnostic Rev. 586220 Test for the Commodore C64

182
Nov 27, 2025
RepositoryAssembly
jblang/supermon64

Original sources and binaries for Supermon+64 V1.2 by Jim Butterfield

168
Jan 31, 2024
RepositoryTypeScript
Esshahn/spritemate

spritemate is a browser based sprite editor for the Commodore 64

153
Oct 23, 2026
RepositoryStata
sweetlilmre/tapuino

tapuino

146
Aug 21, 2024
RepositoryJava
sblendorio/petscii-bbs

A Java framework for building highly customizable PETSCII-enabled BBS, accessible from Commodore 64/128

143
Nov 6, 2026