34

When the 3.5" FDD was introduced for the IBM PC and compatibles (or possibly earlier), someone made a decision to make the data cable between the controller and drive unkeyed. This, of course, meant that you could plug it in the wrong way if you weren't paying close attention to which side pin 1 was on.

If you did plug the cable in the wrong way, two obvious user-observable things happened:

  • Neither the floppy disk drive nor the controller broke; if you realized the error of your ways in time, all you needed to do was flip the cable over and give it another try, and no harm came of it
  • When the system was powered on, the disk drive's activity light would be continuously illuminated

Also, as I recall (though this has been argued against in response to this question), if you inserted any floppy disk, whether the read-only tab was in the read-only or read/write position, however briefly, while the drive was in this state, then that disk was trashed and basically only good as a coaster afterwards (due to their almost square form factor, floppy disks never made good frisbees).

What was actually going on inside that floppy disk drive, and why?

user
  • 5,286
  • 2
  • 26
  • 43
  • "someone made a decision to make the data cable between the controller and drive unkeyed" I like how modern connectors like Apple lightning https://en.wikipedia.org/wiki/Lightning_(connector) don't care which way you plug them in. – Caltor May 22 '19 at 10:58
  • 1
    @Caltor lightning cables are asymmetrical. The port you plug it into has to figure out orientation. USB-C is symmetrical by default, but can negotiate asymmetry for more contacts. – bobsburner Mar 13 '20 at 09:28
  • @bobsburner Interesting! Well I didn’t know that. The connector itself must be symmetrical though to let you plug it in either way. – Caltor Mar 15 '20 at 09:36
  • 2
    @Caltor Physically, it is.Electrically, it is not. (I occasionally have to use an iphone that only charges plugged in one way) – bobsburner Mar 16 '20 at 09:16
  • It was not trashed. you just formatted it again and reused it. There is no permanent track format on a floppy. The contoller computer system would write a series of bytes in memory, and send that to the controller. Various codes were interpreted as write a Sector mark, here, write a track mark, write a CRC, etc. – Ferd Nov 08 '23 at 22:53

3 Answers3

41

One side of the cable is normally all ground. The other is all signals. This was done so a ribbon cable would have a ground wire between each signal wire, which helps prevent crosstalk.

Flipping the cable swaps signals for grounds, grounding all signals. Since all the signals on a floppy disk are considered to be asserted when a zero (a logic 1 = ground) all the signals are activated.

The cable has many signals, but these are the key ones that erase the disk.

  • /MOTEA ( Motor enable) is asserted, which starts the motor spinning.
  • /DRVSA (drive select) is enabled. It engages the head load solenoid which pushes the head against the floppy diskette.
  • /WDATE (write data) is asserted low, so a logic 1 will be written to the floppy
  • /WGATE (write gate) is asserted so the current to the head is turned on.

The floppy head is a small electromagnet, so the data on the track under the head is erased.

I learned to always power up and check the led before putting on a floppy. Many years ago I erased a very valuable Unix partition on a hard disk by powering up the disk and then the controller. The exact same thing happened, because I had two power cords instead of one.

wizzwizz4
  • 18,543
  • 10
  • 78
  • 144
Ferd
  • 811
  • 6
  • 5
  • 2
    Could you please elaborate on some things? (I'm not sure what; it's a good answer, but seems short.) – wizzwizz4 Jul 19 '16 at 06:30
  • I added cable details on the exact signals involved. It's actually making logical 1's on the cable, but I don't have enough rep t comment above. This asserts all the signals. /DRVSA is asserted when low. This requires a logical 1, indicated by the slash. – Ferd Sep 24 '16 at 01:41
  • 3
    Now I understand why this happens! It's such a shame I can't upvote a second time. I've making a small edit to improve the formatting; if you don't like it you can revert the changes. – wizzwizz4 Sep 24 '16 at 08:00
  • 3
    I found a pinout at http://pinouts.ru/HD/InternalDisk_pinout.shtml which has all of the signals. – user Feb 27 '17 at 16:17
  • 1
    I believe this is still the canonical method to format a floppy disk in *nix operating systems. ;) – Caltor May 22 '19 at 10:52
  • So would this write a 1 to just the first bit or the whole drive? If just the first bit then it should be an easy fix. I’m guessing not though and that the head would advance as each bit is written. Also (with my limited understanding) it seems strange to me that ground = 1 but current = 0. Who on earth came up with that idea. – Caltor Mar 15 '20 at 09:49
  • 1
    @Caltor, it writes a constant stream of 1s. And it's fairly arbitrary whether "ground = 0" or "ground = 1" -- computers generally use both patterns in places, depending on which one makes for a more efficient circuit. – Mark Oct 07 '22 at 21:42
  • 4
    @caltor it’s fairly common for low voltages to mean an active signal. I think it is a legacy of BJT transistors being much easier to sink current than to source it, so you drive the pin high with a pull-up resistor and drive it low by turning on a transistor that is connected from the pin to ground. See also “Open Collector” on Wikipedia. – Jacob Krall Oct 08 '22 at 01:41
  • @Mark, these are just erased tracks with no ones or zeros. A single density FM or double density MFM pattern would have to be written to write what the system would consider a 1 or a 0. These look like square waves, more or less. The Transitions make the 1's and 0's. – Ferd May 10 '23 at 01:39
20

According to the standard pinout only even pins are used for actual signals, and all odd pins are used for ground. (some floppy drives are actually missing every nth pin or more from the odd row - because there is no need for that many ground pins, this makes very easy to identify which row is ground).

Reversing the cable simply grounds everything on the motherboard floppy interface - but since the interface is of "Open Collector" type - that causes no harm to signals coming out of the controller to the drive.

Conversely, digital signals that the floppy controller tries to read would all be seen as binary "0" - this is effectively what grounding them does.

Even though signals are swapped with ground the drive still does get "correct" ground from the power connector - this is how it grounds all other signals.

Activity light would be illuminated because the drive still does get the power from the 4-pin cable - I'm not sure whether this was on purpose to indicate a problem, it might depend on a drive.

I've never heard of data corruption caused as a result of the cable - I'm sure the heads don't write anything. Physical corruption can't happen either - the heads make contact as designed when the disk is inserted (the head's arm are lowered only then). - Corrected as per feedback.

Kuba Tyszko
  • 2,648
  • 15
  • 31
  • 2
    Interesting side note: If I recall correctly you the Atari ST uses a standard drive but with the cable connected the wrong way around! I guess they hooked up the odd pins instead. – Matt Lacey Jun 21 '16 at 00:43
  • 4
    "I've never heard of data corruption caused as a result of the cable" Well, now you have: It happened to me. I definitely recall breaking one or two boot disks when building PCs and inserting the boot disk before turning on power for the first time (or maybe it was just thinking "hey that light being on is odd, okay let's proceed anyway"). Another tech at the company at the time said afterwards "throw it away, it's ruined now" about that floppy. – user Jun 21 '16 at 07:53
  • 1
    I second that. I trashed several floppies that way. – chris-l Jun 21 '16 at 07:55
  • 2
    I'd never heard of data corruption either, and I worked for many years back in the day as a PC repair tech. I was about to comment the same thing on the question. To be fair, I always checked to see that the floppy drive light went off during POST whenever I added a drive, but I'm surprised at least one time I hadn't left a floppy in the drive. – Cody Gray - on strike Jun 21 '16 at 15:59
  • @MichaelKjörling OK, but don't believe everything a tech. tells you (though trashing the disk would be easier than figuring out what really happened). Unless it was physical damage (I doubt it), why not just reformat the disk? – user3169 Jun 21 '16 at 18:26
  • @user3169 That's actually a good question, and it is one to which I have no answer. My experience with this was around 20 years ago. I didn't then have the benefit of the technical knowledge I have today. (Though I'm pretty sure that I did try reformatting the disk without success. I fail to recall any details about that, however.) – user Jun 21 '16 at 18:36
  • @MichaelKjörling Understood. In that, I would suggest removing the third point from your question, since I doubt it could be substantiated. – user3169 Jun 21 '16 at 19:34
  • @user3169 Good point. Done that. – user Jun 21 '16 at 19:38
  • Weird. I've seen this done wrong a lot of times in my many years and I'd never heard of data corruption as a result until now. – Brian Knoblauch Sep 11 '17 at 00:02
  • @MattLacey the ST case is something a little odder - I can't remember exactly but I think it's something like they chose to assign the drives as all "drive 1" (out of the four designations generally available - and at one time, jumper selectable - within the original floppy standard) and make it a case of cable-select, whereas in the PC they're all "drive 0"... or vice versa. Neither is more logical or correct than the other, and if you can change the jumpers it makes little difference. But if you have a jumperless PC-standard drive, you have to cut and invert the drive0/drive1 cable lines... – tahrey Oct 27 '19 at 19:26
  • (If you connect up a PC drive unmodified, it doesn't glitch out and erase disks, turn the light on, run the motor continuously, etc... it just doesn't work, because despite the machine's best efforts asserting "drive 1 select" on the cable, the drive never responds, as it's expecting selection on the drive 0 line instead. PC floppy cables are designed so that each of the 2 or 4 input signals routes to "0" on a different connector; the ST does something similar with its daisychained external, or internal-then-external drives... "A" goes direct to the 1st drive, "B" is passed thru as a 2nd "A".) – tahrey Oct 27 '19 at 19:29
2

Can't comment, so to answer Caltor's comment question above:

How is “ Neither the floppy disk drive nor the controller > broke” a user-observable thing? How can you observe something not happening?

When you plugged in the drive backwards and powered on the machine, the drive's activity light would come on and stay on and any disk inserted would be fubar'd.

"How can you observe something not happening?" is easy in this case. If you unplug the drive and switch the cable to the correct orientation, the drive will now work properly, no smoke, no dead drive, nothing damaged (except any diskette inserted into the drive).

You learned early in those days that when you power on the machine after having it apart, you wait with nothing in the drives for the message to "insert disk" and wait for the light to turn off. If it never did, or you could still hear the drive spinning without a disk, you knew you goofed!

millebi
  • 171
  • 3