# ZX-Spectrum-plus2A-fdd-interface-light

## Native μPD765-based Floppy Disk Drive interface for ZX Spectrum +2A/+2B. Provides 100% hardware compatibility with the built-in +3DOS.

> [English](README.en.md) | [Русский](README.md)  

This is an open-source hardware project featuring a Floppy Disk Drive (FDD) interface tailored for **ZX Spectrum +2A and +2B** computers (the classic black-case models). 

The circuit is built around the classic **μPD765A** (or Intel 8272A) floppy disk controller chip. This is the exact same FDC silicon used in the original flagship ZX Spectrum +3 machine.

By executing a full hardware replication of the +3 disk subsystem architecture, this interface provides **100% native compatibility with the built-in +3DOS operating system**. You do not need any custom EPROM firmware, complex hardware bank patches, or soft emulators. Simply plug the interface into the Expansion Bus, connect a drive, and instantly use standard +3 BASIC disk commands (`LOAD "a:"`, `FORMAT`, etc.) straight out of the box.

### Why is this project relevant?
The Sinclair ZX Spectrum +2A/+2B models shipped with a built-in cassette datacorder, yet they inherited the updated mainboard architecture and ROM structure from the disk-enabled +3 flagship. This interface bridges that historical gap, allowing you to easily upgrade your +2A/2B system by connecting either a **real mechanical 3.5" floppy drive** or a modern **Gotek** hardware emulator running FlashFloppy firmware.

***

## 🎛 PCB Form-Factor Revisions

The project has been engineered in two distinct layout variations to suit your component sourcing preferences and soldering skills:

### 1. DIP Version (Classic Through-Hole)
*   All glue logic, buffers, and support chips utilize standard through-hole DIP packages.
*   Highly recommended for beginners and easy home soldering with basic tools.
*   Includes an expanded matrix of configuration hardware jumpers for solderless drive adjustment.
    *   [Schematics](https://github.com/Alex-2-Graf/ZX-Spectrum-plus2A-fdd-interface) | [Placement](https://github.com/Alex-2-Graf/ZX-Spectrum-plus2A-fdd-interface) | [Gerber](https://github.com/Alex-2-Graf/ZX-Spectrum-plus2A-fdd-interface)

### 2. SOP Version (Compact Surface-Mount)
*   All auxiliary logic gates are converted to surface-mount components (SOP/SOIC packages).
*   Provides a dense, modern, and highly compact PCB footprint. Requires basic SMD soldering proficiency.
    *   [Schematics](https://github.com/Alex-2-Graf/ZX-Spectrum-plus2A-fdd-interface) | [Placement](https://github.com/Alex-2-Graf/ZX-Spectrum-plus2A-fdd-interface) | [Gerber](https://github.com/Alex-2-Graf/ZX-Spectrum-plus2A-fdd-interface)

***

## 🔌 Hardware Jumper Settings (DIP Version Only)

The DIP-variant board includes dedicated hardware jumper matrices. These allow you to adapt the interface to various floppy drives without physically modifying or altering the case of the disk drive itself:

*   **READY Signal Selection:** Manually configures the logic behavior of pin 34 on the floppy ribbon cable. You can hardwire a permanent readiness status if utilizing a standard PC-type drive that lacks Shugart-standard signaling. *(Note: This behavior can also be adapted on the SOP revision via custom wiring).*
*   **Drive Swapping (Swap A/B):** Provides an instant hardware line inversion for drive ordering. You can designate any physical drive or Gotek emulator as logical drive `A:` or `B:` instantly, without needing to desolder or alter selection SMD resistors on the drive's internal PCB.
*   **Side Select Lock:** Completely locks down the head side selection logic line. This feature is highly useful for specific hardware tests, processing vintage single-sided floppy disks, or debugging complex program disk images.

***

## 🔧 3.5" Floppy Drive Modifications (Shugart / READY Adaptation)

Standard PC floppy disk drives (manufactured by Sony, Samsung, Mitsumi, Panasonic, etc.) are factory-configured according to IBM PC standards. To operate correctly with the μPD765 controller on a ZX Spectrum, two conditions must be fulfilled:
1.  **Drive Selection as Drive A:** The system expects the primary boot device at logical address `DS0`, whereas standard PC drives are permanently hardwired to `DS1`.
2.  **READY Signal on Pin 34:** Standard PC drives output a *Disk Change* signal on pin 34. The Spectrum, however, strictly requires a true hardware *READY* signal.

### 🔥 Crucial Note for DIP-Board Builders
If you built the **DIP Version** of this interface interface, **you do not need** to cut PCB traces or solder bodge wires inside your physical floppy drive to achieve the READY signal or swap the A/B address. Simply configure the dedicated onboard jumpers on the interface PCB to match your unmodified PC drive.

### 🛠 Instructions for SOP-Board Builders (Drive Internal Hack)
If you opted for the compact **SOP Version** of this interface, the signal adaptation must be carried out manually on the internal circuit board of your physical 3.5" drive. Here are guides for the two most common vintage models:

#### 1. Sony MPF920
*   **Address Selection (DS0):** Locate the SMD contact solder pads labeled `JC30 / JC31` (or `DS0 / DS1`) sitting close to the main data connector. Carefully desolder and move the SMD bridge resistor (or solder blob) from position `DS1` straight over to position `DS0`.
*   **READY Signal Routing:**
    1.  Trace the circuit line leading to **pin 34** of the flat cable connector. Carefully slice it using a sharp hobby knife to completely disconnect the factory *Disk Change* signal.
    2.  Locate **pin 5** of the main internal FDC microchip controller (or find a test point explicitly stamped **RDY**).
    3.  Solder a thin modding wire from this **RDY** point directly to **pin 34** of the flat interface connector.

#### 2. Samsung SFD-321B
*   **Address Selection (DS0):** Locate the solder bridge pads labeled `DC0 / DC1` (or `S0 / S1`). Safely shift the solder blob or resistor bridge from position `1` directly over to position `0`.
*   **READY Signal Routing:** The internal board features pre-routed solder pads explicitly labeled **DC** (Disk Change) and **RDY** (Ready) near the 34-pin connector. By default, they are shorted in PC mode. Simply remove the solder blob from the **DC** jumper path and use it to short the **RDY** pads together. No trace cutting is required on this specific drive model.

***

## ⚙ Alternative: Gotek Hardware Emulator Setup

If you plan to connect a popular **Gotek** hardware emulator instead of a mechanical floppy drive, no internal soldering or case modification is required. Simply flash the Gotek device with the open-source **FlashFloppy** firmware and add the following configuration strings inside your root `FF.CFG` text file on the USB flash drive:

```ini
interface = shugart
host = dec-shugart
pin34 = rdy
```
