pico-xb80 is a small expansion-bus interface for 1970s and 1980s desktop machines, designed to allow a Raspberry Pi Pico 2 board to present an SD card-backed storage device to a Sharp MZ80K system.
Currently supported:
Possible future targets with additional effort:
The project uses a Pico 2 board and an SD card to provide a file system to the Sharp MZ80K through the expansion bus. A small monitor ROM extension and host-side software allow the machine to access files stored on an SD card in a way that is compatible with the existing monitor and tape-handling model.
The software stack includes:
- SD card interface support for the Pico 2 board configuration used here, over hardware SPI where the wiring allows it and bit-banged 1-bit native SD mode otherwise
fatfsby ChaN- a custom expansion-bus implementation using the Pico PIO and DMA subsystems
- Sharp MZ80K-specific glue logic and ROM support for monitor commands such as
*FD
Off-the-shelf components are used to keep the project accessible and inexpensive.
- Raspberry Pi Pico 2 / RP2350B mounted on an Olimex Pico2-XXL
- SD card socket mounted on the board
- Ribbon cable and jumper wires to connect the bus to the computer
- Sharp MZ80K uses a 50-way ribbon cable
- DuPont or similar jump wires
This is a prototype-style design intended to be simple to build and experiment with. A dedicated single-board version may be possible in the future, but the current approach uses the Olimex board for flexibility.
The project is built and developed with:
- VS Code
- Raspberry Pi Pico SDK
- Git - git in VSCode
- Python 3
Important: you will need to build your own copy of
sjasmplusfor your platform.
The repository includes support for:
- sjasmplus for assembling Z80 code into machine-code binaries
bin2header.pyto convert binary output into a C header suitable for inclusion in the Pico firmware
The project includes a small set of helper scripts for working with Sharp MZ80K file images:
filehandle_path.py— scans a Sharp MZ80K binary for tape-handler calls and rewrites them to use the SD-backed handlersmz_tape_info.py— inspects file images and reports the file type plus whether they have already been patched
Only the right-hand column of pins is used from EXT1 and EXT2 on the Olimex board.
| Olimex EXT1 | MZ80K | XB Signal |
|---|---|---|
| P1 | nc | |
| P3 | A25 (mark) | D0 |
| P5 | A24 | D1 |
| P7 | A23 | D2 |
| P9 | A22 | D3 |
| P11 | A21 | D4 |
| P13 | A20 | D5 |
| P15 | A19 | D6 |
| P17 | A18 | D7 |
| P19 | nc | |
| P21 | nc | |
| P23 | nc | |
| P25 | nc | |
| P27 | nc | |
| P29 | nc | |
| P31 | B10 | NWR |
| P33 | B8 | NRD |
| P35 | B6 | NIOREQ |
| P37 | B4 | NMREQ |
| P39 | B3 | GND |
| Olimex EXT2 | MZ80K | Signal |
|---|---|---|
| P1 | nc | |
| P3 | A16 | A0 |
| P5 | A15 | A1 |
| P7 | A14 | A2 |
| P9 | A13 | A3 |
| P11 | A12 | A4 |
| P13 | A11 | A5 |
| P15 | A10 | A6 |
| P17 | A9 | A7 |
| P19 | nc | |
| P21 | nc | |
| P23 | A8 | A8 |
| P25 | A7 | A9 |
| P27 | A6 | A10 |
| P29 | A5 | A11 |
| P31 | A4 | A12 |
| P33 | A3 | A13 |
| P35 | A2 | A14 |
| P37 | A1 | A15 |
| P39 | nc |
From the project root:
cmake -S . -B build -G Ninja
cmake --build buildTo put the Pico into bootloader mode:
- hold the BOOT button
- connect the board to your computer via USB
Then upload the firmware using VS Code with the Pico extension, or use the project task configuration already provided in the workspace.
Create an SD card with a root-level folder named MZ_FD. Place the files you want to access inside that directory and give them the .MZF extension. The file 0000.MZF is loaded whenever *FD is used from the monitor.
Because the monitor ROM cannot be modified in software, a replacement ROM or a patched program image is required to redirect tape-file operations to the SD-backed handlers.
The helper scripts make this easier:
mz_tape_info.pyidentifies files that use tape-file logicfilehandle_path.pypatches those files to call the SD-handler routines instead
The board can be powered either from the host laptop USB port or from a standard USB power supply.
See OPERATING.md for instructions on using the interface from the Sharp monitor ROM.
Thanks to:
- MZ80K_SD
- Atom-DVI
- MZ-80A
- MZ-Archive
- Sharp MZ
- the wider retro-computing community for technical discussion and reference material
This project also benefited from discussions and examples from several AI systems used during development, but the project itself is intended to stand on its own technical merits.
-
SD Card interface software (initially from prompts to Claude.ai). The Olimex Pico2-XXL has two variants. One use 1-bit communication protocol and the other uses the 4-bit protocol. My board used 1-bit so the software was originally built for this.
SdCard::detect_board_revision()works out which board it is running on first, since the two Olimex revisions wire the card differently. Revision A puts SD_DAT0 on GPIO12 and leaves R24 - the link between GPIO9 and the card's CS pin - unpopulated, so it can only be bit-banged. Revision B moved SD_DAT0 to GPIO24 (GPIO12 collides with the RP2350's HSTX/HDMI block) and ships wired for SPI. The check is electrical, not a conversation with the card: it looks for the 10k pull-up the SD_DAT0 net carries on the board, so it needs no card in the socket and sends no commands - which matters, because aCMD0seen with CS low latches a card into SPI mode until it is next powered down.That gives two transports, picked at startup by
SdCard::initialize():- SPI - used on Revision B. The card is driven by one of the RP2350 SPI blocks, so a sector moves as 512 hardware-clocked bytes at 12.5MHz rather than 4096 bit-banged GPIO transitions. This needs CS on a GPIO and CLK/DI/DO on pins that can carry the SCK/TX/RX functions of a single SPI instance - GPIO9/10/11/24 are all
spi1, so they qualify. - 1-bit native SD - used on Revision A, and the fallback everywhere else: whenever the wiring cannot carry SPI or the card does not answer the SPI probe. CMD/CLK/DAT0 are bit-banged at roughly 500kHz with the CPU busy-waiting for the whole sector.
If the detected wiring fails to initialise, the other revision's wiring is tried before giving up.
- SPI - used on Revision B. The card is driven by one of the RP2350 SPI blocks, so a sector moves as 512 hardware-clocked bytes at 12.5MHz rather than 4096 bit-banged GPIO transitions. This needs CS on a GPIO and CLK/DI/DO on pins that can carry the SCK/TX/RX functions of a single SPI instance - GPIO9/10/11/24 are all
-
Expansion Bus - provides a shared memory on the address bus. Pico PIOs rapidly reads addresses and data which several DMAs pump in and out of 64Kx16bit words (128Kb).
- heavily influenced by ATOM-DVI after speaking with Chris about his project at an ABUG event.
-
pico-xb80_mz80k - the specific Sharp MZ80K interface.
- Z80 ROM this is shared on the bus at
0xF000so that the Monitor ROM can jump to it with an*FDcommand. - Mailbox addresses so that the Z80 can send and receive commands and data to/from the Pico
- Communcation with the SD card via the SD Card interface and
fatfs
- Z80 ROM this is shared on the bus at

