Adafruit Brings Floppy Disk Support to Arduino Boards, Creates an Open Source USB Floppy Drive
Adafruit Floppy project goes beyond CircuitPython with an Arduino port, MFM decoding, and a USB adapter mode — with more to come.
Adafruit is continuing its experiments in interfacing classic floppy disk drives to modern microcontrollers with a shift across to the Arduino platform — and has found a way to create a fully-functional USB floppy drive as a result.
Adafruit first showed off its work with floppy drives earlier this month, showcasing a project to add support for the magnetic media - first invented by IBM in the 1960s as eight-inch literally-floppy behemoths before being shrunken down to the more recognizable 3.5" "floppy diskettes" many applications still use as their save-file icon — to the CircuitPython programming environment. Now, the company's looking at doing the same for Arduino.
"We're doing some cross-platform code sharing where the MFM [Modified Frequency Modulation, one of the standards for encoding data on floppy disks] decoding C code is going to be the same for Arduino and CircuitPython," Adafruit's Phillip Torrone explains. "We got on-the-fly MFM decoding working so we have [magnetic] fluxes converted to bytes, and all the sectors are verifying right. Wouldn’t it be neat if we could use tinyusb’s mass-storage class to make a USB floppy drive?"
Described as "a project LadyAda has wanted since she was a teenager," the proof-of-concept creation connects a 3.5" floppy drive to an Arduino microcontroller running the tinyusb open source USB stack. "All we have to do is tell USB MSD how many sectors we’ve got (18 per track, 80 tracks, 2 sides) and supply the 512 byte sectors when we get a SCSI READ10 callback," Torrone writes, and "it 'just works' as Windows still recognizes and supports FAT12 devices!"
Development is ongoing — including a promise to add support for reading Apple II disks, presently poorly supported by rival floppy drive adapter projects. A key target, meanwhile, is the Raspberry Pi RP2040 microcontroller — a $4 part which would dramatically cut the cost of building devices for archiving floppy disks.
Written in partnership with Jeff Epler, the source code for the resulting Adafruit Floppy library — which leans heavily on the earlier GreaseWeazle and FluxEngine projects — has been published to GitHub under the MIT, Creative Commons Zero, and Creative Commons Attribution 4.0 licenses.