Programmed input/output

From Wikipedia, the free encyclopedia

Programmed input/output (PIO) is a method of transferring data between the CPU and a peripheral such as a network adapter or an ATA storage device. Until the advent of DMA, it was the only method possible. The PIO interface is grouped into different modes that correspond to different transfer rates. The electrical signaling among the different modes is similar -- only the cycle time between transactions is reduced in order to achieve a higher transfer rate. All ATA devices support the slowest mode -- Mode 0. By accessing the information registers (using Mode 0) on an ATA drive, the CPU is able to determine the maximum transfer rate for the device and configure the ATA controller for optimal performance.

The PIO modes require a great deal of CPU overhead to configure a data transaction and transfer the data. Because of this inefficiency, the DMA (and eventually UDMA) interface was created to increase performance. The simple digital logic required to implement a PIO transfer still makes this transfer method useful today (especially if high transfer rates are not required).

The modes are given below:

PIO modes
Mode Maximum transfer rate (MB/s) Standard where spec is defined
Mode 0 3.3 ATA-1
Mode 1 5.2 ATA-1
Mode 2 8.3 ATA-1
Mode 3 11.1 ATA-2
Mode 4 16.7 ATA-2

[edit] PIO Mode 5

There was talk about a PIO 5 which would have operated at 22 MB/s, but it was never implemented in light of the DMA standard and that CPUs of the time would have been crippled waiting for the hard disk at the proposed PIO 5 timings. While no hard drives were ever manufactured to support this mode, some motherboard manufacturers preemptively provided BIOS support for it.

[edit] See also