PC87311A/PC87312 (SuperI/OTMII/III)
Floppy Disk Controller with Dual UARTs,
Parallel Port, and IDE Interface
General Description
The PC87311A/12 incorporates a floppy disk controller
(FDC), two full function UARTs, a bidirectional parallel port,
and IDE interface control logic in one chip. The PC87311A
includes standard AT/XT address decoding for on-chip
functions and a Configuration Register, offering a single
chip solution to the most commonly used IBM
PC-XT
, and PC-ATÉperipherals. The PC87312 includes
É
standard AT address decoding for on-chip functions and a
Configuration Register set, offering a single chip solution to
the most commonly used ISA, EISA and Micro Channel peripherals.
The on-chip FDC is software compatible to the PC8477,
which contains a superset of the DP8473 and NEC mPD765
and the N82077 floppy disk controller functions. The onchip analog data separator requires no external components and supports the 4 Mb drive format as well as the
other standard floppy drives used with 5.25
dia.
In the PC87311A, the UARTs are equivalent to two
INS8250N-Bs or NS16450s. The bidirectional parallel port
maintains complete compatibility with the IBM PC, XT and
AT. In the PC87312 the UARTs are equivalent to two
NS16450s or PC16550s. The bidirectional parallel port
maintains complete compatibility with the ISA, EISA and Micro Channel parallel ports.
The IDE control logic provides a complete IDE interface except for the signal buffers. The Configuration Registers consist of three byte-wide registers. An Index and a Data Register which can be relocated within the ISA I/O address space
access the Configuration Registers.
ÉPCÉ
and 3.5×me-
×
Features
Y
100% compatible with IBM PC, XT, and AT architectures (PC87311A), or ISA, EISA, and Micro Channel architectures (PC87312)
Y
FDC:
Ð Software compatible with the DP8473, the 765A and
,
the N82077
Ð 16-byte FIFO (default disabled)
Ð Burst and Non-Burst modes
Ð Perpendicular Recording drive support
Ð High performance internal analog data separator (no
external filter components required)
Ð Low power CMOS with power down mode
Y
UARTs:
Ð Software compatible with the INS8250N-B and the
NS16450 (PC87311A), or PC16550A and PC16450
(PC87312)
Y
Parallel Port:
Ð Bidirectional under either software or hardware
control
Ð Compatible with all IBM PC, XT and AT architectures
(PC87311A), or all ISA, EISA, and Micro Channel ar-
chitectures (PC87312)
Ð Back Voltage protection circuit against damage
caused when printer is powered up
Y
IDE Control Logic:
Ð Provides a complete IDE interface except for option-
al buffers
Y
Address Decoder:
Ð Provides selection of all primary and secondary ISA
addresses including COM 1 –4.
Y
100-pin PQFP package
Ð The PC87311A and PC87312 are pin compatible
October 1993
PC87311A/PC87312 (SuperI/O II/III) Floppy Disk Controller
with Dual UARTs, Parallel Port, and IDE Interface
Block Diagram
TL/F/11362– 1
TRI-STATEÉis a registered trademark of National Semiconductor Corporation.
TM
SuperI/O
is a trademark of National Semiconductor Corporation.
IBM
,PCÉ, PC-ATÉ, PC-XTÉand PS/2Éare registered trademarks of International Business Machines Corporation.
É
C
1995 National Semiconductor CorporationRRD-B30M75/Printed in U. S. A.
A9–A021–30IAddress. These address lines from the microprocessor determine which internal register is accessed.
ACK85IAcknowledge. This input is pulsed low by the printer to indicate that it has received data from the
AFD78OAutomatic Feed XT. When this signal is low the printer should automatically line feed after each line is
AEN20IAddress Enable. This input disables function selection via A9 – A0 when it is high. Access to the FDC
BADDR055IBase Address. This bit determines one of two base addresses from which the Index and Data
BOUT1,2 73, 65OBAUD Output. This multi-function pin provides the associated serial channel Baud Rate generator
BUSY84IBusy. This pin is set high by the printer when it can’t accept another character. This pin has a nominal
CFG0–465, 66,IDefault Configuration. These CMOS inputs select 1 of 32 default configurations in which the
71, 73,
74
CSOUT3OChip Select Output. When the associated bit in the Power and Test Configuration Register is set, this
CTS1,272, 64IClear to Send. When low, this indicates that the MODEM or data set is ready to exchange data. The
D7–D010–17 I/O Data. Bi-directional data lines to the microprocessor. D0 is the LSB and D7 is the MSB. These signals
DACK5IDMA Acknowledge. Active low input to acknowledge the FDC DMA request and enable the RD and
DCD1,277, 69IData Carrier Detect. When low, this indicates that the data carrier has been detected by the MODEM
DENSEL48ODensity Select. Indicates when a high FDC density data rate (500 kb/s or 1 Mb/s) or a low density
DIR41ODirection. This output determines the direction of the floppy disk drive (FDD) head movement (active
A0–A9 are don’t cares during an FDC DMA transfer.
parallel port. This pin has a nominal 25 kX pull-up resistor attached.
printed. This pin will be in a TRI-STATEÉcondition 10 ns after a zero is loaded into the corresponding
Control Register bit. The system should pull this pin high using a 4.7 kX resistor.
Data Register during DMA transfer is NOT affected by this pin.
Registers will be offset (see Table 2-2). An internal pull-down resistor of 40 kX is on each pin. Use a
10 kX resistor to pull this pin to the required level during reset.
output signal, if test mode is selected in the Power and Test Configuration Register and the DLAB bit
(LCR7) is set. After Master Reset this pin provides the SOUT function. (See SOUT and CFG0–4 for
further information.)
25 kX pull-down resistor attached to it.
PC87311A/12 will power-up (see Table 2-1). An internal pull-down resistor of 40 kX is on each pin.
Usea10kXresistor to pull these pins to the required level during reset.
multi-function pin provides an active signal each time the internal address decoder decodes an
address enabled for the PC87311A/12. (See PWDN
CTS
signal is a MODEM status input whose condition the CPU can test by reading bit 4 (CTS) of the
MODEM Status Register (MSR) for the appropriate serial channel. Bit 4 is the complement of the CTS
signal. Bit 0 (DCTS) of the MSR indicates whether the CTS input has changed state since the previous
reading of the MSR. CTS
Note: Whenever the DCTS bit of the MSR is set an interrupt is generated if MODEM Status interrupts are enabled.
all have 24 mA (sink) buffered outputs.
WR
inputs during a DMA transfer. When in PC-AT or Model 30 mode, this signal is enabled by bit D3 of
the Digital Output Register (DOR). When in PS/2Émode, DACK is always enabled, and bit D3 of the
DOR is reserved. DACK
or data set. The DCD
7 (DCD) of the MODEM Status Register (MSR) for the appropriate serial channel. Bit 7 is the
complement of the DCD
changed state since the previous reading of the MSR.
Note: Whenever the DDCD bit of the MSR is set, an interrupt is generated if MODEM Status interrupts are enabled.
data rate (250 or 300 kb/s) has been selected. DENSEL is active high for high density (5.25
when IDENT is high, and active low for high density (3.5
programmable via the Mode command (see Section 4.2.6).
e
step in, inactiveestep out) during a seek operation. During read or writes, DIR will be inactive.
has no effect on the transmitter.
should be held high during PIO accesses.
signal is a MODEM status input whose condition the CPU can test by reading bit
signal. Bit 3 (DDCD) of the MSR indicates whether the DCD input has
for further information.)
drives) when IDENT is low. DENSEL is also
×
drives)
×
7
1.0 Pin Description (Continued)
SymbolPinI/OFunction
DR0,144, 45ODrive Select 0,1. These are the decoded drive select outputs that are controlled by Digital Output
DRATE0,1 52, 51OData Rate 0,1. These outputs reflect the currently selected FDC data rate, (bits 0 and 1 in the
DRQ4ODMA Request. Active high output to signal the DMA controller that a FDC data transfer is needed.
DRV249IDrive2. This input indicates whether a second disk drive has been installed. The state of this pin is
DSKCHG32IDisk Change. The input indicates if the drive door has been opened. The state of this pin is available
DSR1,276, 68IData Set Ready. When low, this indicates that the data set or MODEM is ready to establish a
DTR1,271, 63OData Terminal Ready. When low, this output indicates to the MODEM or data set that the UART is
ERR79IError. This input is set low by the printer when it has detected an error. This pin has nominal 25 kX
HCS058OHard Drive Chip Select 0. This output is active in the AT mode when the hard drive registers from
HCS157OHard Drive Chip Select 1. This output is active in the AT mode when the hard drive registers from
HDSEL34OHead Select. This output determines which side of the FDD is accessed. Active selects side 1,
IDED760I/O IDE Bit 7. This pin provides the data bus bit 7 signal to the IDE hard drive during accesses in the
IDEHI56OIDE High Byte. This output enables the high byte data latch during a read or write to the hard drive if
IDELO55OIDE Low Byte. This output enables the low byte data latch during a read or write to the hard drive .
Register bits D0, D1. The Drive Select outputs are gated with DOR bits 4–7. These are active low
outputs. They are encoded with information to control four FDDs when bit 4 of the Function Enable
Register (FER) is set. (See MTR0,1
Configuration Control Register (CCR) or the Data Rate Select Register (DSR), whichever was written
to last). These pins are totem-pole buffered outputs (6 mA sink, 6 mA source).
When in PC-AT or Model 30 mode, this signal is enabled by bit D3 of the DOR. When in PS/2 mode,
DRQ is always enabled, and bit D3 of the DOR is reserved.
available from Status Register A in PS/2 mode.
from the Digital Input register. This pin can also be configured as the RGATE data separator
diagnostic input via the Mode command (see Section 4.2.6).
communications link. The DSR
reading bit 5 (DSR) of the MODEM Status Register (MSR) for the appropriate channel. Bit 5 is the
complement of the DSR
changed state since the previous reading of the MSR.
Note: Whenever the DDSR bit of the MSR is set, an interrupt is generated if MODEM Status interrupts are enabled.
ready to establish a communications link. The DTR
bit 0 (DTR) of the MODEM Control Register to a high level. A Master Reset operation sets this signal
to its inactive (high) state. In the PC87312, loop mode operation holds this signal to its inactive state.
(See CFG4–0 for further information.) In the PC87311A, loop mode operation holds this signal to its
inactive state if the XTSEL pin is high during reset. If the XTSEL pin is low during reset, the associated
pin state is controlled by the MCR0 bit during loop mode operation. (See XTSEL and CFG0–4 for
further information.)
pull-up resistor attached to it.
1F0–1F7h are selected if the primary address is used or when 170 – 177h are selected if the
secondary address is used. In the XT mode (PC87311A) this output is active if the addresses from
320–324h are selected. This output is inactive if the IDE interface is disabled via the Configuration
Register. (See POE for further information.)
3F6–7 are selected if the primary address is used or when 376 – 377 are selected if the secondary
address is used. In the XT mode (PC87311A) this output is inactive. This output is also inactive if the
IDE interface is disabled via the Configuration Register. (See PDIR for further information.)
inactive selects side 0.
address range 1F0–1F7h, 170 – 177h and 3F6h and 376h. This pin is TRI-STATE during read or write
accesses to 3F7h and 377h.
the hard drive returns IOCS16
Configuration Register.
This output is inactive if the IDE interface is disabled via the Configuration Register. (See BADDR0 for
further information.)
signal. Bit 1 (DDSR) of the MSR indicates whether the DSR input has
and Table 2-4 for more information.)
signal is a MODEM status input whose condition the CPU can test by
signal can be set to an active low by programming
. This output is inactive if the IDE interface is disabled via the
8
1.0 Pin Description (Continued)
SymbolPinI/OFunction
IDENT54IIdentity. During chip reset, the IDENT and MFM pins are sampled to determine the mode of operation
INDEX47IIndex. This input signals the beginning of a FDD track.
INIT80OInitialize. When this signal is low it causes the printer to be initialized. This pin will be in a TRI-STATE
IOCS1659II/O Chip Select 16-Bit. This input will be driven by the peripheral device when it can accommodate a
IRQ3,41, 100OInterrupt 3 and 4. These are active high interrupts associated with the serial ports. IRQ3 presents the
IRQ598OInterrupt 5. Active high output that indicates a parallel port interrupt. When enabled this bit follows the
IRQ697OInterrupt 6. Active high output to signal the completion of the execution phase for certain FDC
IRQ796OInterrupt 7. Active high output that indicates a parallel port interrupt. When enabled this bit follows the
MR2IMaster Reset. Active high input that resets the controller to the idle state, and resets all disk interface
according to the following table:
IDENTMFMMODE
11 or NCPC-AT Mode
10Illegal
01 or NCPS/2 Mode
00Model 30 Mode
AT ModeÐThe DMA enable bit in the DOR is valid. TC is active high. Status Registers A and B are
disabled (TRI-STATE).
Model 30 ModeÐThe DMA enable bit in the DOR is valid. TC is active high. Status Registers A and B
are enabled.
PS/2 ModeÐThe DMA enable bit in the DOR is a don’t care, and the DRQ and IRQ6 signals will always
be enabled. TC is active low. Status Registers A and B are enabled.
After chip reset, the state of IDENT determines the polarity of the DENSEL output.
When IDENT is a logic ‘‘1’’, DENSEL is active high for the 500 kbs/1 Mbs data rates.
When IDENT is a logic ‘‘0’’, DENSEL is active low for the 500 kbs/1 Mbs data rates.
(See Mode command for further explanation of DENSEL.)
condition 10 ns after a zero is loaded into the corresponding Control Register bit. The system should pull
this pin high using a 4.7 kX resistor.
16-bit access.
signal if the serial channel has been designated as COM2 or COM4. IRQ4 presents the signal if the serial
port is designated as COM1 or COM3. The appropriate interrupt goes active whenever it is enabled via
IER, the associated Interrupt Enable bit (Modem Control Register bit 3, MCR3), and any of the following
conditions are active: Receiver Error, Receive Data available, Transmitter Holding Register Empty, or a
Modem Status Flag is set. The interrupt is reset low (inactive) after the appropriate interrupt service
routine is executed, after being disabled via the IER, or after a Master Reset. Either interrupt can be
disabled, putting them into TRI-STATE, by setting the MCR3 bit low.
ACK
signal input. When bit 4 in the parallel port Control Register is set and the parallel port address is
designated as shown in Table 2-5, this interrupt is enabled. When it is not enabled or when operating in
the XT mode this signal is TRI-STATE.
commands. Also used to signal when a data transfer is ready during a Non-DMA operation. When in
PC-AT or Model 30 mode, this signal is enabled by bit D3 of the DOR. When in PS/2 mode, IRQ6 is
always enabled, and bit D3 of the DOR is reserved.
ACK
signal input. When bit 4 in the parallel port Control Register is set and the parallel port address is
designated as shown in Table 2-5, this interrupt is enabled. When it is not enabled this signal is
TRI-STATE.
outputs to their inactive states. The DOR, DSR, CCR, Mode command, Configure command, and Lock
command parameters are cleared to their default values. The Specify command parameters are not
affected. The Configuration Registers are set to their selected default values.
9
1.0 Pin Description (Continued)
SymbolPinI/OFunction
MFM53I/O MFM. During a chip reset when in PS/2 mode (IDENT low), this pin is sampled to select the PS/2 mode
MTR0,146, 43OMotor Select 0,1. These are the motor enable lines for drives 0 and 1, and are controlled by bits
PD0–794– 91, I/O Parallel Port Data. These bidirectional pins transfer data to and from the peripheral data bus and the
89–86
PDIR57IParallel Port Direction. During reset the state of this pin determines the direction of the parallel port
PDWN3IPower Down. This multi-function pin will stop the clocks and/or the external crystal based on the
PE83IPaper End. This input is set high by the printer when it is out of paper. This pin has a nominal 25 kX
POE58IParallel Port Output Enable. This pin is sensed during reset. If it is low, bit 7 of the Power and Test
RD19IRead. Active low input to signal a data read by the microprocessor.
RDATA35IRead Data. This input is the raw serial data read from the floppy disk drive.
RI1,270, 62IRing Indicator. When low this indicates that a telephone ringing signal has been received by the
RTS1,274, 66ORequest to Send. When low, this output indicates to the MODEM or data set that the UART is ready to
SIN1,275, 67ISerial Input. This input receives composite serial data from the communications link (peripheral device,
SLCT82ISelect. This input is set high by the printer when it is selected. This pin has a nominal 25 kX pull-down
SLIN81OSelect Input. When this signal is low it selects the printer. This pin will be in a TRI-STATE condition
(MFM high), or the Model 30 mode (MFM low). An internal pull-up or external pull-down 10 kX resistor
will select between the two PS/2 modes. When the PC-AT mode is desired, (IDENT high), MFM should
be left pulled high internally. MFM reflects the current data encoding format when RESET is inactive.
e
MFM
high, FMelow. Defaults to low after a chip reset. This signal can also be configured as the
PUMP data separator diagnostic output via the Mode command (see Section 4.2.6).
D7–D4 of the Digital Output register. They are active low outputs. They are encoded with information to
control four FDDs when bit 4 of the Function Enable Register (FER) is set. (See DR0,1
for more information.)
parallel port Data Register. These pins have high current drive capability. (See DC Electrical
Characteristics.)
data, if the PTR7
input (scanner) when PDIR
Usea10kXresistor to pull this pin to the required level during reset.
selections made in the Power and Test Register bits 1-2. (See CSOUT for additional information.)
pull-down resistor attached to it.
Register (PTR7) is set high and the parallel port will operate in the Extended Mode. In this mode
software determines the direction of parallel port data via the parallel port Control Register (CTR5). If
this pin is high (PTR7
by the state of PDIR pin at reset. An internal pull-down resistor of 40 kX is on this pin. Use a 10 kX
resistor to pull this pin to the required level during reset.
MODEM. The RI
of the MODEM Status Register (MSR) for the appropriate serial channel. Bit 6 is the complement of the
RI
signal. Bit 2 (TERI) of the MSR indicates whether the RI input has changed from low to high since the
previous reading of the MSR.
Note: Whenever the TERI bit of the MSR is set, an interrupt is generated if MODEM Status interrupts are enabled.
exchange data. The RTS
Control Register to a high level. A Master Reset operation sets this signal to its inactive (high) state. In
the PC87312, loop mode operation holds this signal to its inactive state. (See CFG0–4 for further
information.) In the PC87311A, loop mode operation holds this signal to its inactive state if the XTSEL
pin is high during reset. If the XTSEL pin is low during reset, the associated pin state is controlled by the
MCR1 bit during loop mode operation. (See CFG0–4 for further information.)
MODEM, or data set).
resistor attached to it.
10 ns after a zero is loaded into the corresponding Control Register bit. The system should pull this pin
high using a 4.7 kX resistor.
e
0. The direction will be output (printer) when PDIRe0 and PTR7e0 and it will be
e
1 and PTR7e0. An internal pull-down resistor or 40 kX is on this pin.
e
0) then the Compatible Mode is selected and the data direction is determined
signal is a MODEM status input whose condition the CPU can test by reading bit 6 (RI)
signal can be set to an active low by programming bit 1 (RTS) of the MODEM
and Table 2-4
10
1.0 Pin Description (Continued)
SymbolPinI/OFunction
SOUT1,2 73, 65OSerial Output. This output sends composite serial data to the communications link (peripheral device,
STB95OData Strobe. This output indicates to the printer that valid data is available at the printer port. This pin
STEP40OStep. This output signal issues pulses to the disk drive at a software programmable rate to move the
TC6ITerminal Count. Control signal from the DMA controller to indicate the termination of a DMA transfer.
TRK037ITrack 0. This input indicates to the controller that the head of the selected floppy disk drive is at track
VDDA33Analog Supply. This pin is the 5V supply for the analog data separator.
VDDB,C50, 99Digital Supply. This is the 5V supply voltage for the digital circuitry.
VSSA31Analog Ground. This is the analog ground for the data separator.
VSSB-E42, 9,Digital Ground. This is the ground for the digital circuitry.
90, 61
WR18IWrite. Active low input to signal a write from the microprocessor to the controller.
WDATA39OWrite Data. This output is the write precompensated serial data that is written to the selected floppy
WGATE38OWrite Gate. This output signal enables the write circuitry of the selected disk drive. WGATE has been
WP36IWrite Protect. This input indicates that the disk in the selected drive is write protected.
X1/OSC7ICrystal1/Clock. One side of an external 24 MHz crystal is attached here. If a crystal is not used, a TTL
X28OCrystal2. One side of an external 24 MHz crystal is attached here. This pin is left unconnected if an
XTSEL*63IXT Select. When this pin is high during reset the chip will operate in the XT mode. When this pin is low
*Note: XTSEL is an option for the PC87311A only.
MODEM, or data set). The SOUT signal is set to a marking state (logic 1) after a Master Reset
operation. (See BOUT and CFG0–4 for further information on these pins.)
will be in a TRI-STATE condition 10 ns after a zero is loaded into the corresponding Control Register bit.
The system should pull this pin high using a 4.7 kX resistor.
head during a seek operation.
TC is accepted only when DACK
low in PS/2 mode.
zero.
disk drive. Precompensation is software selectable.
designed to prevent glitches during power up and power down. This prevents writing to the disk when
power is cycled.
or CMOS compatible clock is connected to this pin.
external clock is used.
during reset the chip will operate in the AT mode. An internal pull-down resistor of 40 kX is on this pin.
Usea10kXresistor to pull this pin to the required level during reset.
There are five differences between AT and XT mode. One concerns hard disk operation and the other
four concern UART operation. In AT mode the IDE hard drive chip selects (HCS0
for addresses 1F0–7H and 3F6, 7H; respectively. In XT mode the IDE chip select HCS0
addresses 320–3H and HCS1
bit (see Section 6.5 bit 6), the modem control outputs during loop back mode (see Section 6.8 bit 4), the
Scratch Pad Register (see Section 6.10), and the availability of edge (XT) or level (AT) sensitive UART
interrupts.
is active. TC is active high in PC-AT and Model 30 modes, and active
, HCS1) will be active
responds to
is inactive. The differences in UART operation are: the function of LSR
11
2.0 Configuration Registers
2.1 OVERVIEW
Three registers constitute the Base Configuration Register
set which controls the set-up of the PC87311A/12. In general, these registers control the enabling of each major
function (e.g., FDC, UARTs, parallel port, etc.), the I/O addresses of those functions, and whether those functions
power down via hardware control or not. These three configuration registers are called the Function Enable Register
(FER), the Function Address (FAR) Register and the Power
and Test Register (PTR).
These registers can be accessed via hardware or software.
During reset, the PC87311A/12 loads a set of default values selected by a hardware strapping option into the Configuration Registers. This defines the setting of all Configuration Registers via hardware.
An index and data register pair are used to read and write
these registers. Each Configuration Register is pointed to by
the value loaded into the Index Register. The data to be
written into the Configuration Register is transferred via the
Data register. Reading a Configuration Register is done in a
similar way (i.e., by pointing to it via the Index Register and
then reading its contents via the Data Register).
Accessing the Configuration Registers in this way requires
only two system I/O addresses. Since that I/O space is
shared by other devices the Index and Data Registers could
still be inadvertantly accessed, even though, there are only
two registers in this I/O address space. In order to reduce
the chances of an inadvertant access, a simple procedure
(Section 2.2) has been developed.
2.2 SOFTWARE CONFIGURATION
If the system requires access to the Configuration Registers
after reset, then the following procedure is used to change
data in the registers.
1. Determine the default location of the PC87311A/12 Index Register.
A. Check the two possible default locations (see Table
2-2) by reading them twice. The first byte is the ID byte
(88H). The second byte read is always 00H. Compare
the data read with the ID byte and then 00h. A match
will occur at the correct location. Note that the ID byte
is only issued from the Index Register during the first
read after a reset. Subsequent reads return the value
loaded into the Index Register. Bits 2 – 6 are reserved
and always read 0.
2. Load the Configuration Registers.
A. Disable CPU interrupts.
B. Write the index of the Configuration Register (00h –
02h) to the Index Register one time.
C. Write the correct data for the Configuration Register in
two consecutive write accesses to the Data Register.
D. Enable CPU interrupts.
3. Load the Configuration Registers (read-modify-write).
A. Disable CPU interrupts.
B. Write the index of the Configuration Register (00h –
02h) to the Index Register one time.
C. Read the configuration data in that register via the
Data Register.
D. Modify the configuration data.
E. Write the changed data for the Configuration Register
in two consecutive writes to the Data Register. The
register updates on the second consecutive write.
F. Enable CPU interrupts.
A single read access to the Index and Data Registers can
be done at any time without disabling CPU interrupts. When
the Index Register is read, the last value loaded into the
Index Register will be returned. When the Data Register is
read, the Configuration Register data pointed to by the Index Register will be returned.
TL/F/11362– 38
TL/F/11362– 39
TL/F/11362– 40
FIGURE 2-1. PC87311A/12 Configuration Registers
2.3 HARDWARE CONFIGURATION
During reset, 1 of 32 possible sets of default values are
loaded into the Configuration Registers. A strapping option
on five pins (CFG0–4) selects the set of values that is loaded. This allows for automatic configuration without software
intervention. Table 2-1 shows the 32 possible default configurations. The default configuration can be modified by
software at any time after reset by using the access procedure described in the Software Configuration Section.
12
2.0 Configuration Registers (Continued)
TABLE 2-1. Default Configurations Controlled by Hardware
Configuration Pins (CFGn)
43210
00000FAR
00001FAR
00010FAR
00011FAR
00100FAR
00101FAR
00110FAR
00111FAR
01000FAR
01001FAR
01010FAR
01011FAR
01100FAR
01101FAR
01110FAR
01111FAR
10000FAR
10001FAR
10010FAR
10011FAR
10100FAR
10101FAR
10110FAR
10111FAR
11000FAR
11001FAR
Data
(Hex)
FERe4F, CFFDC, IDE, UART1, UART2,llPORT
PTRe00Power Down Clocks Option
e
10PRI, PRI, COM1, COM2, LPT2
e
11PRI, PRI, COM1, COM2, LPT1
e
11PRI, SEC, COM1, COM2, LPT1
e
39PRI, PRI, COM3, COM4, LPT1
e
24PRI, PRI, COM2, COM3, LPT2
e
38PRI, SEC, COM3, COM4, LPT2
FERe4B, CBFDC, IDE, UART1,llPORT
PTRe00Power Down Clocks Option
e
00PRI, PRI, COM1, LPT2
e
01PRI, PRI, COM1, LPT1
e
01PRI, SEC, COM1, LPT1
e
09PRI, PRI, COM3, LPT1
e
08PRI, PRI, COM3, LPT2
e
08PRI, SEC, COM3, LPT2
FERe0FFDC, UART1, UART2,llPORT
PTRe00Power Clocks Option
e
10PRI, COM1, COM2, LPT2
e
11PRI, COM1, COM2, LPT1
e
39PRI, COM3, COM4, LPT1
e
24PRI, COM2, COM3, LPT2
FERe49, C9FDC, IDE,llPORT
PTRe00Power Down Clocks Option
e
00PRI, PRI, LPT2
e
01PRI, PRI, LPT1
e
01PRI, SEC, LPT1
e
00PRI, SEC, LPT2
FERe07UART1, UART2,llPORT
PTRe00Power Down Clocks Option
e
10COM1, COM2, LPT2
e
11COM1, COM2, LPT1
e
39COM3, COM4, LPT1
e
24COM2, COM3, LPT2
FERe47, C7IDE, UART1, UART2,llPORT
PTRe00Power Down Clocks Option
e
10PRI, COM1, COM2, LPT2
e
11PRI, COM1, COM2, LPT1
Activated Functions
13
2.0 Configuration Registers (Continued)
TABLE 2-1. Default Configurations Controlled by Hardware (Continued)
Configuration Pins (CFGn)
43210
11010FAR
11011FAR
11100FAR
11101FAR
11110FER
11111FER
Data
(Hex)
e
11SEC, COM1, COM2, LPT1
e
39PRI, COM3, COM4, LPT1
e
24PRI, COM2, COM3, LPT2
e
38SEC, COM3, COM4, LPT2
e
08FDC
PTRe00Power Down Clocks Option
FARe10, 80PRI
e
00None
PTRe02, 82Power Down XTAL and Clocks
FARe10NA
Activated Functions
Table 2-1 is organized in the following way. The logic values
of the 5 external Configuration Pins are associated with the
resulting Configuration Register Data and the activated
functions. The activated functions are grouped into 7 categories based on the data in the FER. In some cases the
data in the FER is given as one of two options. This is because the primary or secondary IDE address is chosen via
the FER.
The PTR has one value associated with the active functions
in the FER. This value allows the power down of all clocks
when the PWDN
functions are active after reset, activating the PWDN
also stop the crystal.
Most of the variability available is through the FAR. Addresses controlled by the FAR are coded in the following
way:
PRIis the PRImary floppy or IDE address (i.e., 3F0 –7h
or 1F0 – 7, 3F6, 7h)
SEC is the SECondary IDE address (170 – 7, 376, 7h)
COM1 is the UART address at 3F8 – Fh
COM2 is the UART address at 2F8 – Fh
COM3 is the UART address at 3E8 – Fh
COM4 is the UART address at 2E8 – Fh
LPT1 is the parallel port (
LPT2 is the
The chosen addresses are given under active functions and
are in the same order as the active functions they are associated with. In other words, if the active functions are given
as FDC, IDE, UART1, UART2,
are given as PRI, PRI, COM1, COM2, LPT2; then the functions and the addresses are associated as follows: FDC
PRI, IDEePRI, UART1eCOM1, UART2eCOM2,
PORTeLPT2.
ll
2.4 INDEX AND DATA REGISTERS
One more general aspect of the Configuration Registers is
that the Index and the Data Register pair can be relocated
to any one of two locations. This is controlled through a
hardware strapping option on one pin (BADDR0) and it allows the registers to avoid conflicts with other adapters in
the I/O address space. Table 2-2 shows the address options.
pin goes active. In the last case where no
PORT ) address at 3BC – 3BEh
PORT address at 378 – 37Fh
ll
ll
PORT and the addresses
ll
pin will
TABLE 2-2. Index and Data
Register Optional Locations
BADDR0Index Addr.Data Addr.
0398h399h
126Eh26Fh
2.5 BASE CONFIGURATION REGISTERS
2.5.1 Function Enable Register (FER, Index 0)
This register enables and disables all major chip functions.
Disabled functions have their clocks automatically powered
down, but the data in their registers remains intact. It also
selects whether the FDC and the IDE controller will be located at their primary or secondary address.
Bit 0 When this bit is one the parallel port can be accessed
at the address specified in the FAR.
Bit 1 When this bit is one, UART1 can be accessed at the
address specified in the FAR. When this bit is zero,
access to UART1 is blocked and it will be in power
down mode. The UART1 registers retain all data in
power down mode. Caution: Any UART1 interrupt
that is enabled and active or becomes active after
UART1 is disabled will assert the associated IRQ pin
when UART1 is disabled. If disabling UART1 via software, clear the IRQ Enable bit (MCR3) to zero before
clearing FER 1. This is not an issue after reset because MCR3 will be zero until it is written.
Bit 2 When this bit is one, UART2 can be accessed at the
address specified in the FAR. When this bit is zero,
access to UART2 is blocked and it will be in power
e
14
down mode. The UART2 registers retain all data in
power down mode. Caution: Any UART2 interrupt
that is enabled and active or becomes active after
UART2 is disabled will assert the associated IRQ pin
when UART2 is disabled. If disabling UART2 via software, clear the IRQ Enable bit (MCR3) to zero before
clearing FER2. This is not an issue after reset because MCR3 will be zero until it is written.
2.0 Configuration Registers (Continued)
Bit 3 When this bit is one, the FDC can be accessed at the
address specified in FER[5]. When this bit is zero access to the FDC is blocked and it will be in power
down mode. The FDC registers retain all data in power
down mode.
Bit 4 When this bit is zero the PC87311A/12 can control
two floppy disk drives directly without an external decoder. When this bit is one the two drive select signals
and two motor enable signals from the FDC are encoded so that four floppy disk drives can be controlled
(see Table 2-4). Controlling four FDDs requires an external decoder. The pin states shown in Table 2-4 are
a direct result of the bit patterns shown. All other bit
patterns produce pin states that should not be decoded to enable any drive or motor.
TABLE 2-3. Primary and Secondary Drive Address Selection
BIT 5BIT 7DRIVEATATXT (Note)
ÐÐ ÐPrimarySecondaryÐ
0XFDC3F0– 7hÐÐ
1XFDCÐ370–7hÐ
XXFDCÐÐ3F0– 7h
X0IDE1F0–7, 3F6, 3F7hÐÐ
X1IDEÐ170–7, 376-7hÐ
XXIDEÐÐ320– 3h
Note: PC87311A only
TABLE 2-4. Encoded Drive and Motor Pin Information (FER 4e1)
Digital Output RegDrive Control Pins
76543210MTR1MTR0DR1DR0
XXX1XX00(Note 1)000Activate Drive 0 and Motor 0
XX1XXX01(Note 1)001Activate Drive 1 and Motor 1
X1XXXX10(Note 1)010Activate Drive 2 and Motor 2
1XXXXX11(Note 1)011Activate Drive 3 and Motor 3
XXX0XX00(Note 1)100Activate Drive 0 and Deactivate Motor 0
XX0XXX01(Note 1)101Activate Drive 1 and Deactivate Motor 1
X0XXXX10(Note 1)110Activate Drive 2 and Deactivate Motor 2
0XXXXX11(Note 1)111Activate Drive 3 and Deactivate Motor 3
Note 1: When FER4e1, MTR1 will present a pulse that is the inverted image of the IOW strobe. This inverted pulse will be active whenever an I/O write to
address 3F2h or 372h takes place. This pulse is delayed by 25 ns –80 ns after the leading edge of IOW and its leading edge can be used to clock data into an
external latch (e.g., 74LS175). Address 3F2h will be used if the FDC is located at the primary address (FER5
located at the secondary address (FER5
e
1). See the AC Electrical Characteristics (Section 9.2) for detailed timing.
Bit 5 This bit selects the primary or secondary FDC address
in the PC87312. In the PC87311A, this bit selects the
primary or secondary FDC address when in the AT
mode. In the XT mode it has no significance (see Table 2-3).
Bit 6 When this bit is a one the IDE drive interface can be
accessed at the address specified by FER bit 7. When
it is zero, access to the IDE interface is blocked, the
IDE control signals (i.e., HCS0
, HCS1, IDELO, IDEHI)
are held in the inactive state, and the IDED7 signal will
be in TRI-STATE.
Bit 7 This bit selects the primary or secondary IDE address
in the PC87312. In the PC87311A, this bit selects the
primary or secondary IDE address when in the AT
mode. In the XT mode it has no significance (see Table 2-3).
Decoded Functions
e
0) and address 372h will be used if the FDC is
15
2.0 Configuration Registers (Continued)
e
2.5.2 Function Address Register (FAR, Index
This register selects the ISA I/O address range to which
each peripheral function will respond.
Bits 0,1 These bits select the parallel port address as
shown in Table 2-5:
TABLE 2-5. Parallel Port Addresses
Bit1Bit
Parallel
0
Port
Address
InterruptATInterrupt
00LPT2 (378– 37F)IRQ5 (Note)IRQ7
01LPT1 (3BC– 3BE)IRQ7IRQ7
10LPT3 (278– 27F)IRQ5IRQ7
11ReservedTRI-STATE TRI-STATE
e
(CTR4
Note: The interrupt assigned to this address can be changed to IRQ7 by
setting Bit 3 of the power and test register.
Bits 2–5 These bits determine which ISA I/O address range
is associated with each UART (see Tables 2-6a,
2-6b).
TABLE 2-6a. COM Port Selection for UART1
FARUART1
Bit 3Bit 2COM
001 (3F8-F)
012 (2F8-F)
103 (Table 2 – 7)
114 (Table 2 – 7)
TABLE 2-6b. COM Port Selection for UART2
FARUART2
Bit 5Bit 4COM
00 1
01 2
10 3
11 4
Note: COM3 and COM4 addresses are determined by Bits 6 and 7.
Bits 6,7 These bits select the addresses that will be used
for COM3 and COM4 (see Table 2-7).
TABLE 2-7. Address Selection for COM3 and COM4
Bit 7Bit 6COM3 IRQ4COM4 IRQ3
003E8–Fh2E8–Fh
01338–Fh238–Fh
102E8–Fh2E0–7h
11220–7h228–Fh
2.5.3 Power and Test Register (PTR, Indexe2)
This register determines several power down features: the
power down method used when the power down pin
1)
XT
0) (CTR4e0)
Ý
Ý
(PWDN
) is asserted (crystal and clocks vs clocks only),
whether hardware power down is enabled, and provides a
bit for software power down of all enabled functions. It selects whether IRQ7 or IRQ5 is associated with LPT2. It puts
the enabled UARTs into their test mode. Independent of this
register the floppy disk controller can enter low power mode
via the Mode Command or the Data Rate Select Register.
Bit 0 Setting this bit causes all enabled functions to be
powered down. If the crystal power down option is
selected (see Bit 1) the crystal will also be powered
down. All register data is retained when the crystal or
clocks are stopped.
Bit 1 When the Power Down pin or Bit 0 is asserted this bit
determines whether the enabled functions will have
their internal clocks stopped (Bit 1
nal crystal (Bit 1
e
1) will be stopped. Stopping the
e
0) or the exter-
crystal is the lowest power consumption state of the
part. However, if the crystal is stopped, a finite
amount of time (E8 ms) will be required for crystal
stabilization once the Power Down pin (PWDN
)or
Bit 0 is deasserted. If all internal clocks are stopped,
but the crystal continues to oscillate, no stabilization
period is required after the Power Down pin or Bit 0 is
deasserted.
Bit 2 Setting this bit enables the chip select function of the
PWDN
/CSOUT pin. Resetting this bit enables the
power down function of this pin.
Bit 3 Setting this bit associates the parallel port with IRQ7
when the address for the parallel port is 378 – 37Fh
(LPT2). This bit is a ‘‘don’t care’’ when the parallel
port address is 3BC –3BEh (LPT1) or 278–27Fh
(LPT3).
Bit 4 Setting this bit puts UART1 into a test mode, which
causes its Baudout clock to be present on its SOUT1
pin if the Line Control Register bit 7 is set to 1.
Bit 5 Setting this bit puts UART2 into a test mode, which
causes its Baudout clock to be present on its SOUT2
pin if the Line Control Register bit 7 is set to 1.
Bit 6 Setting this bit to a one prevents all further write ac-
cesses to the Configuration Registers. Once this bit is
set by software it can only be cleared by a hardware
reset. After the initial hardware reset this bit is zero.
Bit 7 This bit determines the operating mode of the parallel
port. If PTR7 is low, then the parallel port is in Compatible Mode. If PTR7 is high, then the parallel port is
in Extended Mode. This bit will be the inverse of the
state of the POE
pin immediately after reset has oc-
curred. PTR7 can be programmed at any time.
2.6 POWER DOWN OPTIONS
There are various methods for entering the power down
mode. All methods result in one of three possible modes.
This section associates the methods of entering the power
down with the resulting mode.
Mode 1: The internal clock stops for a specific function (i.e.,
UART1 and/or UART2 and/or FDC).
This mode is entered by:
A. Clearing the FER bit for the specific function that will be
powered down. See Section 2.5.1 FER bits 1 – 3.
B. Also during reset by setting certain CFG0 – 4 pins. See
Table 2-1.
16
2.0 Configuration Registers (Continued)
C. Or by executing the FDC Mode Command with the PTR
e
bit 1
0. (XTAL/CLK) See Section 4.2.6 LOW PWR.
D. Or by setting Data Rate Select Register bit 6 high in the
FDC with the PTR bit 1
Mode 2: The internal clocks are stopped for all enabled
functions.
Note: Clocks to disabled functions are always inactive.
This mode is entered by:
A. Clearing all FER bits for any enabled function. See Sec-
tion 2.5.1 (FER bits 1 –3).
B. Or by clearing PTR bits 1 (XTAL/CLK) and 2 (CSOUT/
PWDN select) and then asserting the PWDN
See Section 2.5.3 PTR bits 1,2 and Section 1.0 PWDN
pin.
C. Or by clearing PTR bit 1 and then setting PTR bit 0 (Pow-
er Down) high. See Section 2.5.3 (PTR bits 0 and 1).
Mode 3: The external crystal is stopped and internal clocks
are stopped for all enabled functions.
This mode is entered by:
A. Clearing all FER bits that enable the FDC, UART1, and
UART2 functions. See Section 2.5.1 (FER bits 1 – 3).
B. Setting PTR bit 1 (XTAL/CLK), clearing PTR bit 2
(CSOUT/PWDN select), and then asserting the PWDN
signal low. See Section 2.5.3 PTR bits 1,2 and Section
1.0 PWDN
C. Or by setting PTR bit 1 and then setting PTR bit 0 high.
See Section 2.5.3 PTR bits 0 and 1.
D. Or during reset by pulling CFG0 – 4 pins high.
E. Or by executing the FDC Mode Command with the PTR
bit 1
F. Or by setting Data Rate Select Register bit 6 high in the
FDC with the PTR bit 1
2.7 POWER-UP PROCEDURE AND CONSIDERATIONS
2.7.1 Crystal Stabilization
If the crystal is stopped by putting either the FDC or the
UARTs into low power mode, then a finite amount of time
(E8 ms) must be allowed for crystal stabilization during
subsequent power-up. The stabilization period can be
sensed by reading the Main Status Register in the FDC, if
the FDC is being powered up. (The Request for Master bit
will not be set forE8 ms.) If either one of the UARTs are
being powered up, but the FDC is not, then the software
must determine theE8 ms crystal stabilization period. Stabilization of the crystal can also be sensed by putting the
UART into local loopback mode and sending bytes until
they are received correctly.
2.7.2 UART Power-Up
The clock signal to the UARTs is controlled through the
Configuration Registers (FER, PTR). In order to restore the
clock signal to one or both UARTs the following conditions
must exist:
1. The appropriate enable bit (FER1,2) for the UART(s)
must be set
2. and the Power Down bit (PTR0) must not be set
pin.
e
1. See Section 4.2.6 LOW PWR.
e
0. See Section 3.6 bit 6.
e
1. See Section 3.6 bit 6.
signal low.
3. and if the PWDN pin option (PTR2) is used the CSOUT/
PDWN pin must be inactive.
If the crystal has been stopped follow the guidelines in Section 2.7.1 before sending data or signaling that the receiver
channel is ready.
2.7.3 FDC Power-Up
The clock signal to the FDC is controlled through the Configuration Registers, the FDC Mode Command and the Data
Rate Select Register. In order to restore the clock signal to
the FDC the following conditions must exist:
1. The appropriate enable bit (FER3) must be set
2. and the Power Down bit (PTR0) must not be set
3. and if the PWDN pin option (PTR2) is used the CSOUT/
PDWN pin must be inactive.
In addition to these conditions, one of the following must be
done to initiate the recovery from Power Down mode:
1. Read the Main Status Register until the ROM bit (MSR7)
is set
2. or write to the Data Rate Select Register and set the
Software Reset bit (DSR7)
3. or write to the Digital Output Register and set, and then
the clear Reset bit (DOR2)
4. or read the Data Register and the Main Status Register
until the ROM bit is set.
If the crystal has been stopped, read the RQM bit in the
Main Status Register until it is set. The RQM bit does not get
set until the crystal has stabilized.
3.0 FDC Register Description
The floppy disk controller is suitable for all PC-AT, EISA,
PS/2, and general purpose applications. The operational
mode (PC-AT, PS/2, and Model 30) of the FDC is determined by hardware strapping of the IDENT and MFM pins.
DP8473 and N82077 software compatibility is provided. Key
features include the 16-byte FIFO, PS/2 diagnostic register
support, the perpendicular recording mode, CMOS disk interface, and a high performance analog data separator.
The FDC supports the standard PC data rates of 250 kb/s,
300 kb/s and 500 kb/s, and 1 Mb/s in MFM encoded data
mode, but is no longer guaranteed through functional testing to support the older FM encoded data mode. References to the older FM mode remain in this document to
clarify the true functional operation of the device.
The 1 Mb/s data rate is used by new high performance tape
and floppy drives emerging in the PC market today. The new
floppy drives utilize high density media which requires the
FDC supported perpendicular recording mode format. When
used with the 1 Mb/s data rate this new format allows the
use of 4 MB floppy drives which format ED media to 2.88
MB data capacity.
The high performance internal analog data separator needs
no external components. It improves on the window margin
performance standards of the DP8473, and is compatible
with the strict data separator requirements of floppy and
floppy-tape drives.
17
3.0 FDC Register Description (Continued)
FIGURE 3-1. FDC Functional Block Diagram
The FDC contains write precompensation circuitry that will
default to 125 ns for 250, 300, and 500 kb/s (41.67 ns at
1 Mb/s). These values can be overridden in software to
disable write precompensation or to provide levels of precompensation up to 250 ns. The FDC has internal 24 mA
data bus buffers which allow direct connection to the system bus. The internal 40 mA totem-pole disk interface buffers are compatible with both CMOS drive inputs and 150X
resistor terminated disk drive inputs.
The following FDC registers are mapped into the addresses
shown below, with the base address range being provided
by the on-chip address decoder pin. For PC-AT or PS/2
applications, the diskette controller primary address range is
3F0 to 3F7 (hex), and the secondary address range is 370
to 377 (hex). The FDC supports three different register
modes: the PC-AT mode, PS/2 mode (Micro Channel systems), and the Model 30 mode (Model 30). See Section 5.1
for more details on how each register mode is enabled.
When applicable, the register definition for each mode of
operation will be given. If no special notes are made, then
the register is valid for all three register modes.
TL/F/11362– 4
TABLE 3-1. Register Description and Addresses
A2 A1 A0 IDENT R/WRegister
0 0 00R Status Register ASRA
0 0 10R Status Register BSRB
0 1 0XR/W Digital Output RegisterDOR
0 1 1XR/W Tape Drive RegisterTDR
1 0 0XR Main Status RegisterMSR
1 0 0XW Data Rate Select RegisterDSR
1 0 1XR/W Data Register (FIFO)FIFO
1 1 0XX None (Bus TRI-STATE)
1 1 1XR Digital Input RegisterDIR
1 1 1XW Configuration Control Register CCR
Note: SRA and SRB are enabled by IDENTe0 during a chip reset only.
3.1 STATUS REGISTER A (SRA) Read Only
This is a read-only diagnostic register that is part of the
PS/2 floppy controller register set, and is enabled when in
the PS/2 or Model 30 mode. This register monitors the state
of the IRQ6 pin and some of the disk interface signals. The
SRA can be read at any time when in PS/2 mode. In the
PC-AT mode, D7 – D0 are TRI-STATE during a mP read.
18
3.0 FDC Register Description (Continued)
3.1.1 SRAÐPS/2 Mode
D7D6D5D4D3D2D1 D0
DESCIRQ6
RESET
COND
D7Interrupt Pending: This active high bit reflects the
D62nd Drive Installed
D5Step: Active high status of the STEP disk interface
D4Track 0
D3Head Select: Active high status of the HDSEL disk
D2Index
D1Write Protect
D0Direction: Active high status of the DIR disk inter-
3.1.2 SRAÐ Model 30 Mode
DESCIRQ6
RESET
COND
D7Interrupt Pending: This active high bit reflects that
D6DMA Request: Active high status of the DRQ signal.
D5Step: Active high status of the latched STEP disk
D4Track 0: Active high status of TRK0 disk interface
D3Head Select
D2Index: Active high status of the INDEX disk inter-
D1Write Protect: Active high status of the WP disk
D0Direction
DRV2
PEND
0N/A0N/A0N/A N/A 0
STEP TRK0 HDSEL INDX WP DIR
state of the IRQ6 pin.
: Active low status of the
DRV2 disk interface input, indicating if a second
drive has been installed.
output.
: Active low status of the TRK0 disk inter-
face input.
interface output.
: Active low status of the INDEX disk interface
input.
: Active low status of the WP disk in-
terface input.
face output.
D7D6D5D4D3D2D1 D0
DRQ STEP TRK0 HDSEL
PEND
000N/A1N/A N/A 1
INDX WP DIR
state of the IRQ6 pin.
interface output. This bit is latched with the STEP
output going active, and is cleared with a read from
the DIR, or with a hardware or software reset.
input.
: Active low status of the HDSEL disk
interface output.
face input.
interface input.
: Active low status of the DIR disk inter-
face output.
3.2 STATUS REGISTER B (SRB) Read Only
This is a read-only diagnostic register that is part of the
PS/2 floppy controller register set, and is enabled when in
the PS/2 or Model 30 mode. The SRB can be read at any
time when in PS/2 mode. In the PC-AT mode, D7–D0 are
TRI-STATE during a mP read.
3.2.1 SRBÐPS/2 Mode
D7 D6 D5D4D3D2D1D0
DESC11 DR0 WDATA RDATA WGATE MTR1 MTR0
RESET
N/A N/A 000000
COND
D7Reserved: Always 1.
D6Reserved: Always 1.
D5Drive Select 0: Reflects the status of the Drive Se-
lect 0 bit in the DOR (address 2, bit 0). This bit is
cleared after a hardware reset, not a software reset.
D4Write Data: Every inactive edge transition of the
WDATA disk interface output causes this bit to
change states.
D3Read Data: Every inactive edge transition of the
RDATA disk interface output causes this bit to
change states.
D2Write Gate: Active high status of the WGATE disk
interface output.
D1Motor Enable 1: Active high status of the MTR1
disk interface output. Low after a hardware reset,
unaffected by a software reset.
D0Motor Enable 0: Active high status of the MTR0
disk interface output. Low after a hardware reset,
unaffected by a software reset.
3.2.2 SRBÐModel 30 Mode
D7D6 D5D4D3D2D1 D0
DESC DRV2 DR1 DR0 WDATA RDATA WGATE DR3 DR2
RESET
N/A1100011
COND
D72nd Drive Installed: Active low status of the
DRV2 disk interface input.
D6Drive Select 1
: Active low status of the DR1 disk
interface output.
D5Drive Select 0
: Active low status of the DR0 disk
interface output.
D4Write Data: Active high status of latched WDATA
signal. This bit is latched by the inactive going edge
of WDATA and is cleared by a read from the DIR.
This bit is not gated by WGATE.
19
3.0 FDC Register Description (Continued)
D3Read Data: Active high status of latched RDATA
signal. This bit is latched by the inactive going edge
of RDATA and is cleared by a read from the DIR.
D2Write Gate: Active high status of latched WGATE
signal. This bit is latched by the active going edge of
WGATE and is cleared by a read from the DIR.
D1Drive Select 3
interface output. (Note 1)
D0Drive Select 2
interface output. (Note 1)
3.3 DIGITAL OUTPUT REGISTER (DOR) Read/Write
The DOR controls the drive select and motor enable disk
interface outputs, enables the DMA logic, and contains a
software reset bit. The content of the DOR is set to 00 (hex)
after a hardware reset, and is unaffected by a software reset. (Note 2)
DOR
D7D6D5D4D3D2D1D0
DESC MTR3 MTR2 MTR1 MTR0 DMAEN RESET
RESET
0000 0 0 0 0
COND
D7Motor Enable 3: This bit controls the MTR3 disk
interface output.A1inthis bit causes the MTR3 pin
to go active. (Note 1)
D6Motor Enable 2: Same function as D7 except for
MTR2. (Note 1)
D5Motor Enable 1: Same function as D7 except for
MTR1.
D4Motor Enable 0: Same function as D7 except for
MTR0.
D3DMA Enable: This bit has two modes of operation.
PC-AT mode or Model 30 mode: Writinga1tothis
bit will enable the DRQ, DACK
Writinga0tothis bit will disable the DACK
pins and TRI-STATE the DRQ and the IRQ6 pins.
This bit is a 0 after a reset when in these modes.
PS/2 mode: This bit is reserved, and the DRQ,
DACK
, TC, and IRQ6 pins will always be enabled.
During a reset, the DRQ, DACK
will remain enabled, and D3 will be a 0.
D2Reset Controller: Writinga0tothis bit resets the
controller. It will remain in the reset condition until a
1 is written to this bit. A software reset does not
affect the DSR, CCR, and other bits of the DOR. A
software reset will affect the Configure and Mode
command bits (see Section 4.0 Command Set Description). The minimum time that this bit must be
low is 100 ns. Thus, toggling the Reset Controller bit
during consecutive writes to the DOR is an acceptable method of issuing a software reset.
D1,D0 Drive Select: These two bits are binary encoded for
the four drive selects DR0–DR3, so that only one
drive select output is active at a time. (Note 1)
: Active low status of the DR3 disk
: Active low status of the DR2 disk
DRIVE DRIVE
SEL 1 SEL 0
, TC, and IRQ6 pins.
and TC
, TC, and IRQ6 lines
It is common programming practice to enable both the motor enable and drive select outputs for a particular drive.
Table 3-2 below shows the DOR values to enable each of
the four drives.
TABLE 3-2. Drive Enable Values
DriveDOR Value
01C (hex)
12D
24E
38F
3.4 TAPE DRIVE REGISTER (TDR) Read/Write
This register is used to assign a particular drive number with
the tape drive support mode of the data separator. All other
logical drives are assigned floppy drive support with the
data separator. Any future reference to the assigned tape
drive will invoke tape drive support. The TDR is unaffected
by a software reset.
TDR
D7D6D5D4D3D2D1D0
DESC
RESET
COND
XXXXXX
N/A N/A N/A N/A N/A N/A00
TAPE TAPE
SEL 1 SEL 0
D7–D2 Reserved: These bits are ignored when written to
and are TRI-STATE when read.
D1,D0 Tape Select 1,0: These two bits assign a logical
drive number to be a tape drive. Drive 0 is not available as a tape drive, and is reserved as the floppy
disk boot drive. See Table 3-3 for the tape drive
assignment values.
TABLE 3-3. Tape Drive Assignment Values
TAPESEL1TAPESEL0
Drive
Selected
00None
011
102
113
3.5 MAIN STATUS REGISTER (MSR) Read Only
The read-only Main Status Register indicates the current
status of the disk controller. The Main Status Register is
always available to be read. One of its functions is to control
the flow of data to and from the Data Register (FIFO). The
Main Status Register indicates when the disk controller is
ready to send or receive data through the Data Register. It
should be read before each byte is transferred to or from
the Data Register except during a DMA transfer. No delay is
required when reading this register after a data transfer.
Note 1: The MTR3, MTR2, DRV3, DRV2 pins are only available in 4-drive mode (FER4e1) and require external logic.
Note 2: The DOR can be written to at any time, but only one drive select output in conjunction with its corresponding motor is active at a time.
20
3.0 FDC Register Description (Continued)
After a hardware or software reset, or recovery from a power down state, the Main Status Register is immediately available to be read by the mP. It will contain a value of 00 hex
until the oscillator circuit has stabilized, and the internal registers have been initialized. When the FDC is ready to receive a new command, it will report an 80 hex to the mP.
The system software can poll the MSR until it is ready. The
worst case time allowed for the MSR to report an 80 hex
value (RQM set) is 2.5 ms after reset or power up.
MSR
D7D6 D5D4D3D2D1D0
DESC RQM DIO NON CMD DRV3 DRV2 DRV1 DRV0
RESET
0000 0000
COND
D7Request for Master: Indicates that the controller is
ready to send or receive data from the mP through
the FIFO. This bit is cleared immediately after a byte
transfer and will become set again as soon as the
disk controller is ready for the next byte. During a
Non-DMA Execution phase, the RQM indicates the
status of the interrupt pin.
D6Data I/O (Direction): Indicates whether the con-
troller is expecting a byte to be written to (0) or read
from (1) the Data Register.
D5Non-DMA Execution: Indicates that the controller
is in the Execution Phase of a byte transfer operation in the Non-DMA mode. Used for multiple byte
transfers by the mP in the Execution Phase through
interrupts or software polling.
D4Command in Progress: This bit is set after the first
byte of the Command Phase is written. This bit is
cleared after the last byte of the Result Phase is
read. If there is no Result Phase in a command, the
bit is cleared after the last byte of the Command
Phase is written.
D3Drive 3 Busy: Set after the last byte of the Com-
mand Phase of a Seek or Recalibrate command is
issued for drive 3. Cleared after reading the first
byte in the Result Phase of the Sense Interrupt
Command for this drive.
D2Drive 2 Busy: Same as above for drive 2.
D1Drive 1 Busy: Same as above for drive 1.
D0Drive 0 Busy: Same as above for drive 0.
3.6 DATA RATE SELECT REGISTER (DSR) Write Only
This write-only register is used to program the data rate,
amount of write precompensation, power down mode, and
software reset. The data rate is programmed via the CCR,
not the DSR, for PC-AT and PS/2 Model 30 and MicroChannel applications. Other applications can set the data rate in
the DSR. The data rate of the floppy controller is determined by the most recent write to either the DSR or CCR.
DMA PROG BUSY BUSY BUSY BUSY
The DSR is unaffected by a software reset. A hardware reset will set the DSR to 02 (hex), which corresponds to the
default precompensation setting and 250 kb/s.
DSR
D7D6 D5 D4D3D2D1D0
DESC S/W LOW0PRE- PRE- PRE-
RESET POWERCOMP2 COMP1 COMP0
RESET
0000001 0
COND
DRATE1 DRATE0
D7Software Reset: This bit has the same function as
the DOR RESET (D2) except that this software reset is self-clearing.
D6Low Power: A 1 to this bit will put the controller into
the Manual Low Power mode. The oscillator and
data separator circuits will be turned off. Manual
Low Power can also be accessed via the Mode
command. The chip will come out of low power after
a software reset, or access to the Data Register or
Main Status Register.
D5Undefined. Should be set to 0.
D4–D2 Precompensation Select: These three bits select
the amount of write precompensation the floppy
controller will use on the WDATA disk interface output. Table 3-4 shows the amount of precompensation used for each bit pattern. In most cases, the
default values (Table 3-5) can be used; however,
alternate values can be chosen for specific types of
drives and media. Track 0 is the default starting
track number for precompensation. The starting
track number can be changed in the Configure command.
D1,D0 Data Rate Select 1,0: These bits determine the
data rate for the floppy controller. See Table 3-6 for
the corresponding data rate for each value of D1,
D0. The data rate select bits are unaffected by a
software reset, and are set to 250 kb/s after a hardware reset.
Note: FM mode is not guaranteed through functional testing.
3.7 DATA REGISTER (FIFO) Read/Write
The FIFO (read/write) is used to transfer all commands,
data, and status between the mP and the FDC. During the
Command Phase, the mP writes the command bytes into the
FIFO after polling the RQM and DIO bits in the MSR. During
the Result Phase, the mP reads the result bytes from the
FIFO after polling the RQM and DIO bits in the MSR.
The enabling of the FIFO and setting of the FIFO threshold
is done via the Configure command. If the FIFO is enabled,
only the Execution Phase byte transfers use the 16 byte
FIFO. The FIFO is always disabled during the Command
and Result Phases of a controller operation. If the FIFO is
enabled, it will not be disabled after a software reset if the
LOCK bit is set in the Lock Command. After a hardware
reset, the FIFO is disabled to maintain compatibility with
PC-AT systems.
The 16-byte FIFO can be used for DMA, Interrupt, or software polling type transfers during the execution of a read,
write, format, or scan command. In addition, the FIFO can
be put into a Burst or Non-Burst mode with the Mode command. In the Burst mode, DRQ or IRQ6 remains active until
all of the bytes have been transferred to or from the FIFO. In
the Non-Burst mode, DRQ or IRQ6 is deasserted for 350 ns
to allow higher priority transfer requests to be serviced. The
Mode command can also disable the FIFO for either reads
or writes separately. The FIFO allows the system a larger
latency without causing a disk overrun/underrun error. Typical uses of the FIFO would be at the 1 Mb/s data rate, or
with multi-tasking operating systems. The default state of
the FIFO is disabled, with a threshold of zero. The default
state is entered after a hardware reset.
Data Register (FIFO)
D7D6D5D4D3D2D1D0
Byte Mode
DRP
]
b
(16ct
ICP
)
DESCData[7:0
RESET
COND
During the Execution Phase of a command involving data
transfer to/from the FIFO, the system must respond to a
data transfer service request based on the following formula:
Maximum Allowable Data Transfer Service Time
(THRESH
a
1)c8ct
This formula is good for all data rates with the FIFO enabled
or disabled. THRESH is a four bit value programmed in the
Configure command, which sets the FIFO threshold. If the
FIFO is disabled, THRESH is zero in the above formula. The
last term of the formula, (16
to the microcode overhead required by the FDC. This delay
is also data rate dependent. See Table 9-1 for the t
t
times.
ICP
c
t
) is an inherent delay due
ICP
DRP
and
The programmable FIFO threshold (THRESH) is useful in
adjusting the floppy controller to the speed of the system. In
other words, a slow system with a sluggish DMA transfer
capability would use a high value of THRESH, giving the
system more time to respond to a data transfer service request (DRQ for DMA mode or IRQ6 for Interrupt mode).
Conversely, a fast system with quick response to a data
transfer service request would use a low value of THRESH.
3.8 DIGITAL INPUT REGISTER (DIR) Read Only
This diagnostic register is used to detect the state of the
DSKCHG disk interface input and some diagnostic signals.
The function of this register depends on the register mode
of operation. When in the PC-AT mode, the D6 – D0 are
TRI-STATE to avoid conflict with the fixed disk status register at the same address. The DIR is unaffected by a software reset.
3.8.1 DIRÐPC-AT Mode
D7D6D5D4D3D2D1D0
DESCDSKCHGXXXXXXX
RESET
COND
N/AN/A N/A N/A N/A N/A N/A N/A
D7Disk Changed: Active high status of DSKCHG disk
interface input. During power down this bit will be
invalid, if it is read by the software.
D6–D0 Undefined: TRI-STATE. Used by Hard Disk Con-
troller Status Register.
3.8.2 DIRÐPS/2 Mode
D7D6 D5 D4 D3D2D1D0
DESC
DSKCHG 1111 DRATE1 DRATE0
RESET
N/AN/A N/A N/A N/AN/AN/A1
COND
1
HIGH
DEN
D7Disk Changed: Active high status of DSKCHG disk
interface input. During power down this bit will be
invalid, if it is read by the software.
D6–D3 Reserved: Always 1.
D2,D1 Data Rate Select 1,0: These bits indicate the
status of the DRATE1,0 bits programmed through
the DSR CCR.
D0High Density
: This bit is low when the 1 Mb/s or
500 kb/s data rate is chosen, and high when the
300 kb/s or 250 kb/s data rate is chosen. This bit is
independent of the IDENT value.
3.8.3 DIRÐModel 30 Mode
D7D6 D5 D4D3D2D1D0
DESC DSKCHG 0 0 0 DMAEN NOPRE DRATE1 DRATE0
RESET
N/A0 0 00010
COND
22
3.0 FDC Register Description (Continued)
D7Disk Changed
interface input. During power down this bit will be
invalid, if it is read by the software.
D6–D4 Reserved: Always 0.
D3DMA Enable: Active high status of the DMAEN bit
in the DOR.
D2No Precompensation: Active high status of the
NOPRE bit in the CCR.
D1,D0 Data Rate Select 1,0: These bits indicate the
status of the DRATE 1,0 bits programmed through
the DSR/CCR.
3.9 CONFIGURATION CONTROL REGISTER (CCR)
Write Only
This is the write-only data rate register commonly used in
PC-AT applications. This register is not affected by a software reset, and is set to 250 kb/s after a hardware reset.
The data rate of the floppy controller is determined by the
last write to either the CCR or DSR.
3.9.1 CCRÐPC-AT and PS/2 Modes
D7 D6D5 D4D3 D2D1D0
DESC000000DRATE1 DRATE0
RESET
N/A N/A N/A N/A N/A N/A10
COND
D7–D2 Reserved: Should be set to 0.
D1,D0 Data Rate Select 1,0: These bits determine the
data rate of the floppy controller. See Table 3-6 for
the appropriate values.
3.9.2 CCRÐModel 30 Mode
D7 D6 D5 D4 D3D2D1D0
DESC00000 NOPRE DRATE1 DRATE0
RESET
N/A N/A N/A N/A N/AN/A10
COND
D7–D3 Reserved: Should be set to 0.
D2No Precompensation: This bit can be set by soft-
ware, but it has no functionality. It can be read by bit
D2 of the DIR when in the Model 30 register mode.
Unaffected by a software reset.
D1,D0 Data Rate Select 1,0: These bits determine the
data rate of the floppy controller. See Table 3-6 for
the appropriate values.
3.10 RESULT PHASE STATUS REGISTERS
The Result Phase of a command contains bytes that hold
status information. The format of these bytes is described
below. Do not confuse these status bytes with the Main
Status Register, which is a read only register that is always
valid. The Result Phase status registers are read from the
Data Register (FIFO) only during the Result Phase of certain
commands (see Section 4.1 Command Set Summary). The
status of each register bit is indicated when the bit is a 1.
3.10.1 Status Register 0 (ST0)
D7D6D5D4D3D2D1D0
DESCICICSEEC0HDSDS1DS0
RESET
COND
00000 0 0 0
: Active low status of DSKCHG disk
D7–D6 Interrupt Code:
00eNormal Termination of Command.
01eAbnormal Termination of Command. Execu-
tion of command was started, but was not
successfully completed.
e
10
Invalid Command Issued. Command issued
was not recognized as a valid command.
e
11
Internal drive ready status changed state during the drive polling mode. Only occurs after a
hardware or software reset.
D5Seek End: Seek, Relative Seek, or Recalibrate
command completed by the controller. (Used during
a Sense Interrupt command.)
D4Equipment Check: After a Recalibrate command,
Track 0 signal failed to occur. (Used during Sense
Interrupt command.)
D3Not Used. Always 0.
D2Head Select: Indicates the active high status of the
HDSEL pin at the end of the Execution Phase.
D1,D0 Drive Select 1,0: These two binary encoded bits
indicate the logical drive selected at the end of the
Execution Phase.
e
00
Drive 0 selected.
01eDrive 1 selected.
10eDrive 2 selected.
e
Drive 3 selected.
11
3.10.2 Status Register 1 (ST1)
D7D6D5D4D3D2D1D0
DESCET0CEOR0NDNWMA
RESET
COND
000 00 0 0 0
D7End of Track: Controller transferred the last byte of
the last sector without the TC pin becoming active.
The last sector is the End of Track sector number
programmed in the Command Phase.
D6Not Used. Always 0.
D5CRC Error: If this bit is set and bit 5 of ST2 is clear,
then there was a CRC error in the Address Field of
the correct sector. If bit 5 of ST2 is also set, then
there was a CRC error in the Data Field.
D4Overrun: Controller was not serviced by the mP
soon enough during a data transfer in the Execution
Phase. For read operations, indicates a data overrun. For write operations, indicates a data underrun.
D3Not Used. Always 0.
D2No Data: Three possible problems:
1. Controller cannot find the sector specified in the
Command Phase during the execution of a Read,
Write, Scan, or Verify command. An address
mark was found however, so it is not a blank disk.
2. Controller cannot read any Address Fields without a CRC error during a Read ID command.
3. Controller cannot find starting sector during execution of Read A Track command.
D1Not Writable: Write Protect pin is active when a
Write or Format command is issued.
23
3.0 FDC Register Description
(Continued)
D0Missing Address Mark: If bit 0 of ST2 is clear then
the controller cannot detect any Address Field Address Mark after two disk revolutions. If bit 0 of ST2
is set then the controller cannot detect the Data
Field Address Mark after finding the correct Address Field.
3.10.3 Status Register 2 (ST2)
D7D6D5D4D3D2D1D0
DESC0CMCDWTSEHSNSBTMD
RESET
COND
D7Not Used. Always 0.
D6Control Mark: Controller tried to read a sector
D5CRC Error in Data Field: Controller detected a
D4Wrong Track: Only set if desired sector is not
D3Scan Equal Hit: ‘‘Equal’’ condition satisfied during
D2Scan Not Satisfied: Controller cannot find a sector
D1Bad Track: Only set if the desired sector is not
D0Missing Address Mark in Data Field: Controller
3.10.4 Status Register 3 (ST3)
DESC0WP1TK01HDSDS1DS0
RESET
COND
D7Not Used. Always 0.
D6Write Protect: Indicates active high status of the
D5Not Used. Always 1.
D4Track 0: Indicates active high status of the TRK0
D3Not Used. Always 1.
D2Head Select: Indicates the active high status of the
D1,D0 Drive Select 1,0: These two binary encoded bits
0000 0 0 00
which contained a deleted data address mark during execution of Read Data or Scan commands. Or,
if a Read Deleted Data command was executed, a
regular address mark was detected.
CRC error in the Data Field. Bit 5 of ST1 is also set.
found, and the track number recorded on any sector
of the current track is different from the track address specified in the Command Phase.
any Scan command.
on the track which meets the desired condition during any Scan command.
found, the track number recorded on any sector on
the track is FF (hex) indicating a hard error in IBM
format, and is different from the track address specified in the Command Phase.
cannot find the Data Field AM during a Read, Scan,
or Verify command. Bit 0 of ST1 is also set.
D7D6D5D4D3D2D1D0
001010 0 0
WP pin.
pin.
HD bit in the Command Phase.
indicate the DS1,DS0 bits in the Command Phase.
4.0 FDC Command Set Description
The following is a table of the FDC command set. Each
command contains a unique first command byte called the
opcode byte which will identify to the controller how many
command bytes to expect. If an invalid command byte is
issued to the controller, it will immediately go into the Result
Phase and the status will be 80 (hex), which signifies Invalid
Command.
4.1 COMMAND SET SUMMARY
CONFIGURE
Command Phase
0 0 0 1 0011
0 0 0 0 0000
0EISFIFOPOLLTHRESH
PRETRK
Execution Phase: Internal registers written.
No Result Phase
DUMPREG
Command Phase
00001110
Execution Phase: Internal registers read.
Result Phase
PTR Drive 0
PTR Drive 1
PTR Drive 2
PTR Drive 3
Step Rate TimeMotor Off Time
Motor On TimeDMA
Sector per Track/End of Track
LOCK0DC3DC2DC1DC0 GAPWG
0EISFIFO POLLTHRESH
PRETRK
Note: Sectors per Track parameter returned if last command issued was
Format. End of Track parameter returned if last command issued was Read
or Write.
FORMAT TRACK
Command Phase
0MFM001101
X X XXXHDDR1DR0
Bytes per Sector
Sectors per Track
Format Gap
Data Pattern
Execution Phase: System transfers four ID bytes (track,
head, sector, bytes/sector) per sector to the floppy controller via DMA or Non-DMA modes. The entire track is formatted. The data block in the Data Field of each sector is filled
with the data pattern byte.
24
Loading...
+ 54 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.