FD1771 Floppy Disk Controller Pitfalls


Introduction

While working with Josh Bensadon on other projects in 2013, he passed along to me his work on the WD1771 floppy controller chip. I've published it here as he wrote it. This work is copyrighted by Josh as author; the page as published has my copyright. Tarbell products are discussed on this linked Web page. I discuss floppy diskettes and S-100 controlers on several S-100 Web pages at retrotechnology.com - Herb Johnson

Subject: Western Digital FD1771 Floppy Disk Controller chip operation idiosyncrasy.
Author: Josh Bensadon Date: Aug 2013

A year ago I bought an IMSAI 8080 with 8” floppy drives and a Tarbell MDL 1011D disk controller. After several repairs the system became operational and was ready to read/write to a floppy disk. The system came with some new (unformatted) floppy disks only, there was no software included. This short write up documents the struggle and lessons learned from a baby step between reading/writing bit patterns to performing a proper format of a floppy disk.

The Tarbell 1011 manual was easy to find online at http://www.s100computers.com The manual is very useful and full of everything you need. After a good read of the manual and the included data sheet for the FD1771, I can only add just a tiny bit more.

The controller is software driven (as opposed to DMA). The disk speed is so fast that the data can only be transferred in a special loop. Interrupts on the 8080 are not fast enough, polling the controller is worse. This special loop uses hardware on the controller to put the CPU into a WAIT state to govern the data stream. The “IN WAIT” instruction as shown on page 5-4-3, causes the program to wait at that instruction until the hardware releases the wait state. The data rate is 1 byte per 32uSec, this amounts to 64 clock cycles. This loop takes 56 clock cycles to wait for data, test for end of transfer, save the data and loop back. That calculates to a 4uSec wait time between bytes. Now that’s cutting it close!

When writing data to a floppy in single density format, a “1” clock pulse is added between every data bit. In the data sheet for the FD1771, they do not express the importance of missing clock pulses. On page 14 they cover non-IBM formats and indicate the use of index address marks are not required. For my testing purposes, I tried to write a whole track with AA’s. Since this would make a nice pattern that could be observed by a regular oscilloscope. Upon reading the data back, you might expect AA’s or 55’s but instead I was only getting FF’s. So that meant the FD1771 saw my AA’s as the clock pulse and the inserted clock pulses as the data. At first, I thought there was a problem with the clock/data separator and I spent a lot of time testing and came out with the same result, nothing is wrong. I tried 3 different FD1771 chips, including 2 from national semiconductor, same outcome. Next I tried to flip the Clock and Data pins, and got mixed results depending on the data written. I then examined other FD1771 based floppy controllers (appendix A) to see if the data/clock were applied to the right pins and they were. The confusing part was, even after flipping clock and data, I would still get FF’s on some data patterns written. It was finally explained in a small side note on page 16 of the data sheet “FDCLK & FDDATA may be reversed. FD1771 decides what is clock and what is data”. How the FD1771 decides is not detailed.

After wasting much time on this baby step, I just continued to write a proper IBM 3740 format to the disk, which includes address marks that omit some clock pulses. Data was now being successfully written and read back.

My final experiment was to flip the Clock and Data. Sure enough, the FD1771 compensated for the flipped signals and the data read back was still correct.

Appendix A. Other floppy drive controllers using the FD1771.

TRS-80 Model 1. Does not have an external data separator, uses the separator built into the FD1771. NorthStar & Cromemco both wire the clock and data to the same pins as the Tarbell 1011.


Herb Johnson
New Jersey, USA
here is how to email @ me

Copyright © 2013 Herb Johnson