Repository navigation
NextNano v1.0
NextNano v1.0 is the first stable release of the ZX Spectrum Next implementation for the Sipeed Tang Nano 20K.
CPU speed switching now works in the same way as on original ZX Spectrum Next hardware, both PAL and NTSC modes are supported, all software tested so far works correctly, and an on-screen keyboard makes controller-only setups practical.
Highlights
- Full native CPU speed support: 3.5 / 7 / 14 / 28 MHz
- CPU speed can be changed by Next software / NextZXOS just like on the original ZX Spectrum Next
F8remains available for manual speed switching
- PAL (50 Hz) and NTSC (60 Hz) modes
- All games, demos, BASIC programs and utilities tested so far work correctly
- On-screen keyboard, opened from a gamepad button
- USB keyboard, mouse and gamepad / joystick support
- HDMI video and audio output
Release files
FPGA bitstreams
| File | Description |
|---|---|
NextNano.fs |
Standard version for USB keyboard and USB controllers |
NextNano_matrix_keyboard.fs |
Version with direct ZX Spectrum matrix keyboard, wired joystick, NMI and Reset inputs |
BL616 firmware
| File | Use | Flash address |
|---|---|---|
bl616_fpga_partner_20kNano.bin |
First-stage firmware for the BL616 built into the Tang Nano 20K | 0x00000 |
fpga_companion_tn20k_3921.bin |
FPGA Companion for a Tang Nano 20K marked 3921 | 0x40000 |
fpga_companion_tn20k_3923.bin |
FPGA Companion for a Tang Nano 20K marked 3923 | 0x40000 |
fpga_companion_m0s_dock.bin |
FPGA Companion for an external M0S Dock | 0x00000 |
Use one BL616 setup:
- Onboard BL616: flash
bl616_fpga_partner_20kNano.binat0x00000, then flash the 3921 or 3923 Companion file matching the marking on your Tang Nano 20K at0x40000. - External M0S Dock: flash only
fpga_companion_m0s_dock.binat0x00000to the M0S Dock.
Installation
For a first-time setup, the simplest order is:
- Flash the FPGA bitstream.
- Flash the appropriate BL616 firmware.
- Prepare the microSD card with NextZXOS and boot NextNano.
1. Flash the Tang Nano 20K FPGA
Choose the bitstream you want:
NextNano.fs— USB keyboard / controllersNextNano_matrix_keyboard.fs— matrix keyboard / direct joystick
macOS / Linux
Using openFPGALoader:
openFPGALoader -f NextNano.fsFor the matrix-keyboard version:
openFPGALoader -f NextNano_matrix_keyboard.fsThe -f option writes the bitstream to the Tang Nano 20K onboard flash, so it remains installed after power-off.
Windows
Use Gowin Programmer:
- Connect the Tang Nano 20K to the PC by USB.
- Select Embedded Flash Mode → Erase, Program.
- Select
NextNano.fsorNextNano_matrix_keyboard.fs. - Click Program.
2. Flash the BL616
Use BouffaloLabDevCube and select the BL616/BL618 chip family.
To put the BL616 into firmware-download mode:
- Disconnect USB from the Tang Nano 20K or M0S Dock.
- Press and hold the BL616 boot button before connecting the USB cable to the PC.
- On the Tang Nano 20K, this button is marked UPDATE and is next to the HDMI connector.
- On the M0S Dock, use the BOOT button.
- While keeping the button pressed, connect USB to the PC.
In BouffaloLabDevCube:
- Select BL616/BL618.
- Open the IOT tab and enable Single Download.
- Select the detected serial/COM port.
- Choose the firmware file and enter its flash address from the table above.
- Click Create & Download.
▶ Watch the video showcase on YouTube
If you use the BL616 built into the Tang Nano 20K
Flash these two files:
bl616_fpga_partner_20kNano.bin→0x00000- One matching Companion firmware:
fpga_companion_tn20k_3921.bin→0x40000, orfpga_companion_tn20k_3923.bin→0x40000
Use the file matching the 3921 / 3923 marking on your board. Do not flash both Companion variants.
If you use an external M0S Dock
Flash only:
fpga_companion_m0s_dock.bin→0x00000
After flashing is complete, disconnect USB and power-cycle the hardware normally.
Matrix keyboard version
The matrix-keyboard bitstream adds direct support for a ZX Spectrum matrix keyboard, a wired joystick, and dedicated NMI and Reset buttons.
Matrix keyboard pinout
Pin numbers below are FPGA I/O pin numbers as shown on the Tang Nano 20K pinout.
| Keyboard line | FPGA pin |
|---|---|
| D0 | 73 |
| D1 | 74 |
| D2 | 80 |
| D3 | 85 |
| D4 | 77 |
| A8 | 26 |
| A9 | 27 |
| A10 | 16 |
| A11 | 15 |
| A12 | 28 |
| A13 | 25 |
| A14 | 29 |
| A15 | 30 |
Connect all 13 keyboard signal wires. A passive keyboard membrane needs no separate power connection.
Joystick and buttons
| Control | FPGA pin |
|---|---|
| Up | 19 |
| Down | 31 |
| Left | 20 |
| Right | 18 |
| Fire | 17 |
| NMI | 53 |
| Reset | 52 |
| Common | Board GND |
Use normally open switches between each joystick/button input and GND.
FPGA I/O is 3.3 V. Do not apply 5 V.
See the README for the full wiring diagram and source build instructions.
Preparing the SD card
- Format a microSD card as FAT32.
- Download the latest NextZXOS distribution from https://www.specnext.com/latestdistro/
- Extract the distribution to the root of the card.
- Insert the card into the Tang Nano 20K and power on.
Known limitation
Networking is not currently implemented. It requires an external BL616 / M0S Dock because the BL616 built into the Tang Nano 20K has no antenna.
Thanks to the ZX Spectrum Next, MiSTer and FPGA Companion communities for the projects NextNano builds upon.