NEe NEe Microcomputers, Inc. fLPD765 SINGLE/DOUBLE DENSITY FLOPPY DISK CONTROLLER' OESCRI PTION The J.1PD765 is an LSI Floppy Disk Controller (FDC) Chip, which contains the circuitry and control functions for interfacing a processor to 4 Floppy Disk Drives, It is capable of supporting either IBM 3740 single density format (FM), or IBM System 34 Double Density format (MFM) including double sided recording. The J.1PD765 provides control signals which simplify the design of an external phase locked loop, and write precompensation circuitry. The FDC simplifies and handles most of the burdens associated with implementing a Floppy Disk Interface. Hand-shaking signals are provided in the J.1PD765 which make DMA operation easy to incorporate with the aid of an external DMA Controller chip, such as the J.1PD8257. The FDC will operate in either DMA or Non-DMA mode. In the Non-DMA mode, the FDC generates interrupts to the processor every time a data byte is available. In the DMA mode, the processor need only load the command into the FDC and all data transfers occur under control of the J.1PD765 and DMA controller. There are 15 separate commands which the J.1PD765 will execute. Each of these commands requ ire multiple 8-bit bytes to fully specify the operation which the processor wishes the F DC to perform. The following commands are available: Read Data Scan High or Equal Write Deleted Data Read ID Scan Low or Equal Seek Read Deleted Data Specify Recalibrate (Restore to Track 0) Read a Track Write Data Sense I nterrupt Status Scan Equal Format a Track Sense Drive Status FEATURES Address mark detection circuitry is internal to the FDC which simplifies the phase locked loop and read electronics. The track stepping rate, head load time, and head unload time may be programmed by the user. The J.1PD765 offers many additional features such as multiple sector transfers in both read and write with a single command, and full IBM compatibil ity in both single and double density modes. • IBM Compatible in Both Single and Double Density Recording Formats • Programmable Data Record Lengths: 128,256,512, or 1024 Bytes/Sector • Multi-Sector and Multi·Track Transfer Capability • Drive Up to 4 Floppy Disks • Data Scan Capability - Will Scan a Single Sector or an Entire Cylinder's Worth of Data Fields, Comparing on a Byte by Byte Basis, Data in the Processor's Memory with Data Read from the Diskette • Data Transfers in DMA or Non-DMA Mode • Parallel Seek Operations on Up to Four Drives • Compatible with Most Microprocessors Including 8080A, 8085A, J.1PD780 (Z80™) • Single Phase 8 MHz Clock • Single +5 Volt Power Supply • Available in 40 Pin Plastic Dual-in-Line Package PIN CONFIGURATION RESET 1 40 VCC RD 2 39 RW/SEEK WR 3 lCTlDlR CS 4 FR,STP Aa 5 HDl DBa 6 RDY DB1 7 WP/TS DB2 8 FlT/TRa DB3 9 MPD PSa DB4 10 765 31 PS1 DB5 DB6 11 12 30rOA 29 USa DB7 13 28 US1 DRO 14 27 HD DACK 15 26 MFM Ter IDX INT 17 18 25 WE VCO RD ClK 19 RDW GND 20 21 WCK TM :Z80 is a registered trademark of Zilog, Inc. 173 Worcester Street/Wellesley, Massachusetts 02181 Telephone 617/237-1910 TWX 710-383"1745 P. PD765 BLOCK DIAGRAM DATA BUS DBO·7 REGISTERS BUFFER WR CLOCK WR DATA WR ENABLE TERMINAL PRE·SHIFTO SERIAL COUNT PRE·SHIFT 1 INTERFACE CONTROLLER DRQ RD DATA DACK READ DATA WINDOW INT VCO SYNC AD WR READY AO WRITE PROTECT/TWO SIDE INDEX FAULT/TRACK 0 RESET DRIVE CS INTERFACE UNIT SELECT 0 CONTROLLER ---- UNIT SELECT 1 MFM MODE ----- CLK RWISEEK VCC HEAD LOAD HEAD SELECT GND LOW CURRENT/DIRECTION FAULT RESET/STEP Operating Temperature. DOe to +70o e ABSOLUTE MAXIMUM o Storage Temperature -40 e to +125°C RATINGS* All Output Voltages. -0.5 to +7 Volts All Input Voltages .. -0.5 to +7 Volts Supply Voltage Vee -0.5 to +7 Volts Power Dissipation .. 1 Watt COMMENT: Stress above those listed under "Absolute Maximum Ratings" may cause permanent damage to the device. This is a stress rating only and functional operation of the device at these or any other conditions above those indicated in the operational sections of this specification is not implied. Exposure to absolute maximum rating conditions for extended periods may affect device reliability. o Ta = o°c to +70 C; VCC = +5V ± 5% unless otherwise specified. DC CHARACTERISTICS I LIMITS TEST PARAMETER SYMBOL UNIT MIN Typ-0] MAX CONDITIONS Input Low Voltage VIL -0.5 0.8 V Input High Voltage VIH 2.5 VCC + 0.5 V Output Low Voltage VOL 0.45 V IOL = 1.6 mA Output High VOH 2.4 VCC V IOH = -150pA Voltage for Data Bus IOH = -80J.1A for other outputs Input Low Voltage VIL(CY 1.0 8.0 9.0 MHz Clock Active (High) <1>0 35 ns Clock Rise Time r 20 ns Clock Fall Time f 20 ns AO, CS, DACK Set Up Time to R D .j, TAR 30 ns AO, CS, DACK Hold Time from RD t TRA 5.0 ns FmWidth TRR 300 ns Data Access Time from R D .j, TRD 200 ns DB to Float Delay Time from RD t TDF 20 100 ns AO, CS, DACK Set Up Time to WR .j, TAW 50 ns Ao. CS, DACK Hold Time to WFf t TWA 30 ns WR"Width TWW 300 ns Data Set Up Time to WR t TDW 250 ns Data Hold Time from WR t TWD 30 ns I NT Delay Time from R D t TRI 500 nt INT Delay Time from WR t TWI 500 ns DRO Cycle Time TMCY 13 j.ls DRO Delay Time from DACR t TArv1 1.0 1'- WR or R D Response Time from DR a t TRWM 1.0 j.lS TC Width TTC 300 ns Rest Width TRST 3.0 j.lS 2or4@ MFM = 0 WCK Cycle Time TCY j.ls 1 or 2 MFM= 1 WCK Active Time (High) TO 150 250 350 ns WCK Rise Time Tr 30 ns WCK Fall Time Tf 30 ns Pre-Shift Delay Time from WCK t TCp 20 150 ns WDA Delay Time from WCK t TCD 20 150 ns RDD Active Time (High) TRDD 100 ns 2.0 MFM = 0 Window Cycle Time TWCY j.ls 1.0 MFM= 1 TRDW Window Hold Time to/from RDD 100 ns TWRD USO, 1 Hold Time to RW/SEEK t TUS 12 j.lS SEEK/RW Hold Time to LOW CURRENT/ TSD 7 j.ls DIRECTION t LOW CURRENT/DIRECTION Hold Time to 8 MHz Clock TDST 1.0 j.ls FAUL T RESET/STEP t Period USO, 1 Hold Time from FAULT TSTU 1.0 j.ls RESET/STEP t STEP Active Time (High) TSTP 5.0 j.ls LOW CURRENT/DIR ECTION Hold Time from TSTD 5.0 j.ls FAULT RESET/STEP.J. STEP Cycle Time TSC @ @ ms 8 MHz Clock FAULT RESET Active Time (High) TFR 8.0 10 j.lS Period Notes: Suggested values of GPL in format command. 14 fLPD765 FUNCTIONAL SCAN COMMANDS DESCRIPTION OF The SCAN Commands allow data which is being read from the diskette to be compared against data which is being supplied from the main system (Processor in NON-DMA mode, and DMA Controller in DMA mode). COMMANDS (CONT.) The FDC compares the data on a byte-by-byte basis, and looks for a sector of data which meets the condi- tions of DFDD = DProcessor, DFDD ~ DProcessor, or DFDD ;;;. DProcessor. Ones complement arith- metic is used for comparison (FF = largest number, 00 = smallest number). After a whole sector of data is compared, if the conditions are not met, the sector number is incremented (R + STP -')- R), and the scan operation is continued. The scan operation continues until one of the following conditions occur; the con- ditions for scan are met (equal, low, or high), the last sector on the track is reached (EOT), or the terminal count signal is received. If the conditions for scan are met then the FDC sets the SH (Scan Hit) flag of Status Register 2 to a 1 (high), and terminates the Scan Command. If the conditions for scan are not met between the starting sector (as specified by R) and the last sector on the cylinder (EOT), then the FDC sets the SN (Scan Not Satisfied) flag of Status Register 2 to a 1 (high), and terminates the Scan Command. The receipt of a TERMINAL COUNl signal from the Processor or DMA Controller during the scan operation will cause the FDC to complete the comparison of the particular byte which is in process, and then to terminate the com- mand. Table 4 shows the status of bits SH and SN under various conditions of SCAN. STATUS REGISTER 2 COMMAND COMMENTS BIT 2 = SN BIT 3 = SH 0 1 DFDD = DProcessor Scan Equal 1 0 DFDD * DProcessor 0 1 DFDD = DProcessor Scan Low or Equal 0 0 DFDD < DProcessor 1 0 DFDD 4. Dprocessor 0 1 DFDD = DProcessor Scan High or Equal 0 0 DFDD < DProcessor 1 0 DFDD ~ DProcessor Table 4 If the FDC encounters a Deleted Data Address Mark on one of the sectors (and SK = 0), then it regards the sector as the last sector on the cylinder, sets CM (Control Mark) flag of Status Register 2 to a 1 (high) and terminates the command. If SK = 1, the FDC skips the sector with the Deleted Address Mark, and reads the next sector. In the second case (SK = 1), the FDC sets the CM (Control Mark) flag of Status Register 2 to a 1 (high) in order to show that a Deleted Sector had been encountered. When either the STP (contiguous sectors = 01, or alternate sectors = 02 sectors are read) or the MT (Multi- Track) are programmed, it is necessary to remember that the last s.ector on the track must be read. For example, if STP = 02, MT = 0, the sectors are numbered sequentially 1 through 26, and we start the Scan Command at sector 21; the following will happen. Sectors 21, 23, and 25 will be read, then the next sector (26) will be skipped and the Index Hole will be encountered before the EOT value of 26 can be read. This will result in an abnormal termination of the command. If the EOT had been set at 25 or the scanning started at sector 20, then the Scan Command would be completed in a normal manner. During the Scan Command data is supplied by either the processor or DMA Controller for comparison against the data read from the diskette. In order to avoid having the OR (Over Run) flag set in Status Register 1, it is necessary to have the data available in less than 27 j1s (FM Mode) or 13 j1S (MFM Mode). If an Overrun occurs the F DC ends the command with bits 7 and 6 of Status Register 0 set to 0 and 1, respectively. SEEK The read/write head within the FDD is moved from cylinder to cylinder under control of the Seek Command. The FDC compares the PCN (Present Cylinder Number) which is the current head position with the NCN (New Cylinder Numbed, and if there is a difference performs the following operation: PCN < NCN: Direction signal to FDD set to a 1 (high), and Step Pulses are issued. (Step In.) PCN> NCN: Direction signal to FDD set to a 0 (low), and Step Pulses are issued. (Step Out.) The rate at which Step Pulses are issued is controlled by SRT (Stepping Rate Time) in the SPECIFY Com- mand. After each Step Pulse is issued NCN is compared against PCN, and when NCN = PCN, then the SE (Seek End) flag is set in Status Register 0 to a 1 (high), and the command is terminated. During the Command Phase of the Seek operation the FDC is in the FDC BUSY state, but during the Execution Phase it is in the NON BUSY state. While the FDC is in the NON BUSY state, another Seek Command may be issued, and in this manner parallel seek operations may be done on up to 4 Drives at once. If an FDD is in a NOT READY state at the beginning of the command execution phase or during the seek operation, then the NR (NOT READY) flag is set in Status Register 0 to a 1 (high), and the command is terminated after bits 7 and 6 of Status Register 0 are set to 0 and 1 respectively. 15 J.L PD765 RECALIBRATE FUNCTIONAL The function of this command is to retract the read/write head within the FDD to the Track 0 position. DESCRIPTION OF The FDC clears the contents of the PCN counter, and checks the status of the Track 0 signal from the COMMANDS (CONT.) FDD. As long as the Track 0 signal is low, the Direction signal remains 1 (high) and Step Pulses are issued. When the Track 0 signal goes high, the SE (SEEK END) flag in Status Register 0 is set to a 1 (high) and the command is term inated. Ifthe Track 0 signal is still low after 77 Step Pulse have been issued, the F DC sets the SE (SEEK END) and EC (EQUIPMENT CHECK) flags of Status Register 0 to both 1s (highs), and terminates the command after bits 7 and 6 of Status Register 0 is set to 0 and 1 respectively. The ability to do overlap RECALIBRATE Commands to multiple FDDs and the loss of the READY signal, as described in the SEEK Command, also applies to the RECAll BRATE Command. SENSE INTERRUPT STATUS An I nterrupt signal is generated by the FDC for one of the following reasons: 1. Upon entering the Result Phase of: a. Read Data Command b. Read a Track Command c. Read ID Command d. Read Deleted Data Command e. Write "Data Command f. Format aCyl inder Command g. Write Deleted Data Command h. Scan Commands 2. Ready Line of FDD changes state 3. End of Seek or Recalibrate Command 4. During Execution Phase in the NON-DMA Mode Interrupts caused by reasons 1 and 4 above occur during normal command operations and are easily dis- cernible by the processor. However, interrupts caused by reasons 2 and 3 above may be uniquely identified with the aid of the Sense Interrupt Status Command. This command when issued resets the interrupt signal and via bits 5, 6, and 7 of Status Register 0 identifies the cause of the interrupt. SEEK END INTERRUPT CODE CAUSE BIT5 BIT6 BIT 7 0 1 1 Ready Line changed state, either polarity 1 0 0 Normal Termination of Seek or Recalibrate Command 1 1 0 Abnormal Termination of Seek or Recalibrate Command Table 5 Neither the Seek or Recalibrate Command have a Result Phase. Therefore, it is mandatory to use the Sense! Interrupt Status Command after these commands to effectively terminate them and to provide verification of where the head is positioned (PCN). SPECIFY The Specify Command sets the initial values for each of the three internal timers. The HUT (Head Unload Time) defines the time from the end of the Execution Phase of one of the Read/Write Commands to the head unload state. This timer is programmable from 0 to 240 ms in increments of 16 ms (00 = 0 ms, 01 = 16 ms, 02 = 32 ms, etc.). The SRT (Step Rate Time) defines the time interval between adjacent step pulses. This timer is programmable from 1 to 16 ms in increments of 1 ms (F = 1 ms, E = 2 ms, D = 3 ms, etc,), The HlT (Head load Time) defines the time between when the Head load signal goes high and when the Read/Write operation starts. This timer is programmable from 2 to 256 ms in increments of 2 ms (00 = 2 ms, 01 = 4 ms, 02 = 6 ms, etc.). The time intervals mentioned above are a direct function of the clock (ClK on pin 19). Times indicated above are for an 8 MHz clock, if the clock was reduced to 4 MHz (mini-floppy application) then all time intervals are increased by a factor of 2. The choice of OMA or NON-DMA operation is made by the ND (NON-DMA) bit When this bit is high (ND = 1) the NON-DMA mode is selected, and when ND = 0 the DMA mode is selected. SENSE DRIVE STATUS This command may be used by the processor whenever it wishes to obtain the status of the FDDs. Status Register 3 contains the Drive Status information. INVALID If an invalid command is sent to the FDC (a command not defined above), then the FDC will terminate the command after bits 7 and 6 of Status Register 0 are set to 1 and 0 respectively. A Sense Interrupt Status Command must be sent after a Seek or Recalibrate Interrupt, otherwise the FDC will consider the next command to be an Invalid Command. In some applications the user may wish to use this command as a No-Op command, to place the FOC in a standby or no operation state. 16 J.L:PD765 STATUS REGISTER BIT DESCRIPTION IDENTIFICATION NO. NAME SYMBOL STATUS REGISTER 0 D7 D7 = 0 and D6 = 0 Interrupt IC Normal Termination of Command, (NT). Com- Code mand was completed and properly executed. D6 D7 = 0 and D6 = 1 Abnormal T~!mination of Command, (AT). Execution of Command was started, but was not successfully completed. D7 = 1 and D6 = 0 Invalid Command issue, (lC). Command which was issued was never started. D7 = 1 and D6 = 1 Abnormal Termination because during;command execution the ready signal from FDD changed state. D5 Seek End SE When the FDC completes the SEEK Command, this flag is set to 1 (high). D4 Equipment EC If a fault Signal is received from the FDD, or if Check the Track 0 Signal fails to occur after 77 Step Pulses (Recalibrate Command) then this flag is set. D3 Not Ready NR When the FDD is in the not-ready state and a ..u read or write command is issued, th is flag is set. If a read or write command is issued to Side 1 of a single sided drive, then th is flag is set. D2 Head HD This flag is used to indicate the state of the head Address at Interrupt. D1 Unit Select 1 US 1 These flags are used to indicate a Drive Unit DO Unit Select 0 usa Number at Interrupt STATUS REGISTER 1 D7 End of EN When the FDC tries to access a Sector beyond Cylinder the final Sector of a Cylinder, this flag is set. D6 Not used. This bit is always 0 (Jow). D5 Data Error DE When the FDC detects a CRC error in either the ID field or the data field, this flag is set. D4 Over Run OR If the FDC is not serviced by the main-systems during data transfers, within a certain time interval, this flag is set. D3 Not used. This bit always 0 (Jow). D2 No Data ND During execution of READ DATA, WRITE DELETED DATA or SCAN Command, if the FDC cannot find the Sector specified in the IDR Register, this flag is set. During executing the READ ID Command, if the F DC cannot read the I D field without an error, then this flag is set. During the execution of the READ A Cylinder Command, if the starting sector cannot be found, then this flag is set. 17 J.LPD765 STATUS REGISTER BIT DESCRIPTION IDENTI FICATION (CONT.) NO. NAME SYMBOL STATUS REGISTER 1 (CONT.) 01 Not NW During execution of WR ITE DATA, WR ITE Writable DELETED DATA or Format A Cylinder Com- mand, if the FDC detects a write protect signal from the FDD, then this flag is set. Da Missing MA I f the FDC cannot detect the ID Address Mark Address after encountering the index hole twice, then Mark th is fl ag is set. If the FDC cannot detect the Data Address Mark or Del eted Data Address Mark, th is fl ag is set. Also at the same time, the MD (Missing Address Mark in Data Field) of Status Register 2 is set. STATUS REGISTER 2 07 Not used. This bit is always a (low). 06 Control CM During executing the READ DATA or SCAN Mark Command, if the FDC encounters a Sector which contains a Deleted Data Address Mark, th is flag is set. 05 Data Error in DO If the FDC detects a CRC error in the data field Data Field th en th is fl ag is set. 04 Wrong WC This bit is related with the NO bit, and when the Cylinder contents of C on the medium is different from that stored in the lOR, this flag is set. 03 Scan Equal SH During execution, the SCAN Command, if the Hit condition of "equal" is satisfied, th is flag is set. 02 Scan Not SN During executing the SCAN Command, if the Satisfied FDC cannot find a Sector on the cylinder which meets the condition, then this flag is set. 01 Bad BC This bit is related with the NO bit, and when the Cylinder content of C on the medium is different from that stored in the I DR and the content of C is FF, then this flag is set. Da Missing MD When data is read from the medium, if the F DC Address Mark ca'lnot find a Data Address Mark or Deleted in Data Field Data Address Mark, then this flag is set. STATUS REGISTER 3 07 Fault FT This bit is used to indicate the status of the Fault signal from the F DO. 06 Write WP This bit is used to indicate the status of the Protected Write Protected signal from the F DO. 05 Ready RY This bit is used to indicate the status of the Ready signal from the F DO. 04 Track a Ta This bit is used to indicate the status of the Track a signal from the FDD. 03 Two Side TS Th is bit is used to indicate the status of the Two Side signal from the FDD. 02 Head Address HD This bit is used to indicate the status of Side Select signal to the FDD. 01 Unit Select 1 US 1 This bit is used to indicate the status of the Unit Sel ect 1 signal to the F DO. Da Unit Select a US a This bit is used to indicate the status of the Unit Select a signal to the F DO. 18 NOTES 19 The informatioh~presented in this document is believed to be accurate and reliable. The information is subject to change without notice. 'PRINTED IN U.S.A. SP765-12-78-4K-GN