Floppy Interfacing Hack Chat With Adafruit

Floppy disks

Join us on Wednesday, February 2 at noon Pacific for the Floppy Interfacing Hack Chat with Adafruit’s Limor “Ladyada” Fried and Phillip Torrone!

When a tiny fleck of plastic-covered silicon can provide enough capacity to store a fair percentage of humanity’s collected knowledge, it may seem like a waste of time to be fooling around with archaic storage technology like floppy disks. With several orders of magnitude less storage capacity than something like even the cheapest SD card or thumb drive, and access speeds that clock in somewhere between cold molasses and horse and buggy, floppy drives really don’t seem like they have any place on the modern hacker’s bench.

join-hack-chatOr do they? Learning the ins and out of interfacing floppy drives with modern microcontrollers is at least an exercise in hardware hacking that can pay dividends in other projects. A floppy drive is, after all, a pretty complex little device, filled with electromechanical goodies that need to be controlled in a microcontroller environment. And teasing data from a stream of magnetic flux changes ends up needing some neat hacks that might just serve you well down the line.

So don’t dismiss the humble floppy drive as a source for hacking possibilities. The folks at Adafruit sure haven’t, as they’ve been working diligently to get native floppy disk support built right into CircuitPython. To walk us through how they got where they are now, Ladyada and PT will drop by the Hack Chat. Be sure to come with your burning questions on flux transitions, MFM decoding, interface timing issues, and other arcana of spinning rust drives.

Our Hack Chats are live community events in the Hackaday.io Hack Chat group messaging. This week we’ll be sitting down on Wednesday, February 2 at 12:00 PM Pacific time. If time zones have you tied up, we have a handy time zone converter.

Hack Chat poster

43 thoughts on “Floppy Interfacing Hack Chat With Adafruit

  1. I always had floppy drives from my first in 1984 to 2016. I even have a couple of USB flopoy drives around, just in case, though I’ve never used them.

    Other than nostalgia, or reading old floppies, I can’t see the point. Especially not for new controllers.

    There’s a difference between nostalgia for things you experienced, and nostalgia because you think something that happened before you were born or aware is “cool”

    1. Have to agree. Floppy drives need lots of power plus two voltages—and for what? Riding a slow bus to access 1.4MB?
      I loved the buggers back in the day, but for me it’s a hard pass.

      1. There are still lots of floppy drives out in the world of industrial equipment. I use a usb floppy drive all the time.
        And then there is the question of accessing legacy data. Lots of archives are full of various sized floppies, digital tapes, U-Matic, Betamax, etc etc etc

      2. They have their place in the retro community. Now imagine a diskmag for your favorite 8-bitter, would you rather have a SD card or a 5¼” disk in the mail? Even if one was to make a diskmag for old DOS machines i would love me a 3½” disk in the mail.
        Its just something special and magical for me.

      3. Well, magnetic devices like floppies do have galvanic insulation.. Flash drives can be killed if the computer dies due to overvoltage et cetera. Floppies don’t get electro shocks! 😉

          1. I once killed a couple of floppies, or rather the contents. I plugged a drive in backwards, which grounded the right combination of things so the drive started working but started erasing.

            I don’t fully remember how this happened, I think it was on a 3.5 inch drive.

    2. It’s a great hobby and learning exercise. Floppies and the floppy drive interface are quite a bit more complex than you might assume, and many of the technologies and techniques form a good basis for other fields.

      The standard floppy drive doesn’t give you a neat addressable interface. It doesn’t even output bits: it produces a pulse whenever the magnetic flux changes. This means you need to learn about the raw encoding on the disk (Modified Frequency Modulation), why it’s being used (there’s both a maximum and a minimum number of flux changes you’d want on a magnetic medium) and how to decode it.
      There’s no separate clock. The clock is recovered from the encoded signal. This used to be done with a hardware PLL, but when bitbanging from a microcontroller you need to be creative. You need to do something because the clock will not only vary from drive to drive (both read drive and write drive) but will also wobble over time.
      On a 3.5″ floppy there’s no hardware to indicate where sectors on a disk start and end, only an index pulse that occurs once per rotation. The separation of sectors is done with special markers that aren’t normally allowed in the encoding and long sequences of the same symbol to initialize the clock sync.

      All of these considerations still exist for modern serial transmissions such as USB, HDMI or PCIe (though they use different encodings.)

      On top of all that are the error checking parts, seeking, reading, writing and formatting sectors, and a simple filesystem.
      For a real challenge: all of this just barely fits in a base Arduino UNO, but you’ll need to figure out a way to read edge-triggered signals, reverse the normal way signal timing should work, and use carefully calibrated assembly loops to extract the sync, clock and data all at once.

      1. 5.25″ and 8″ had an index pulse, with exceptions like Commodore which didn’t use it. Then there were the rarely used hard sectored 5.25″ and 8″ disks and drives with pulses for every sector boundary and an index pulse.

        1. The 3.5″ also had an index but it was achieved differently.

          On the larger drives a clasp mechanism would grip the disk in any rotational orientation.

          On a 3.5″ the rotational drive mechanism would only engage with the disk in one specific rotational position.

        2. … and hard sectored disks had different sector counts. I recall walls of boxes of 5.25 disks in computer shops: a combinatorical cornucopia of single/double side (SS/DS), single/double/high density (SD/DD/HD), 16 sector/10 sector/soft sector, premium/value brands. $20-$50+ per box of 10 in mid 1980s money. I eventually went in with some friends for one box out of a bulk order of some vaguely creepy no-brand disks for something closer to but still over $10.
          (typed on a phone with 1/4 TB & an empty slot for more)

      2. Or just go to the basement and pull a floppy controller IC off a board.

        It’s been a really.long time since that wasn’t the route, though I think there was an “early” article in Byte, and OSI used a USART rather than floppy controller. And of course Apple used a simple interface by using a midified drive.

    1. The platter inside is still floppy though :) . I’ve destroyed most of the floppies I had around. I do have a USB floppy drive in case I ever need it. I few years ago, I pulled off some pictures for one of my co-workers which was the last time I used the USB drive.

    2. I’ve never understood the nitpicking. When I got my first 3.5 inch drive, I used itto replace one of my 5.25 inch drives. I considered them the same thing, except the smaller floppies had higher density.

      5.25 inch floppies don’t even flop as much as 8 inch, which I never experienced till abiut 15 years ago, when I found a box of 8 inch.

      The transition wasn’t direct from 5.25 to 3.5. Some bought into 3 inch, only to find they bet wrong. There were 3.5 (Ithink they were, and not 3 inch) that had a metal hub, but no rigid case.

      If kids in 1990 wondered why “you call them floppies”, none of it matters anymore, because kids (even those grown up kids) don’t use any size or floppy.

      1. Also the cases are rectangular(ish), not circular, so they can’t be what the word “disc/k/q” refers to.

        It’s like complaining about people calling cassettes “tapes”, because the rectangular plastic thing isn’t shaped like a tape at all. The case is irrelevant, it’s what’s inside that’s important.

    1. Yeah, that’s on of the most disappointing things about hackaday for me. It would be good if they did a summary article after the hackchat for us non Vampire US types who aren’t to reading the web at 3:00 AM in the morning.

        1. Well for me it’s in two days time at 6:00AM, I would have forgotten about it by then and there aren’t HAD articles to remind people that it occurred.

          Believe me, I am a big HAD fan, I’ve been here since not long after the beginning. Half my brain runs on 555’s and I use an Arduino to tie my shoe laces.

          It’s just such a prohibitive task even to get the time of the event, which I don’t bother to do anymore as it’s never a time that I would watch it anyway. Javascript has access to the local machine time, it’d would be so simple to skip the external web time converter and say the video is at XX:XX A/PM in your local time.

          It would be good If I could sign up to get a link to a video via email and what it’s about whenever one is uploaded.

          1. You’re in luck, or you just started complaining at the right time.

            We’ve been thinking a lot about how to widen up the audience for Hack Chats, and we’re going to experiment with doing post-chat writeups on Hackaday. We were going to start up this week!

  2. I would love to be there, I am messing with floppys and learn so much on how to use every bit i can! But I’ll be work at that time, if only it was two hours later I know can participate.

  3. I fell a more fruitful project would be the other way around. A floppy disk you can insert into a standard floppy drive inside a vintage machine, and it would emit data from an SD card. Similar to the old tape cassette aux cable adapters you can get.

    Most current SD card floppy drive emulators rely on connecting directly to the FDD controller, which isn’t easily done on laptops or if you want to move from machine to machine.

    1. (I had an earlier reply that might appear later or might get swallowed due to links…)

      [Sprite_tm] made an SD-floppy adapter, that’s useful as an esthetic hack (it still uses pins internally)

      There was also a device called the “FlashPath” that adapts SmartMedia, Memory Stick and MMC/SD-Cards to regular floppy drives through a magnetic interface, but I see now that it requires special drivers on the host.

      1. I have the SmartMedia to floppy adapter, though I have been on the lookout for the MemoryStick to floppy adapter, as I already have microSD to MemoryStick adapters, and would make it a lot more comfortable with replacement uSD cards being so cheap. I have a 128MB SM card which works fine now, but I imagine that a 128GB uSD -> uSD to MS adapter -> MS to floppy adapter would allow for quite a bit more available storage to a legacy laptop with limited port availability. Speeds be damned, as none of this would be for productivity anyway.

  4. The old full height 5.25″ drives ought to be ideal for use in robotics. They have a quite powerful motor for spinning the disk, a NEMA 17 (or thereabouts) stepper motor, and two I/O channels setup to read and write magnetic pulses. Though the rare exception single sided only ones just have support for one head. Most single sided drives simply had a pressure pad in place of the second head. If one had the equipment to align it, they could be upgraded.

    So the hack would be to modify the hardware to do things other than spin a disk and move a head back and forth, and put together I/O stuff that can interface with the controller board via the RW head connections. The control software would interpret and format the data from and to to go through the head connections, and on the other side of the disk control boards the hardware would need to convert its data to be like whatever signals go to and from the heads.

    So with the works out of two old drives there would be two motors for driving wheels, a pair of stepper motors for an arm with a shoulder and elbow joint, and four I/O channels to be hacked to control things like a gripper and sending back sensor data. That could be expanded to eight one way channels controlling four outputs and four inputs.

    Just have to fake magnetic flux transitions in a way that won’t make the drive controller board wig out.

  5. So while I am, here …

    Future generations will find some old floppy disks and wonder how we encoded data into mold DNA!

    I love them, I have an old CPC 6128 which I think is a Spectrum +3 there and it’s modified to use 3.5″ floppies but here in the tropics floppies were always a problem with mold. I have a WiFi board so I can upload programs directly into RAM from my modern desktop PC so I don’t use floppies.

  6. My A and B drive letters are still reserved for floppy drives. Makes it hard to forget how important they were. Just like I’m always reminded of typewriter jamming issues when I look at my qwerty keyboards.

  7. Just a general note: when trying to read floppies that seem to have weird encoding: many years ago, I worked on a custom knitting machine that used 5-1/4 floppies, and was going crazy trying to read what seemed to be a custom format that could not be read on a PC – it turned out that they had used a 14.3xxMhz crystal instead of a 16Mhz one, just to skew the data rate enough to make it unreadable. Switching to a crystal of the correct frequency made the data read/writeable on the PC.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.