Floppy-disk controller
A floppy-disk controller is a special-purpose chip and associated disk controller circuitry that directs and controls reading from and writing to a computer's floppy disk drive. This article contains concepts common to FDCs based on the NEC µPD765 and Intel 8272A or 82072A and their descendants, as used in the IBM PC and compatibles from the 1980s and 1990s. The concepts may or may not be applicable to, or illustrative of, other controllers or architectures.
Overview
A single floppy-disk controller board can support up to four floppy disk drives. The controller is linked to the system bus of the computer and appears as a set of I/O ports to the CPU. It is often also connected to a channel of the DMA controller. On the x86 PC the floppy controller uses IRQ 6, on other systems other interrupt schemes may be used. The floppy disk controller usually performs data transmission in direct memory access mode.The diagram below shows a floppy disk controller which communicates with the CPU via an Industry Standard Architecture bus or similar bus and communicates with the Floppy Disk drive with a 34 pin ribbon cable. An alternative arrangement which is more usual in recent designs has the FDC included in a super I/O chip which communicates via a Low Pin Count bus.
Most of the floppy disk controller functions are performed by the integrated circuit but some are performed by external hardware circuits. The list of functions performed by each is given below.
Floppy disk controller functions (FDC)
- Translate data bits into FM, MFM, M²FM, or GCR format to be able to record them
- Interpret and execute commands such as seek, read, write, format, etc.
- Error detection with checksums generation and verification, like CRC
- Synchronize data with phase-locked loop
External hardware functions
- Selection of floppy disk drive
- Switching-on the floppy drive motor
- Reset signal for the floppy controller IC
- Enable/disable interrupt and DMA signals in the floppy disk controller
- Data separation logic
- Write pre-compensation logic
- Line drivers for signals to the controller
- Line receivers for signals from the controller
Input/output ports for common x86-PC controller
- Data port
- Main status register
- Digital control port
Port Address | Port Name | Location | Port type |
3F5 | Data port | Bidirectional I/O | |
3F4 | Main status register | FDC IC | Input |
3F2 | Digital control port | External hardware | Output |
Data port
This port is used by the software for three different purposes:- While issuing a command to the FDC IC, command and command parameter bytes are issued to the FDC IC through this port. The FDC IC stores the different parameters and the command in its internal registers.
- After a command is executed, the FDC IC stores a set of status parameters in the internal registers. These are read by the CPU through this port. The different status bytes are presented by the FDC IC in a specific sequence.
- In the programmed and interrupt mode of data transfer, the data port is used for transferring data between the FDC IC and the CPU IN or OUT instruction.
Main status register (MSR)
Bit | Representation |
0 | FDD 0: Busy in seek mode |
1 | FDD 1: Busy in seek mode |
2 | FDD 2: Busy in seek mode |
3 | FDD 3: Busy in seek mode |
4 | FDC Busy; Read/Write command in progress |
5 | Non-DMA mode |
6 | DIO; Indicates the direction of data transfer between the FDC IC and the CPU |
7 | MQR; Indicates data register is ready for data transfer |
Explanations | |
MQR | 1 = data register ready, 0 = data register not ready |
DIO | 1 = controller has data for CPU, 0 = controller expecting data from CPU |
Non-DMA | 1 = Controller Not in DMA Mode, 0 = Controller in DMA Mode |
FDC Busy | 1 = Busy, 0 = Not Busy |
FDD 0,1,2,3 | 1 = Running, 0 = Not Running |
Digital control port
This port is used by the software to control certain FDD and FDC IC functions. The bit assignments of this port are:Bit | Representation |
0 and 1 | Device number to be selected |
2 | RESET FDC IC |
3 | Enable FDC interrupt and DMA request signals |
4 to 7 | Turn ON the motor in disk drive 0, 1, 2 or 3 respectively |
Interface to the floppy disk drive
The controller connects to the drive using a flat ribbon cable with 34 connectors split between the host, the 3.5" drive, and the 5.25" drive. This type of cable is called a universal connector. In the IBM PC family and compatibles, a twist in the cable is used to distinguish disk drives by the socket to which they are connected. All drives are installed with the same drive select address set, and the twist in the cable interchange the drive select line at the socket. The drive that is at furthest end of the cable additionally would have a terminating resistor installed to maintain signal quality.Format data
Many mutually incompatible floppy disk formats are possible; aside from the physical format on the disk, incompatible file systems are also possible.Drive | Format | Capacity | Transfer speed [kbit/s] | RPM | Tracks | TPI | Comment |
8-inch SD | 8-inch SD | 80 KB | 33.333 | 360 | 32 | 48 | Only on old controllers. |
5.25-inch SD | 5.25-inch SD | 160 KB | 125 | 40 | Only on old controllers. | ||
5.25-inch SSDD | 5.25-inch SSDD | 171 KB | 300 | 35 | 48 | Only on C1541 compatibles. | |
5.25-inch SD | 5.25-inch SD | 180 KB | 150 | 40 | Only on old controllers. | ||
5.25-inch DD | 5.25-inch DD | 320/360/400 KB | 250 | 300 | 40 | 48 | 8/9/10 512 byte sectors respectively. |
5.25-inch DD | 5.25-inch QD | 800 KB | 250 | 300 | 80 | 96 | |
5.25-inch HD | 5.25-inch DD | 360 KB | 300 | 360 | 40 | 48 | |
5.25" HD | 5.25" HD | 1200 KB | 500 | 360 | 80 | 96 | Up to 83 tracks. Different biasing current. |
5.25" HD | 5.25" HD | 720 KB | 300 | 360 | 80 | Up to 83 tracks. | |
3.5" DD | 3.5" DD | 720 KB | 250 | 300 | 80 | 135 | Up to 83 tracks. |
3.5" DD | 3.5" DD | 800 KB | 394-590 | 80 | Used by Apple Macintosh. | ||
3.5" DD | 3.5" DD | 800 KB | 250 | 300 | 80 | Used by Commodore 1581. | |
3.5" DD | 3.5" DD | 880 KB | 250 | 300 | 80 | Up to 83 tracks. Used by Amiga computers. | |
3.5" DD | 3.5" DD | 360 KB | 250 | 300 | 40 | ||
3.5" HD | 3.5" DD | 720 KB | 250 | 300 | 80 | Up to 83 tracks. | |
3.5" HD | 3.5" HD | 1440 KB | 500 | 300 | 80 | 135 | Up to 83 tracks. |
3.5" HD | 3.5" HD | 1760 KB | 250 | 150 | 80 | Used by Amiga computers. | |
3.5" ED | 3.5" ED | 2880 KB | 1000 | 300 | 80 | 135 | Up to 83 tracks. |
Sides:
- SS – Single sided
- DS – Double sided
- SD – Single density
- DD – Double density
- QD – Quad density
- HD – High density
- ED – Extra-high density
- TD – Triple density
"3-mode" floppy drive