description of HDD ports [3/3]

ZXNet echo conference «real.speccy»

From Valerij Kozhevnikov (500:95/162. To All 7 April 1998


Hello, Roman!

Status register #C6AF (in) displays the current status of
HDD. The value of this register is updated after each command is executed. If the BSY bit of this register is set, then any access to the HDD is prohibited, and the values ​​of the remaining bits are invalid. Reading this register resets the hardware interrupt IRQ14 (this interrupt is not used in this design).
Values bits:

┌───────┬───────┬──────┬────
│ 7 │ 6 │ 5 │ 4 │ 3 │ 2 │ 1 │ 0 │
├───────┼───────┼──────┼────── ─┼──────┼───────┼──────┼──────┤
│ BSY │ DRDY │ WFT │ DSC │ DRQ │ CORR │ INX │ ERR │
└───────┴───────┴──────┴─────

bit 0 - Error
- indicates that the previous command ended with an error and
one or more bits are set in the error register.
Used to quickly check the successful completion of a command.
Resets when a new command is sent to the command register.

bit 1 - Index
- is set to 1 each time a packet of pancakes is rotated. Not used in
modern models.

bit 2 - Corrected Data
- indicates that an error occurred while reading data, which
was successfully corrected by the CCC equipment. Correctable
errors do not stop multi-sector transmission.

bit 3 - DataRequest
- this bit indicates that there is a request to exchange data with the sector buffer when executing read-write commands. For this
request, it is necessary to read/write data into the buffer, depending on the command being executed.
(in this scheme, a bit similar to this (27th pin of the connector)
controls the /wait signal of the CPU Z80).

bit 4 - Drive Seek Complete
- indicates that the heads have completed the search operation.

bit 5 - Write Fault
- indicates a fault in the drive, or an attempt to execute a "write" command with incorrect parameters.

bit 6 - Drive Ready
- set to 1 means the HDD is ready to execute the command.

bit 7 - Busy
- determines the state of the HDD. Set to 1 when executing a command or diagnostic after a system reset. When
this bit is set, no other bits in the status register are
valid. The Busy bit must be checked before
reading any status register.

The #C6AF (out) command register is used to load the
command being executed. Before writing a command, you need to prepare a task file - Task File (write the necessary data to
ports #EEAF, #E6AF, #DEAF, #D6AF, #CEAF), when the HDD is
in the “not busy” state (Busy = 0). Command execution begins
immediately, from the moment it is written to the command register.

The #CAAF (in) alternate state register contains the same information as the main one. The difference is that reading
the alternate register does not reset the set interrupt IRQ14. (IRQ14 is not used in this design).

The #CAAF (out) state control register contains three control
bit:

┌───────┬───────┬──────┬─────
│ 7 │ 6 │ 5 │ 4 │ 3 │ 2 │ 1 │ 0 │
├───────┼───────┼──────┼────── ┼───────┼───────┼──────┼──────┤
│ │ │ │ │ HS3EN │ SRST │ /IEN │ │
└───────┴───────┴──────┴─────

bit 1 - Interrupt Enable
- interrupt enable bit from HDD to HOST. When this bit is active and the drive is selected, HOST is interrupted. The signal to HOST
IRQ14 must be enabled via a tri-stable buffer. When
this bit is not active or HDD is not selected, the HOST IRQ14 signal will be
high. (This interrupt is not used in this circuit).

bit 2 - Soft Reset
- software reset. To reset the HDD, this bit must be set
to 1 and then reset to 0.

bit 3 - Heads 3 Enable
- used to allow selection of heads 8 to 15.

Drive address register #C2AF (in) contains the head and drive numbers selected by the previous oneteam.

┌───────┬───────┬──────┬──
│ 7 │ 6 │ 5 │ 4 │ 3 │ 2 │ 1 │ 0 │
├───────┼───────┼──────┼────── ─┼──────┼──────┼──────┼──────┤ │ /WTG │ /HS3 │ /HS2 │ /HS1 │ /HS0 │ /DS1 │ /DS0 │
└───────┴───────┴──────┴─────

bit 0,1 - Drive Select
- bits for selecting the corresponding drive 0 or 1.

bit 2,3,4,5 - Head Select
- binary code of the selected head.

bit 6 - Write Gate
- write progress bit, active during the write operation.

Jason.

Powered by ScorpionZS256turbo+/SMUC/HDD'IDE130Mb/FDD'800/
/CMOS/Covox/ATkbd/Mouse/CDOS...