User:NubKnacker/FDC

From Wikipedia, the free encyclopedia

A Floppy Disk Controller (FDC) is a special-purpose chip and associated circuitry that directs and controls reading from and writing to a computer's floppy disk drive.


Overview[edit]

A single FDC board can support upto four Floppy disk drives. The FDC is linked to the system bus of the computer and appears as a set of I/O ports to the CPU. It is also connected to a channel of the DMA controller. The FDC interrupts the CPU at level 6. The FDC usually performs data transmission in DMA mode.

Block diagram showing FDC communication with the CPU and the FDD.

Most of the FDC functions are performed by the FDC IC but some are performed by external hardware circuits. The list of functions performed by each is given below.

FDC IC Functions[edit]

  • Generating MFM format for the data to be recorded
  • Decoding and executing commands such as seek, read, format etc
  • Error detection by CRCC generation / checking
  • Data synchronisation

External Hawrdware functions[edit]

  • Selection of FDD
  • Switching-on motor in the FDD
  • Resetting the FDC IC
  • Enabling / disabling interrupt and DMA signals of the FDC IC
  • Data seperation logic
  • Write pre-compensation logic
  • Line drivers for signals to the FDD
  • Line recievers for signals from the FDD

Input / Output ports[edit]

The FDC has three I/O ports. These are:

  • Data port
  • Main status register (MSR)
  • Control port

The first two reside inside the FDC IC while the Control port is in the external hardware. The addresses of these three ports are as follows.

Port Address Port Name Location Port Type
3F5 Data Register FDC IC Bidirectional I/O
3F4 Main Status Register FDC IC Input
3F2 Digital Control Port External Hardware Output

Data Port[edit]

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)[edit]

This port is used by the software to read the overall status information regarding the FDC IC and the FDD's. Before initiating a floppy disk operation the software reads this port to confirm the readiness condition of the FDC and the disk drives to verify the status of the previously initiated command. The different bits of this register represent :

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 RQM; Indicates data register is ready for data transfer

Digital Control Port[edit]

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 (Low)
3 Enable FDC interrupt and DMA request signals
4 to 7 Turn ON the motor in disk drive 0, 1, 2 or 3 respectively