Hard drives are connected to the rest of the system through different interface technologies. These interface technologies specifies the types of physical connections, cables and the rate of data transfer between hard drives and the system. Advanced Technology Attachment (ATA) standard and the Small Computer System Interface (SCSI) standards are the interface technologies used in hard drives.
Earlier PCs used separate controller cards in motherboard to connect drives to the computer and to manage transfers. The development of Integrated Device Electronics (IDE) embedded controller circuits in to the drives. Then the succession of ATA standards specified how hard drives are interfaced with PC. Though ATA was originally designed for hard drives the ATA Packet Interface (ATAPI) was developed to interface with other storage devices like CD ROMs and DVD ROMs. ATA is also referred as IDE or Enhanced IDE (EIDE) commercially. Both are marketing terms and they do not refer the ATA standards. The introduction of serial ATA which uses serial link to transfer data made ATA to be referred as Parallel ATA (PATA). 
The following section describes the standards of SATA and PATA protocols along with the hardware details, pin diagrams and specifications of PATA and SATA.
Parallel ATA (PATA)
The PATA standard connects the hard drive directly to the motherboard through ribbon cable usually consist of 40 parallel wires and 3 connectors. One of the peripheral in the cable is selected as master and the other as slave. A cable select mode is available to switch between master and slave mode if the BIOS of the PC supports it.
MODES OF DATA TRANSFER
In PIO (Programmed Input/Output) mode the data are transferred to RAM with commands directly managed by processor. So, if there is a large amount of data transfer, the processor becomes overloaded and slows down the entire system.
In DMA (Direct Memory Access) mode the processor is made free because of the direct access to the memory by peripherals. The single word DMA allows transfer of one word (2 bytes) for every data transfer session. While the multi word DMA allows several words in each data transfer session.
The ATA standard uses asynchronous transfer mode, sending command and data at rising edge of the clock signal. So the command and data have to wait for each other. If the clock frequency is increased to raise the throughput it may cause electromagnetic interference. The Ultra DMA optimized the ATA interface by using rising edges and falling edges for data transfers increasing the throughput. It also uses CRC codes for detecting transmission errors.
PATA comes in various standards which are listed in the table below.
Name ANSI Standard Synonym Mode (PIO/DMA) Throughput Comments (Mb/s) ATA-1 ANSI X3.221-1994 IDE PIO mode 03,3 PIO mode 1 5,2 PIO mode 2 8,3 DMA mode 0 8,3 ATA-2 ANSI X3.279-1996 EIDE, Fast ATA, Fast ATA-2 PIO mode 311,128-bit LBA PIO mode 4 16,7 DMA mode 1 13,3 DMA mode 2 16,7 ATA-3 ANSI X3.298-1997 PIO mode 311,1SMART, 28-bit LBA PIO mode 416,7 DMA mode 1 13,3 DMA mode 2 16,7 ATA-4/ATAPI-4 ANSI NCITS 317-1998Ultra-ATA/33, UDMA 33, Ultra DMA 33 UDMA mode 016,7 Ultra DMA 33 and supports CD-ROMs (ATAPI) UDMA mode 1 25,0 UDMA mode 2 33,3 ATA-5/ATAPI-5ANSI NCITS 340-2000Ultra-ATA/66, UDMA 66, Ultra DMA 66 UDMA mode 344,4 Ultra DMA 66, uses a 80-wire cable UDMA mode 4 66,7 ATA-6/ATAPI-6ANSI NCITS 347-2001Ultra-ATA/100,UDMA 100,Ultra DMA 100 UDMA mode 5 100 Ultra DMA 100, LBA48 and the AAC (Automatic Acoustic Management) function ATA-7/ATAPI-7 ANSI NCITS 361-2002Ultra-ATA/133,UDMA 133,Ultra DMA 133UDMA mode 6133Ultra DMA 133
Hardware details of PATA
Master/Slave configuration: In PATA standards you can connect two separate hard drives using single master/slave configuration. You should make one hard drive as master drive and other as slave drive when you are using a single ribbon. Master drive handles the signal from the adapter and sends to slave drive. When you use cable select ribbon, cable select drive setting is used. The following diagrams explain the master slave setting for both the ribbons.
Master/Slave configuration for single Ribbon
Master/Slave configuration for cable Ribbon
IDE channels: Most motherboards consist of two 40 pin PATA connector called primary and secondary IDE channels. Both can be connected to 2 hard drives using ribbons.
Data Cables: PATA data cables are ribbon cables with 40 or 80 wires with connectors for one IDE channels and two hard drives. The ribbon consists of coloured stripes to match pin1 of ribbon cable with pin1 of motherboard.
Power cable: PATA power cables use Molex-type power connector that connects to the drive in port and it is connected to the power supply.
PATA PIN Configuration
PinFunction PinFunction 1 Reset 2 Ground 3 Data 7 4 Data 8 5 Data 6 6 Data 9 7 Data 5 8 Data 10 9 Data 4 10 Data 11 11 Data 3 12 Data 12 13 Data 2 14 Data 13 15 Data 1 16 Data 14 17 Data 0 18 Data 15 19 Ground 20 KEYED 21 DMARQ (DDRQ) 22 Ground 23 DIOW (I/O Write) 24 Ground 25DIOR (I/O Read) 26 Ground 27 IORDY (IOC HRDY) 28 CSEL (Cable Select) 29 DMACK (DDACK) 30Ground 31 INTRQ (IRQ) 32 IOCS16 (No Connect) (IO Chip Select 16) 33DA1 (Address 1) 34 PDIAG (Passed Diagnostics) (GPIO_DMA66_DETECT) 35DA0 (Address 0) 36 DA2 (Address 2) 37CS1FX (IDECS0) (Chip Select 1P) (1F0-1F7) 38 CS3FX (IDECS1) (Chip Select 3P) (3F6-3F7) 39DASP Activity (IDE Activity) 40 Ground
Timing Diagram for IDE
CPU Read Cycle Timing Diagram
CPU Write Cycle Timing Diagram
Limitations of PATA
?Parallel ATA does not have hot-plug capability.
?Parallel ATA has limited cable length of 18 inches preventing efficient routing of the cables and fails to improve the components accessibility in the system.
?PATA could not increase it data rate beyond 100 Mbytes/sec.
?It uses single ended signal system causing induced noises.
To overcome these limitations generally SATA drives are used these days. Moreover SATA is far superior compared to PATA drives.
Serial ATA (SATA)
SATA is the replacement for many of the limitation present in PATA. SATA is scalable and also provides enhancements in the computing platform. It provides low cost storage, higher speed and improved bandwidth, greater flexibility and hot plug capability. The other features of it are simplified cabling, enhanced reliability. The jumpers in the PATA are eliminated, improved airflow and backward capability with various speeds and also supports all ATA and ATAPI devices making it as very powerful replacement for the PATA.
Serial ATA Topology
Serial ATA is transparent to software layer of the system so that the operating system, device driver and applications run without modifications. The pin count is reduced compared to PATA allowing better air flow and cable routing.
The SATA function is divided into four layer as Application, Transport, Link and physical layer.
SATA Communication Layer Model
The physical layer handles the high speed serial communication between system and the hard drive. It uses low voltage (250mV) and enables speed of 1.5 Gb/s. It is designed in a way that it can be extended to 6.0Gb/s. It uses single ended signalling. It transmits 10-bit serialized data and vice versa. It supports both cabled and back lane connections.
The link layer handles with sending and receiving of frames, control signal and flow control. It also has primitive character encoder/decoder, 8B/10B encoder/decoder, 32-bit CRC calculator, data scrambler/descrambler and a layer controller.
Transport layer does of packing and unpacking of ATA information into Frame information Structures. It deals with buffer memory for data flow control.
Application layer uses register interface to interact with Transport layer. It also contains register shadow block which is compatible with PATA and future extensions. This layer makes SATA backward compatible with Parallel ATA devices.
HARDWARE DETAILS OF SATA
Serial ATA (SATA) pin out
7 pin Serial ATA motherboard internal connector
Serial ATA (SATA) power connector pin out
15 pin Molex 67581-0000 SATA power connector
PinSignalPSU Colour Wire
1+3.3VDC orange 2+3.3VDC orange 3+3.3VDC orange 4GND black 5GND black 6GND black 7+5VDC red 8+5VDC red 9+5VDC red 10GND black 11GND black 12GND black 13+12VDC yellow 14+12VDC yellow 15+12VDC yellow
7-pin Serial ATA right-angle data cable
The standard SATA data cable has seven conductors in with three grounds and four active data lines and 8mm wide wafer connectors at both the ends. The cable can extended up to one meter in length to connect motherboard and hard drive. SATA does not use an absolute voltage for signals as it uses difference between two voltages of opposite polarity. This reduces the noise and this allows it to carry signals at higher speed without distortion and noise interference.
Generations of SATA
SATA/150 (150MBps): It is first SATA interface which can run at 1.5GHz.But the practical data transfer is at 1.2Gb/s 0r 150 MB/s. It is the first generation SATA interface. The limitation of it is could handle only one pending transaction.
SATA 3.0Gb/s(SATA II,300MBps): It is second generation of SATA interfaces. It uses same encoding as in first generation and it supports the SATA/150. The practical speed is 300 MB/s.
SATA 3.0Gb/s(SATA III,750Mbps): In this evaluation it doubles the speed of previous version reaching the speed of 6Gb/s.
External SATA(eSATA): In 2004,external SATA was standardized with cables, connectors and signals for external SATA drives. It does not require protocol conversion from IDE and SATA. Its cable length can be extended up to 2m.
The latest SATA 6Gb/s technology which uses SATA Revision 3.0 specification has speed of 6Gb/s.