PIO


Programmable Input Output. A means of accessing device registers. Also describes one form of data transfers. PIO data transfers are performed by the host processor using PIO register accesses to the data register.

PIO Mode

Cycle times range from 600ns to 150ns using modern EIDE disk drives. This is how a PIO transfer happens:
  • The system specifies the location where the data transfer is to begin, and how many sectors to transfer.
  • The system sends a command to transfer the data.
  • The drive sets DRQ (Data ReQuest) when it is ready to transfer the data. READ: The drive does not set DRQ until it has a sector of data ready. The drive also asserts the INTRQ (INTerrupt ReQuest)line when the data is ready. Write: The drive sets DRQ but does not issue an interrupt until after the data is transferred.
  • The CPU transfers 256 words of data by asserting IOR- (IO Read) or IOW- (IO Write) 256 times. 5) If more data than one sector was requested, the drive/CPU will repeat steps 3 & 4 until all data has been transferred.
This is a quick and efficient way to transfer data, but it ties up the CPU a lot. PIO Multiple Mode - (AKA: Multi-Block Mode or just Block Mode) Multiple mode transfers are handled similarly to a standard PIO data transfer. The only difference is how often the drive issues interrupts. In standard PIO, each sector (512 bytes) of data transferred, requires one interrupt. With Multiple Mode, we can transfer 2, 4, 8, 16 or more sectors with each interrupt. For instance, if multiple mode is set to 4, each interrupt indicates the drive is ready for 4 sectors of data (read), or has completed the transfer of 4 sectors of data (write). The advantage is that we eliminate some of the system overhead involved in a PIO transfer, Here is a chart indicating the number of interrupts (AKA: Blocks) involved in the transfer of a 1 megabyte file (1,048,576 bytes):

Sectors per
Interrupt
Total
Interrupts
1 2048
2 1024
4 512
8 256
16 128
32 64


From this table we see that by setting the Multiple Block Mode to 16, we eliminate 1920 (2048-128) interrupts. This shows a significant decrease in the time the drive is waiting on the system. The newer the drive the higher # of Sect/Int it can handle. If you set the blocks higher than the drive is capable of, it is the same as setting it to 1. Cycle Times as per ATA Specs:

PIO Mode
Mode Cycle Times Transfer Rate
0 600ns 3.33MB/s
1 383ns 5.22MB/s
2 240ns 8.33MB/s
3 180ns 11.11MB/s
4 150ns 16.66MB/s


Single Word DMA
Mode Cycle Times Transfer Rate
0 960ns 2.80MB/s
1 480ns 260MB/s
2 260ns 8.33MB/s


Multi-Word DMA
Mode Cycle Times Transfer Rate
0 480ns 4.16MB/s
1 150ns 13.33MB/s
2 60ns 16.66MB/s


YMMV
(Your Mileage May Vary) Actual drive cycle times are approximations, the transfer rate is calculated on a per block basis. Variables such as Error Correction, Caching, Processor Overhead, and Rotational Speed will account for variations in the minimum cycle time the drive can handle. In order to achieve these higher transfer rates, Both the drive and the IDE adapter must support IOCHRDY (I/O Channel Ready). On newer drives and systems this is default. On some older drives, a particular jumper was typically jumped to enable IOCHRDY. Check the jumper specs for your particular drive.

Close Window