Skip to content

NextNano v1.0

Latest

Choose a tag to compare

@RetroSilicon RetroSilicon released this 04 Oct 13:24

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
    • F8 remains 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.bin at 0x00000, then flash the 3921 or 3923 Companion file matching the marking on your Tang Nano 20K at 0x40000.
  • External M0S Dock: flash only fpga_companion_m0s_dock.bin at 0x00000 to the M0S Dock.

Installation

For a first-time setup, the simplest order is:

  1. Flash the FPGA bitstream.
  2. Flash the appropriate BL616 firmware.
  3. 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 / controllers
  • NextNano_matrix_keyboard.fs — matrix keyboard / direct joystick

macOS / Linux

Using openFPGALoader:

openFPGALoader -f NextNano.fs

For the matrix-keyboard version:

openFPGALoader -f NextNano_matrix_keyboard.fs

The -f option writes the bitstream to the Tang Nano 20K onboard flash, so it remains installed after power-off.

Windows

Use Gowin Programmer:

  1. Connect the Tang Nano 20K to the PC by USB.
  2. Select Embedded Flash Mode → Erase, Program.
  3. Select NextNano.fs or NextNano_matrix_keyboard.fs.
  4. Click Program.

2. Flash the BL616

Use BouffaloLabDevCube and select the BL616/BL618 chip family.

To put the BL616 into firmware-download mode:

  1. Disconnect USB from the Tang Nano 20K or M0S Dock.
  2. 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.
  3. While keeping the button pressed, connect USB to the PC.

In BouffaloLabDevCube:

  1. Select BL616/BL618.
  2. Open the IOT tab and enable Single Download.
  3. Select the detected serial/COM port.
  4. Choose the firmware file and enter its flash address from the table above.
  5. Click Create & Download.

▶ Watch the video showcase on YouTube

If you use the BL616 built into the Tang Nano 20K

Flash these two files:

  1. bl616_fpga_partner_20kNano.bin → 0x00000
  2. One matching Companion firmware:
    • fpga_companion_tn20k_3921.bin → 0x40000, or
    • fpga_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

  1. Format a microSD card as FAT32.
  2. Download the latest NextZXOS distribution from https://www.specnext.com/latestdistro/
  3. Extract the distribution to the root of the card.
  4. 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.