ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³Integrated Drive Electronics (IDE), Harwdare Reference & Information Document³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ The information in this document is provided on an as is basis. I do not claim it is accurate or correct. Use at your own risk. This document contains no proprietary information. This is all ATA specifications. Share and enjoy. This information is not intended for beginners. If you cannot make sense of parts of this document read it again carefully. If you still don't understand it, then this document was not written for you. Some information presented here assumes prior knowledge of the subject. Also information may be slightly out of order, so to understand a particular section, you need to read later sections. Compiled by cyborg@kauri.vuw.ac.nz Tue, Jan 19th 1994 Wellington New Zealand PRIMARY REFERENCE MATERIALS: ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Quantum ProDrive 120/170/210AT OEM Hard Drive Reference. FUJITSU M2617T/M2618T Intelligent Disk Drive OEM Manual. IDE interface pin assignments: ÉÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍ» º Pin º Drive Cable º Signal º AT Bus º º No º Signal Name º Flow º Pin º ÌÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍ͹ º 1 º -Reset º <- º B2 º º 2 º Ground º º B1 º º 3 º D7 º <-> º A2 º º 4 º D8 º <-> º C11 º º 5 º D6 º <-> º A3 º º 6 º D9 º <-> º C12 º º 7 º D5 º <-> º A4 º º 8 º D10 º <-> º C13 º º 9 º D4 º <-> º A5 º º 10 º D11 º <-> º C14 º º 11 º D3 º <-> º A6 º º 12 º D12 º <-> º C15 º º 13 º D2 º <-> º A7 º º 14 º D13 º <-> º C16 º º 15 º D1 º <-> º A8 º º 16 º D14 º <-> º C17 º º 17 º D0 º <-> º A9 º º 18 º D15 º <-> º C18 º º 19 º Ground º º B1 º º 20 º KEY º º º º 21 º Reserved º º º º 22 º Ground º º B1 º º 23 º -IOW º <- º B13 º º 24 º Ground º º B1 º º 25 º -IOR º <- º B14 º º 26 º Ground º º B1 º º 27 º -IOCHRDY º -> º A10 º º 28 º SPSYNC/ALE º <- º B28 º º 29 º Reserved º º º º 30 º Ground º º B1 º º 31 º INTRQ º -> º D7 º º 32 º -IOCS16 º -> º D2 º º 33 º ADDR1 º <- º A30 º º 34 º -PDIAG º º º º 35 º ADDR0 º <- º A31 º º 36 º ADDR2 º <- º A29 º º 37 º -CS1FX º º º º 38 º -CS3FX º º º º 39 º -DASP º º º º 40 º Ground º º B1 º ÈÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍͼ Register Address Decoding The host addresses the drive with programmed I/O. Host address lines A0, A1, A2, chip select CS1FX- and CS3FX-, IOR- and IOW- address the disk registers. Host address lines A3...A9 generate the two chip selects: CS1FX- and CS3FX-. Chip select CS1FX- accesses the eight hard disk Command Block Registers. Chip select CS3FX- is valid during 8 bit transfers to/from the Control Block registers alternate status and Device Control, and drive address. The drive selects the primary or alternate command block addresses using address bit A7. (Note: What the above sentence means is that there is a provision for a primary host adapter at I/O address 1FX/3FX and a secondary host adapter at I/O adress 17X/37X. Each host adapter can have up to two hard drives MASTER/SLAVED off it. See below for a graphical explanation: HEX BINARY DESCRIPTION 1FX 0001 1111 XXXX Primary Command Registers 3FX 0011 1111 XXXX Primary Control Registers 17X 0001 0111 XXXX Alternate Command Registers 37X 0011 0111 XXXX Alternate Control Registers ³ ÀÄÄÄ Address bit A7 X means "don't care" i.e. X can be 0h, 1h, 2h, ..., Dh, Eh, Fh or 0b, 1b). Data bus lines D8...D15 are valid only when IOCS16- is active and the drive is transferring data. The transfer of ECC information occurs only on data bus lines D0...D7 and data bus lines D8...D15 are invalid during such transfer. Pin Descriptions: -RESET is asserted for at least 25 microseconds after voltage levels have stabilized during power on and negated thereafer unless the drive needs to be reset at a later time. D0...D15 bidirectional data bus. D0...D7 are used during 8 bit data transfers e.g. registers and ECC bytes. KEY is not a connection. The connection pin is missing and forms part of a mechanism that prevents the IDC connector from being reverse connected. -IOW is the Write strobe signal. The rising edge of -IOW clocks data from from the host to the drive. -IOR is the Read strobe signal. The falling edge of -IOR enables data from the drive onto the host data bus. -IOCHRDY is negated to extend the host transfer cycle of any host register read/write access when the drive is not ready to respond to a data transfer request. When not negated, it is in a high impedance state. SPSYNC spindle synchronization. This may be either input or output to the drive depending on a vendor defined switch. If a drive is set to MASTER the signal is output and if a drive is SLAVE the signal is input. There is no requirement that each drive implementation be plug compatible to the extent that a multiple vendor drive subsystem be operable. However if drives are designed to match the following recommendations then controllers can operate drives with a single implementation: There can only be one MASTER drive at a time in a configuration. The host or the drive designated as master can generate SPSYNC at least once per revolution (it may be more than onceper revolution). SPSYNC received by a drive is used as the synchronization signal to lock the spindles in step. The time to achieve synchronization varies and is indicated by the drive setting DRDY. If the drive does not achieve synchronization, it will not set DRDY. A master drive or a host generates SPSYNC and transmits it. A slave does not generate SPSYNC and must be responsible to synchronize its index to SPSYNC. If a drive does not support synchronization, it will ignore SPSYNC. In the event that a previously synchronized drive loses synchronization, it does not clear DRDY. Prior to the introduction of this standard, this signal was defined as ALE (Address Latch Enable) and was used for an address valid indication from the host system. If used, the host address and chip selects, ADDR0 through ADDR2, CS1FX- and CS3FX- were valid at the negation of this signal and remained valid while ALE was negated, therefore the drive did not need to latch these signals with ALE. INTRQ is used to interrupt the host system when the drive has a pending interrupt, the drive is selected and the host has enabled drive interrupts by clearing nIEN in the Device Control Register. INTRQ is negated by: o assertion of -RESET. o the setting of SRST in the Device Control Register. o the host writing to the Command Register. o the host reading the Status Register. NOTE: Some drives may negate INTRQ on PIO data transfer completion, except on a single sector read or on the last sector of a multi-sector read. On PIO transfers INTRQ is asserted at the begining of each data block to be transfered. A data block is usually a single sector except when declared otherwise via the Set Multiple Command. An exception occurs on Format Track, Write Sector(s), Write Buffer and Write Long commands and INTRQ will not be asserted at the begining of the first data block to be transferred. -IOCS16 indicates to the host that the 16 bit data port has been addressed and the drive is prepared to send/receive a 16 bit data word. This signal is an open collector output. D8...D15 are only valid when -IOCS16 is active and the drive is transferring data. The transfer of ECC data occurs only on D0...D7 so D8...D15 are invalid during ECC transfers. ADDR0-2 used to select a register or a data port in the drive. -PDIAG will be asserted by Drive 1 to indicate to Drive 0 that it has passed diagnostics. Following a power-on reset or software reset, Drive 1 will negate -PDIAG within 1 msec to indicate to Drive 0 that it is busy. Drive 1 will then assert -PDIAG within 30 secs to indicate that it is no longer busy and can provide status information. After the assertion of -PDIAG, Drive 1 may be unable to accept commands until it has finished its reset procedure and DRDY is set. Following the receipt of a valid Execute Drive Diagnostics command, Drive 1 will negate -PDIAG within 1 msec to indicate to Drive 0 that it is busy and has not yet passed its drive diagnostics. If Drive 1 is pressent, then Drive 0 will wait for up to 5 msec from the receipt of a valid Execte Drive Diagnostics command for Drive 1 to assert -PDIAG. Drive 1 should clear BUSY beforeasserting -PDIAG as -PDIAG is used to indicate the Drive 1 has passed its diagnostics and is ready to post status. If -DASP was not asserted by Drive 1 during reset initialization, Drive 0 will post its own status immediately after it completes its diagnostics and clear the Drive 1 Status Register to 00h. Drive 0 may be unable to accept commands until it has finished its reset procedure and DRDY is set. -CS1FX is a chip select generated by address decoding circuitry from host address lines A3...A9. Usually asserted during I/O operations to ports 1F0 through 1F7. -CS1FX is used to access the eight hard disk Command Block Registers. -CS3FX is a chip select generated by address decoding circuitry from host address lines A3...A9. Usually asserted during I/O operations to ports 3F0 through 3F7. -CS3FX is valid during 8 bit transfers to/from the Control Block Registers, Alternate Status Register, Device Control Register and drive address. NOTE: The primary host adapter is accessed via I/O addresses 1FX and 3FX while the secondary host adapter is accessed via I/O addresses 17X and 37X. See Ed's note under the paragraph "Register Address Decoding" above. -DASP is a time multiplexed signal which indicates that a drive is active or that Drive 1 is present. It is an open collector output. During power-on initialization or after reset, -DASP will be asserted by Drive 1 within 400 msec to indicate its presence. Drive 0 will allow up to 450 msec for Drive 1 to assert -DASP. If Drive 1 is not present, Drive 0 may use -DASP to drive an activity LED. -DASP will be negated following acceptance of the first valid command by Drive 1 or after 31 seconds, whichever comes first. Any time after negation of -DASP, it may be used by either drive as an activity indicator. I/O Port Functions: ÉÍÍÍÍËÍÍÍÍÍÍËÍÍÍÍÍÍËÍÍÍËÍÍÍËÍÍÍËÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» ºAddrº-CS1FXº-CS3FXºSA2ºSA1ºSA0º Read (-IOR) º Write (-IOW) º ÌÍÍÍÍÎÍÍÍÍÍÍÎÍÍÍÍÍÍÎÍÍÍÎÍÍÍÎÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍ» º º 0 º 0 º X º X º X º ILLEGAL º ILLEGAL º <--¿ º º º 1 º 1 º X º X º X º High Impedance º Not Used º Control º º3FX º 1 º 0 º 0 º X º X º High Impedance º Not Used º Block º º3FX º 1 º 0 º 1 º 0 º X º High Impedance º Not Used º Registers º º3F6 º 1 º 0 º 1 º 1 º 0 º Altern Status º Device Controlº | º º3F7 º 1 º 0 º 1 º 1 º 1 º Drive Address º Not Used º <--Ù º ÌÍÍÍÍÎÍÍÍÍÍÍÎÍÍÍÍÍÍÎÍÍÍÎÍÍÍÎÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍ͹ º1F0 º 0 º 1 º 0 º 0 º 0 º Data Port º Data Port º <--¿ º º1F1 º 0 º 1 º 0 º 0 º 1 º Error Register º Precomp º | º º1F2 º 0 º 1 º 0 º 1 º 0 º Sector Count º Sector Count º Command º º1F3 º 0 º 1 º 0 º 1 º 1 º Sector Number º Sector Number º Block º º1F4 º 0 º 1 º 1 º 0 º 0 º Cylinder Low º Cylinder Low º Registers º º1F5 º 0 º 1 º 1 º 0 º 1 º Cylinder High º Cylinder High º | º º1F6 º 0 º 1 º 1 º 1 º 0 º Drive / Head º Drive / Head º | º º1F7 º 0 º 1 º 1 º 1 º 1 º Status º Command º <--Ù º ÈÍÍÍÍÊÍÍÍÍÍÍÊÍÍÍÍÍÍÊÍÍÍÊÍÍÍÊÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍͼ At power-up or after reset, the Command Block Registers are initialized to the following values: REGISTER VALUE 1F1 Error : 01 1F2 Sector Count : 01 1F3 Sector Number : 01 1F4 Cylinder Low : 00 1F5 Cylinder High : 00 1F6 Drive / Head : 00 Register Descriptions: 1F0: Read/Write: DATA PORT REGISTER All data transferred between the device data buffer and the host passes through this register. Also, the port to which the sector table is transferred during execution of the Format command. Transfers of ECC bytes during the execution of Read/Write Long commands are 8 bit transfers. 1F1: Read: ERROR REGISTER Contains status information about the last command executed by the drive. The contents of this register are valid only when the error bit (ERR) in the Status Register is set, except at drive power-up or at the completion of the drive's internal diagnostics, when the register contains a status code. When the error bit (ERR) is set, Error Register bits are interpreted as such: ÉÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» º BIT º Mnemonic º Description º ÌÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹ º 7 º BBK º Bad block mark detected in the requested sector's ID field º º 6 º UNC º Uncorrectable data error encountered º º 5 º º Not used º º 4 º IDNF º Requested sector's ID field not found º º 3 º º Not used º º 2 º ABRT º Command aborted due to drive status error or invalid commandº º 1 º TK0NF º Track 0 not found during execution of Recalibrate command º º 0 º AMNF º Data address mark not found after correct ID field found º ÈÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ 1F1: Write: WRITE PRECOMPENSATION The drive ignores the write precompensation value passed by the host. 1F2: Read/Write: SECTOR COUNT REGISTER Defines the number of sectors of data to be transferred across the host bus, for the subsequent command. If the value in this register is zero, the sector count is 256 sectors. If the command executes successfully, the value in this register at command completion is zero. As each sector is transferred, the Sector Count register is decremented by one to reflect the number of sectors remaining to be transferred. If the command execution is not successful, this register contains the number of sectors that must be transferred to complete the original request. 1F3: Read/Write: SECTOR NUMBER REGISTER Contains the ID number of the first sector to be accessed by the subsequent command. The sector can be from one to the maximum number of sectors per track. See the command description for additional information about the contents of the Sector Number Register following command completion whether successful or unsuccessful. 1F4: Read/Write: CYLINDER LOW REGISTER Contains the eight low order bits of the starting cylinder address for any disk access. On multiple sector transfers that cross cylinder boundaries, this register is updated at the end of the command to reflect the current cylinder number. The least significant bits of the cylinder address are loaded into the cylinder low register. 1F5: Read/Write: CYLINDER HIGH REGISTER Contains the eight high order bits of the starting cylinder address for any disk access. On multiple sector transfers that cross cylinder boundaries, this register is updated at hte end of the command to reflect the current cylinder number. The most significant bits of the cylinder address are loaded into the cylinder high register. 1F6: Read/Write: DRIVE/HEAD REGISTER Contains the drive ID number and its head number for any disk access. The contents of the Drive/Head Register are defined on execution of the Initialize Drive Parameters command. The bits are defined as follows: ÉÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» º BIT º Mnemonic º Description º ÌÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹ º 7 º Reserved º Always one. º º 6 º Reserved º Always zero. º º 5 º Reserved º Always one. º º 4 º DRV º 0 to select primary drive, 1 to select secondary drive. º º 3 º HS3 º MSB of head number. º º 2 º HS2 º º º 1 º HS1 º º º 0 º HS0 º LSB of head number. º ÈÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ Upon command completion this register is updated to refplect the head number currently selected. 1F7: Read: STATUS REGISTER Contains information about the status of the drive and controller. The contents of this register are updated at the completion of each command. When the busy bit is set, no other bits in the Command Block Registers are valid. When the busy bit is not set, the information in the Status Register and Command Block Registers is valid. ÉÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» º BIT º Mnemonic º Description º ÌÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹ º 7 º BUSY º Busy bit. Set by the controller logic of the drive when º º º º ever the drive has access to and the host is locked out º º º º of the Command Block Registers. Set under the following º º º º conditions: º º º º o Within 400 nsec after the negation of RESET or after º º º º SRST is set in the Device Control Register. After a º º º º reset it is recomended that BUSY be set no more than º º º º 30 seconds. º º º º o Within 400 nsec of a host write to the Command º º º º Register with a Recalibrate, Read Long, Read Buffer, º º º º Read, Read Verify, Initialize Drive Parameters, Seek º º º º Identify Drive, or Execute Drive Diagnostic command. º º º º o Within 5 microseconds following the transfer of 512 º º º º bytes of data during the execution of a Write, Write º º º º Buffer or Format Track command; or 512 bytes of data º º º º and the appropriate number of ECC bytes during the º º º º execution of a Write Long command. º º º º When BUSY is set no Command Block Register can be º º º º written too and a read of any Command Block Register º º º º returns the contents of the Status Register. º º º º º º 6 º DRDY º Drive Ready bit. Indicates that the drive is ready to º º º º accept commands. When and error occurs, this bit stays º º º º unchanged until the host reads the Status Register then º º º º again indicates that hte drive is ready. On power up, º º º º this bit should be cleared and should remain cleared º º º º until the drive is up to speed and ready to accept a º º º º command. º º º º º º 5 º DWF º Drive Write Fault bit. When an error occurs, this bit º º º º remains unchanged until the host reads the Status º º º º Register, then again indicates the current write fault º º º º status. º º º º º º 4 º DSC º Drive Seek Complete bit. This bit is set when a seek º º º º operation is complete and the heads are settled over a º º º º track. When an error occurs, this bit remains unchanged º º º º until the host reads the Status Register, then again it º º º º indicates the current seek complete status. º º º º º º 3 º DRQ º Data Request bit. When set it indicates that the drive º º º º is ready to transfer a word or byte of data between the º º º º host and the data port. º º º º º º 2 º CORR º Corrected Data bit. When a correctable data error has º º º º been encountered and the data has been corrected, this º º º º bit is set. This condition does not terminate a multi º º º º sector read operation. º º º º º º 1 º INDEX º Index bit. Set when the index mark is detected once per º º º º disk revolution. º º º º º º 0 º ERROR º Error bit. When set indicates that the previous command º º º º ended in an error. The other bits in the Error Register º º º º and Status Register contain additional information about º º º º the cause of the error. º ÈÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ 1F7: Write: COMMAND REGISTER When the host request a command it is transferred to the hard drive through an eight bit code written to the command register. As soon as the drive receives a command in its command register, it begins execution of the command. The following table lists the commands in alphabetical order and the parameters for each executable command: ÉÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» º Commandº Command Description º Parameters Used º º Code º º PC SC SN CY DH º ÌÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹ º 98h @ º Check Power Mode º V D º º E5h @ º Check Power Mode (same as 98h) º V D º º 90h º Execute Drive Diagnostic º D+ º º 50h º Format Track º V V º º ECh @ º Identify Drive º D º º 97h @ º Idle º V D º º E3h @ º Idle (same as 97h) º V D º º 95h @ º Idle Immediate º D º º E1h @ º Idle Immadiate (same as 95h) º D º º 91h º Initialize Drive Parameters º V V º º E4h @ º Read Buffer º D º º C8h @ º Read DMA With Retry º >> Unknown << º º C9h @ º Read DMA º >> Unknown << º º C4h @ º Read Multiple º V V V V º º 20h º Read Sectors With Retry º V V V V º º 21h º Read Sectors º V V V V º º 22h º Read Long With Retry º V V V V º º 23h º Read Long º V V V V º º 40h º Read Verify Sectors With Retry º V V V V º º 41h º Read Verify Sectors º V V V V º º 1Xh º Recalibrate º D º º 7Xh º Seek º V V º º EFh @ º Set Features º V D º º C6h @ º Set Multiple Mode º V D º º 99h @ º Set Sleep Mode º D º º E6h @ º Set Sleep Mode (same as 99h) º D º º 96h @ º Standby º V D º º E2h @ º Standby (same as 96h) º V D º º 94h @ º Standby Immediate º D º º E0h @ º Standby Immediate (same as 94h) º D º º 8Xh º Vendor Unique º >> Unknown << º º 9Ah º Vendor Unique º >> Unknown << º º C0h º Vendor Unique º >> Unknown << º º C1h º Vendor Unique º >> Unknown << º º C2h º Vendor Unique º >> Unknown << º º C3h º Vendor Unique º >> Unknown << º º F5h º Vendor Unique º >> Unknown << º º F6h º Vendor Unique º >> Unknown << º º F7h º Vendor Unique º >> Unknown << º º F8h º Vendor Unique º >> Unknown << º º F9h º Vendor Unique º >> Unknown << º º FAh º Vendor Unique º >> Unknown << º º FBh º Vendor Unique º >> Unknown << º º FCh º Vendor Unique º >> Unknown << º º FDh º Vendor Unique º >> Unknown << º º FEh º Vendor Unique º >> Unknown << º º FFh º Vendor Unique º >> Unknown << º º E8h @ º Write Buffer º D º º CAh @ º Write DMA With Retry º >> Unknown << º º CBh @ º Write DMA º >> Unknown << º º C5h @ º Write Multiple º V V V V º º E9h @ º Write Same º >> Unknown << º º 30h º Write Sectors With Retry º V V V V º º 31h º Write Sectors º V V V V º º 32h º Write Long With Retry º V V V V º º 33h º Write Long º V V V V º º 3Ch @ º Write Verify º V V V V º ÈÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ KEY FOR SYMBOLS IN ABOVE TABLE: PC Register 1F1: Write Precompensation SC Register 1F2: Sector Count SN Register 1F3: Sector Number CY Register 1F4+1F5: Cylinder low + high DH Register 1F6: Drive / Head @ These commands are optional and may not be supported by some drives. D Only DRIVE parameter is valid, HEAD parameter is ignored. D+ Both drives execute this command regardless of the DRIVE parameter. V Indicates that the register contains a valid paramterer. Commands with >> Unknown << Parameters are not described in this document. If a parameter is blank, then the command does not require the contents of that register. 3F6: Read: Alternate Status Register Contains the same information as the Status Register in the Command Block. Reading the Alternate Status Register does not imply an interrupt acknowledge from the host or clear a pending interrupt. See the description of the Status Register above for a definition of bits in this register. 3F6: Write: Device Control Register The bits in the Device Control Register are lister in the table below: ÉÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» º BIT º Mnemonic º Description º ÌÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹ º 7 º Reserved º º º 6 º Reserved º º º 5 º Reserved º º º 4 º Reserved º º º 3 º 1 º Always set. º º 2 º SRST º Host Software Reset bit. When this bit is set the drive º º º º is held reset. If two drives are daisy chained on the º º º º interface, this bit resets both drives simultaneously. º º º º º º 1 º nIEN º Drive Interrupt Enable bit. The enable bit for the drive º º º º interrupt to the host. When nIEN is 0 or the drive is º º º º selected the host interrupt signal INTRQ is enabled º º º º through a tri state buffer to the host. When nIEN is 1 º º º º or the drive is not selected the host interrupt signal º º º º INTRQ is in a hig himpedance state regardless of the º º º º presence or absence of a pending interrupt. º º º º º º 0 º 0 º Always clear. º ÈÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ 3F7: Read: Drive Address Register This port returns the drive select and head select addresses for the drive currently selected. The Drive Address bits are listed in the table below: ÉÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» º BIT º Mnemonic º Description º ÌÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹ º 7 º HiZ º This bit is in high impedance when read. º º 6 º nWTG º Write Gate bit. When a write to the hard drive is in º º º º progress, nWTG is 0 º º 5 º nHS3 º Negated MSB of head number º º 4 º nHS2 º º º 3 º nHS1 º º º 2 º nHS0 º Negated LSB of head number. º º 1 º nDS1 º Drive 1 Select bit. When 0, Drive 1 is selected. º º 0 º nDS0 º Drive 0 Select bit. When 0, Drive 0 is selected. º ÈÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ COMMAND DESCRIPTIONS The drive decodes and executes commands loaded into the Command Register. In applications involving two hard drives, both drives receive all commands but only the selected drive executes commands. The recommended procedure for executing a command on the selected drive is: 1. Wait for drive to clear BUSY. 2. Load required parameters in the Command Block Registers. 3. Activate the Interrupt Enable (nIEN) bit. 4. Wait for drive to set DRDY. 5. Write the command code to the Command Register. Execution of the command begins as soon as the drive loads the Command Block Register. The remainder of this section describes the function of each command. 90h: Execute Drive Diagnostic Performs internal diagnostic tests implemented by the drive. Drive 0 sets BUSY within 400 nsec of the receipt of the command. If Drive 1 is present: o Both drives execute diagnostics. o Drive 0 waits up to 5 seconds for Drive 1 to assert PDIAG- o If Drive 1 does not assert PDIAG-, indicatinf a failure, Drive 0 appends 80h with its own diagnostic status. o If the host detects a Drive 1 diagnostic failure when reading Drive 0 status it sets the DRV bit then reads the Drive 1 status. If Drive 1 is not present: o Drive 0 reports only its own diagnostic results. o Drive 0 clears BUSY and generates an interrupt. If Drive 1 fails diagnostics, Drive 0 appends 80h with its own diagnostic status and loads that code in the Error Register. If Drive 1 passes its diagnostics or no Drive 1 is present, Drive 0 appends 00h with its own diagnostic status and loads that in the Error Register. The Diagnostic Code written to the Error Register is a unique 8 bit code as listed below. ÉÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» º Code º Description º ÌÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹ º 01 º No error detected. º º 02 º Formatter device error. º º 03 º Sector buffer error. º º 04 º ECC circuitry error. º º 05 º Controller microprocessor error. º º 8X º Drive 1 failed. º ÈÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ 50h: Format Track The track address is specified in the Sector Count Register. When the drive accepts this command, it sets the DRQ bit then waits for the host to fill the sector buffer. When the buffer is full, the drive clears DRQ, sets BUSY and begins command execution. ECh: Identify Drive This command enables the host to receive paramater information from the drive. When the host issues this command, the drive sets BUSY, stores the required parameter information in the sector buffer, sets DRQ and generates an interrupt. The host then reads the information from the sector buffer. The table below defines the words stored in the buffer. All reserved fields should be zeros. ÉÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» º Word º Description º ÌÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹ º 00h º Bit mapped general configuration information. True when bit set º º º Bit 15: Reserved for non magnetic drives. º º º Bit 14: Format speed tolerance gap not required. º º º Bit 13: Track offset option not available. º º º Bit 12: Data strobe offset option not available. º º º Bit 11: Rotational speed tolerance is < 0.5% º º º Bit 10: Disk transfer rate not > 10 MB/s º º º Bit 09: Disk transfer rate > 5 MB/s and < 10 MB/s º º º Bit 08: Disk transfer rate > 5 MB/s º º º Bit 07: Removable cartridge drive. º º º Bit 06: Fixed drive. º º º Bit 05: Spindle motor control option not implemented. º º º Bit 04: Head switch time > 15 microseconds. º º º Bit 03: Not MFM encoded. º º º Bit 02: Not soft sectored. º º º Bit 01: Hard Sectored. º º º Bit 00: Reserved. º º º º º 01h º Number of logical cylinders in the default translation mode. º º º º º 02h º Reserved. º º º º º 03h º Number of logical heads in the default translation mode. º º º º º 04h º Number of unformatted bytes per logical track. º º º º º 05h º Number of unformatted bytes per sector. º º º º º 06h º Number of logical sectors per track. º º º º º 07h º Bits 15...08: Inter Sector Gap after Index & before splice. º º º Bits 07...00: Inter Sector Gap bytes. º º º º º 08h º Bits 15...08: Reserved. º º º Bits 07...00: Bytes in Phase Lock Oscillator field. º º º º º 09h º Number of vendor unique status words. º º º º º 0Ah º Serial number, 20 ASCII chars, right aligned & padded with 20h. º º º º º 14h º Controller type: º º º 0000h: Not specified. º º º 0001h: Single ported, single sector buffer capable of data º º º transfers only to or from the host or the disk at one º º º time. º º º 0002h: Dual ported, multiple sector buffer capable of º º º simultaneous data transfers to and from the host, or º º º from the host and the disk. º º º 0003h: Dual ported, multiple sector buffer capable of º º º simultaneous data transfers with read caching. º º º 0004h-FFFFh: Reserved. º º º º º 15h º Buffer size in 512 byte increments. º º º º º 16h º Number of ECC bytes passed to host on R/W long operations. º º º º º 17h º Firmware revision, 8 ASCII chars, left aligned & space padded. º º º º º 1Bh º Model Number, 40 ASCII chars, left aligned & space padded. º º º º º 2Fh º READ/WRITE multiples implemented. º º º º º 30h º Supports double word I/O transfer. º º º º º 31h º Reserved. º º º º º 32h º Reserved. º º º º º 33h º Minimum PIO data transfer cycle time in nsec. º º º º º 34h º Minimum DMA data transfer cycle time in nsec. º º º º º 35h º All words past this point are reserved. º ÈÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ 91h: Initialize Drive Parameters This command wnables the host to set the head switch and sector wrap values for multi sector operations. Upon receipt of the command the drive sets BUSY and generates an interrupt. The only two registers used are the Sector Count Register which specifies the number of sectors and the Drive/Head Register which specifies the number of heads minus one. The DRV bit assigns these values to Drive 0 or Drive 1 as appropriate. This command does not check the sector count and head values for validity. If these values are invalid, the drive will not report an error until another command causes an illegal access. 1Xh: Recalibrate This command moves the read/write heads from any location on the disk to cylinder 0. Upon receipt of this command, the drive sets BUSY and issues a seek to cylinder 0. The drive the waits for the seel to complete, updates status, negates BUSY and generates an interrupt. E4h: Read buffer This command enables the host to read the current contents of the drive's sector buffer. When the host issues this command, the drive sets BUSY, sets up the sector buffer for a read operation, sets DRQ, clears BUSY, and generates an interrupt. The host then reads up to 512 bytes of data from the buffer. Read Buffer and Write Buffer commands are synchronizes so that sequential Read Buffer and Write Buffer commands access the same 512 bytes within the buffer. 20h: Read Sectors with Retry 21h: Read Sectors without Retry The Read Sectors command reads from 1 to 256 sectors, beginning at the specified sector. As specified in the Command Bloks Register, a sector count equal to 0 requests 256 sectors. When the drive accepts this command it sets BUSY and begins execution of the command. For single sector reads, the drive performs an implicit seek if it is not on the requested track. Once there it looks for the appropriate ID field. For no retry commands, if two index pulses occur without an error free read of the requested ID field, the drive posts an ID not found error in the Error Register. For retry commands, the drive attempts to read the ID field up to a vendor specific number of retries before reporting the error. If the drive reads the requested ID field correctly, it must recognize the data address mark within a specified number of bytes or report a data address mark not found error. Once the drive finds the data address mark it reads the data field into the sector buffer. If an error occurs the drive sets the error bits, sets DRQ and generates an interrupt. The drive always sets DRQ regardles of the presence or absence of an error condition at the end of the sector. Upon command completion the Command Block Register contains the cylinder, head, sector of the last sector read. 22h: Read Long with Retry 23h: Read Long without Retry For multiple sector reads, the drive sets DRQ, clears BUSY and generates an interrupt each time the drive is ready to sent a sector to the host. When the sector transfer completes the drive clears DRQ and on all except the last sector sets BUSY. At the completion of the command, the Command Block Register contains the cylinder, head, sector of the last sector read. If an uncorrectable error occurs during a multiple sector read, the read terminates at the sector in which the error occured. The Command Block Register contains the cylinder, head, sector where the error occured. The host can then determine what error occurred and where. Whether the error was correctable or uncorrectable the drive loads the data in the sector buffer. When a Read Long command executes, data and ECC bytes contained in the data field of the requested sector are returned in the sector buffer. The drive does not check the ECC bytes to determine if a data error has occured. Multi sector Read Long opperations are supported. 40h: Read Verify Sector with Retry 41h: Read Verify Sector without Retry The execution of this command is identical to the Read Sectors command but the Read Verify command does not cause the drive to set DRQ, and the drive transfers no data to the host. On receipt of Read Verify commandm the drive sets BUSY. When the requested sectors have been verified, the drive clears BUSY and generates an interrupt. Upon command completion the Command Block Register contains the cylinder, head, sector of the last sector verified. If an error occurs during a multi sector verify, the verify terminates at the sector in which the error occured and this can be found in the Command Block Register. 7Xh: Seek The seek command initiates a seek to the track and selects the head specified in the Command Block Register. It is not necessary for the drive to be formatted for a seek to execute properly. When the host issues a Seek command the drive sets BUSY and generates an interrupt. The drive will not set DSC until the seek is complete. A seek may net be complete before the drive returns the interrupt. If the host issues a new command to the drive while a seek is in progress, BUSY remains set until the seek completes then the drive executes the new command. EFh: Set Features This command is used by the host to establish parameters that effect the execution of certain drive features. When the drive receives this command it sets BUSY, checks the contents of the Features Register (Write Precomp Register), clears BUSY and generates an interrupt. Features are drive specific and may include: 33h: retry inhibited 44h: 11 bytes ECC enabled 55h: disable read cache 77h: ECC disabled 88h: ECC enabled 99h: retry enabled AAh: read cache enabled BBh: 4 bytes ECC enabled If the value in the Feature Register is not supported or is invalid, the drive aborts the command. E8h: Write Buffer This command enables the host to overwrite the contents of the drive's sector buffer with any data pattern. On receipt of this comand the drive sets BUSY within 400 nsec, sets up the sector buffer for a write operation, sets DRQ and clears BUSY. The host then writes up to 512 bytes of data to the buffer. The Read Buffer and Write Buffer are synchronized so that back to back Read Buffer and Write Buffer commands access the same 512 bytes within the buffer. 30h: Write Sectors with Retry 31h: Write Sectors without Retry This command writes from 1 to 256 sectors beginning at the specified sector and as stated earlier, a sector count of 0 in the Command Block Register will request 256 sectors. When the drive accepts this command it sets DRQ and wait for the host to fill the sector buffer with the data to be written to disk. No interrupt is generated to start the first buffer fill operation and once the buffer is full the drive clears the DRQ, sets BUSY and begins execution of the command. For single sector Write operations, the drive sets DRQ upon receipt of the command and waits for the host to fill the sector buffer. Once a sector has been transferred, the drive sets BUSY and clears DRQ. If the drive is not on the requested cylinder and head an inplied seek and/or head switch is performed. Once the desired track is reached the drive searches for the appropriate ID field. If the ID field is read correctly, the information in the buffer, including the ECC bytes is written to the disk. When the drive has processed the sector, it clears BUSY and generated an interrupt. The host reads the Status Register. At the completion of this command the Command Block Registers contain the cylinder, head, sector of the last sector written. During multi sector Write operations, the drive sets DRQ, clears BUSY and generated and interrupt on all but the first sector when it is ready to receive a sector from the host. Once the sector transfer comapletes, the drive clears DRQ, and sets BUSY. When the last sector has been written to the disk, the drive clears BUSY, DRQ is already clear, and generates an interrupt. At the completion of the command, the Command Block Registers contain the cylinder, head, sector of the last sector written to disk. If an error occurs during a multi sector Write operation, the write terminates at the sector in which the error occured. The Command Block Register contains the cylinder, head, sector of the sector in which the error occured. Ther host can then determine which error occured and where. 32h: Write Long Sectors with Retry 33h: Write Long Sectors without Retry When the Write Long command is executed, the drive writes the data and ECC bytes from the sector buffer to disk. The drive does not generate the ECC bytes itself. Multi sector Write Long operations are supported. Operation is similar to the Write Sector commands above. --- DOCUMENT ENDS HERE ---