Another Pi Day and time for another Pi project .
About a year ago Lady Ada from Adafruit did a video series on using MCUs to read from floppy drives low cost and easily available floppy interface hardware. Amongst the the MCU boards she tried were an RP2040 Feather and a Pi Pico.
I rarely use floppies anymore and I'm phasing out my old PCs with floppy drives, so I had considered buying a USB floppy drive - but it might be fun to build my own.
In January, Adafruit released the Floppy FeatherWing with 34-Pin IDC Connector. That makes building the floppy controller a matter of just connecting cables and programming the MCU on the RP2040 Feather. I have all the rest of the parts that I needed, so I bought the adapter Featherwing.
I'm going to follow along with this tutorial: https://learn.adafruit.com/adafruit-floppy-featherwing-with-34-pin-idc-connector.
Hardware
Boards
My RP2040 Feather doesn't have stacking headers, so I can't plug the Floppy Featherwing directly onto it. Instead I needed to use a FeatherWing Doubler which allows plugging in the boards side by side. The boards are shown below, before and after assembly.
Power Supply
Then I needed to find a power supply +5V at 1A. I have barrel plug adapters, so I used a +5V/4A brick and made an adapter cable to interface the drive (I cut the drive connector out of an old PC power harness). If I find a 5 1/4 inch drive to try, I'll need to also supply +12V.
Floppy Drive
I found a Teac FD-235HF 1.44MB 3 1/2" floppy drive in my PC graveyard. I'm surprised that I didn't have a bunch of them - I've got scores of old hard drives. I think at some point I switched over to higher density media (I've got a couple of 120MB LS120 SuperDisk floppy drives and some Zip Drives with 100MB cartriges). I think that I donated a lot of my old hardware and I probably haven't build a PC from scratch for 10-15 years.
Software
Adafruit does a pretty good job of explaining the method of capturing flux transitions to read data from the floppy disk, so I won't go into detail here. For my Pi Day project I'm just going to verify that I can read data from a floppy.
Archiving Floppies with GreaseWeazle Compatible Firmware
Adafruit has made the process of reading an existing floppy easy. They have pre-compiled firmware available on github - Adafruit_Floppy/releases. Just need to download the file "feather_rp2040_tinyusb.zip" and unzip it. Put the Feather into bootloader mode and drag the GreaseWeazle UF2 file to the RPI-RP2 volume.
Then you need to load GreaseWeazle onto your PC. Greaseweazle is an Open Source USB device capable of reading and writing raw data on nearly any type of floppy disk. For Windows, you can just download the latest version of the tool - GreaseWeazle/releases. Unzip the release file (I am using greaseweazel-1.8-win). To use the tool you just need to open a terminal in the installation directory (or include it in your path) and run the gw command. GreaseWeazel is using the USB connection to the Feather, so you will need to tell it what COM port is being used.
Read test
I hooked everything up:
And searched around for an exisitng 3 1/2" floppy. This was harder than I thought because I packed most of them away in storage. I finally found one in a drive in an old Win7 PC. Of course, it wasn't labeled .
Then I queried the Feather using GreaseWeazel:
H:\Element14\Adafruit_Floppy\greaseweazle-1.8-win\greaseweazle-1.8>gw info --device COM21
Host Tools: 1.8
Device:
Port: COM21
Model: Adafruit Floppy Generic
Firmware: 1.0
Serial: DF60D0C5CB8C5326
USB Rate: Full Speed (12 Mbit/s)
Everything looked good, so I then read the floppy contents into a file named output.img. (I copied the terminal contents into a code box to make it easier to read).
H:\Element14\Adafruit_Floppy\greaseweazle-1.8-win\greaseweazle-1.8>gw read --device COM21 --format ibm.1440 output.img Reading c=0-79:h=0-1 revs=2 Format ibm.1440 T0.0: IBM MFM (13/18 sectors) from Raw Flux (184951 flux in 410.82ms) T0.0: IBM MFM (16/18 sectors) from Raw Flux (461650 flux in 1020.78ms) (Retry #1.1) T0.0: IBM MFM (16/18 sectors) from Raw Flux (738229 flux in 1626.45ms) (Retry #1.2) T0.0: IBM MFM (17/18 sectors) from Raw Flux (1014914 flux in 2232.29ms) (Retry #1.3) T0.0: Giving up: 1 sectors missing T0.1: IBM MFM (17/18 sectors) from Raw Flux (185899 flux in 403.86ms) T0.1: IBM MFM (18/18 sectors) from Raw Flux (464974 flux in 1009.70ms) (Retry #1.1) T1.0: IBM MFM (17/18 sectors) from Raw Flux (165894 flux in 405.03ms) T1.0: IBM MFM (18/18 sectors) from Raw Flux (413933 flux in 1009.90ms) (Retry #1.1) T1.1: IBM MFM (18/18 sectors) from Raw Flux (183700 flux in 404.25ms) T2.0: IBM MFM (17/18 sectors) from Raw Flux (180124 flux in 407.76ms) T2.0: IBM MFM (18/18 sectors) from Raw Flux (449295 flux in 1013.22ms) (Retry #1.1) T2.1: IBM MFM (18/18 sectors) from Raw Flux (168136 flux in 403.58ms) T3.0: IBM MFM (16/18 sectors) from Raw Flux (186978 flux in 410.93ms) T3.0: IBM MFM (18/18 sectors) from Raw Flux (467393 flux in 1016.99ms) (Retry #1.1) T3.1: IBM MFM (18/18 sectors) from Raw Flux (182037 flux in 403.97ms) T4.0: IBM MFM (17/18 sectors) from Raw Flux (185108 flux in 403.90ms) T4.0: IBM MFM (18/18 sectors) from Raw Flux (465113 flux in 1009.35ms) (Retry #1.1) T4.1: IBM MFM (18/18 sectors) from Raw Flux (176024 flux in 403.77ms) T5.0: IBM MFM (16/18 sectors) from Raw Flux (171072 flux in 403.54ms) T5.0: IBM MFM (18/18 sectors) from Raw Flux (429045 flux in 1009.03ms) (Retry #1.1) T5.1: IBM MFM (18/18 sectors) from Raw Flux (186716 flux in 403.86ms) T6.0: IBM MFM (18/18 sectors) from Raw Flux (157180 flux in 402.49ms) T6.1: IBM MFM (18/18 sectors) from Raw Flux (151405 flux in 403.45ms) T7.0: IBM MFM (18/18 sectors) from Raw Flux (151438 flux in 403.38ms) T7.1: IBM MFM (18/18 sectors) from Raw Flux (151396 flux in 403.28ms) T8.0: IBM MFM (18/18 sectors) from Raw Flux (151438 flux in 403.30ms) T8.1: IBM MFM (18/18 sectors) from Raw Flux (151404 flux in 403.35ms) T9.0: IBM MFM (18/18 sectors) from Raw Flux (151398 flux in 403.39ms) T9.1: IBM MFM (18/18 sectors) from Raw Flux (151350 flux in 403.45ms) T10.0: IBM MFM (18/18 sectors) from Raw Flux (151401 flux in 403.43ms) T10.1: IBM MFM (18/18 sectors) from Raw Flux (151355 flux in 403.42ms) T11.0: IBM MFM (18/18 sectors) from Raw Flux (151400 flux in 403.46ms) T11.1: IBM MFM (18/18 sectors) from Raw Flux (151365 flux in 403.48ms) T12.0: IBM MFM (18/18 sectors) from Raw Flux (151412 flux in 403.47ms) T12.1: IBM MFM (18/18 sectors) from Raw Flux (151380 flux in 403.38ms) T13.0: IBM MFM (18/18 sectors) from Raw Flux (151398 flux in 403.48ms) T13.1: IBM MFM (18/18 sectors) from Raw Flux (151352 flux in 403.45ms) T14.0: IBM MFM (18/18 sectors) from Raw Flux (151420 flux in 403.43ms) T14.1: IBM MFM (18/18 sectors) from Raw Flux (151395 flux in 403.38ms) T15.0: IBM MFM (18/18 sectors) from Raw Flux (151414 flux in 403.46ms) T15.1: IBM MFM (18/18 sectors) from Raw Flux (151396 flux in 403.48ms) T16.0: IBM MFM (18/18 sectors) from Raw Flux (151432 flux in 403.45ms) T16.1: IBM MFM (18/18 sectors) from Raw Flux (151394 flux in 403.39ms) T17.0: IBM MFM (18/18 sectors) from Raw Flux (151408 flux in 403.53ms) T17.1: IBM MFM (18/18 sectors) from Raw Flux (151358 flux in 403.35ms) T18.0: IBM MFM (18/18 sectors) from Raw Flux (151394 flux in 403.49ms) T18.1: IBM MFM (18/18 sectors) from Raw Flux (151373 flux in 403.39ms) T19.0: IBM MFM (18/18 sectors) from Raw Flux (151401 flux in 403.49ms) T19.1: IBM MFM (18/18 sectors) from Raw Flux (151363 flux in 403.40ms) T20.0: IBM MFM (18/18 sectors) from Raw Flux (151399 flux in 403.54ms) T20.1: IBM MFM (18/18 sectors) from Raw Flux (151358 flux in 403.39ms) T21.0: IBM MFM (18/18 sectors) from Raw Flux (151382 flux in 403.52ms) T21.1: IBM MFM (18/18 sectors) from Raw Flux (151319 flux in 403.34ms) T22.0: IBM MFM (18/18 sectors) from Raw Flux (151394 flux in 403.32ms) T22.1: IBM MFM (18/18 sectors) from Raw Flux (151362 flux in 403.43ms) T23.0: IBM MFM (18/18 sectors) from Raw Flux (151388 flux in 403.48ms) T23.1: IBM MFM (18/18 sectors) from Raw Flux (151364 flux in 403.43ms) T24.0: IBM MFM (18/18 sectors) from Raw Flux (151439 flux in 403.41ms) T24.1: IBM MFM (18/18 sectors) from Raw Flux (151398 flux in 403.43ms) T25.0: IBM MFM (18/18 sectors) from Raw Flux (151396 flux in 403.37ms) T25.1: IBM MFM (18/18 sectors) from Raw Flux (151350 flux in 403.39ms) T26.0: IBM MFM (18/18 sectors) from Raw Flux (151396 flux in 403.41ms) T26.1: IBM MFM (18/18 sectors) from Raw Flux (151340 flux in 403.39ms) T27.0: IBM MFM (18/18 sectors) from Raw Flux (151392 flux in 403.35ms) T27.1: IBM MFM (18/18 sectors) from Raw Flux (151358 flux in 403.35ms) T28.0: IBM MFM (18/18 sectors) from Raw Flux (151425 flux in 403.35ms) T28.1: IBM MFM (18/18 sectors) from Raw Flux (151390 flux in 403.38ms) T29.0: IBM MFM (18/18 sectors) from Raw Flux (151396 flux in 403.36ms) T29.1: IBM MFM (18/18 sectors) from Raw Flux (151352 flux in 403.37ms) T30.0: IBM MFM (18/18 sectors) from Raw Flux (151439 flux in 403.37ms) T30.1: IBM MFM (18/18 sectors) from Raw Flux (151404 flux in 403.37ms) T31.0: IBM MFM (18/18 sectors) from Raw Flux (151433 flux in 403.34ms) T31.1: IBM MFM (18/18 sectors) from Raw Flux (151382 flux in 403.41ms) T32.0: IBM MFM (18/18 sectors) from Raw Flux (151416 flux in 403.39ms) T32.1: IBM MFM (18/18 sectors) from Raw Flux (151390 flux in 403.38ms) T33.0: IBM MFM (18/18 sectors) from Raw Flux (151378 flux in 403.36ms) T33.1: IBM MFM (18/18 sectors) from Raw Flux (151354 flux in 403.44ms) T34.0: IBM MFM (18/18 sectors) from Raw Flux (151400 flux in 403.42ms) T34.1: IBM MFM (18/18 sectors) from Raw Flux (151345 flux in 403.40ms) T35.0: IBM MFM (18/18 sectors) from Raw Flux (151402 flux in 403.44ms) T35.1: IBM MFM (18/18 sectors) from Raw Flux (151366 flux in 403.41ms) T36.0: IBM MFM (18/18 sectors) from Raw Flux (151412 flux in 403.32ms) T36.1: IBM MFM (18/18 sectors) from Raw Flux (151366 flux in 403.41ms) T37.0: IBM MFM (18/18 sectors) from Raw Flux (151368 flux in 403.44ms) T37.1: IBM MFM (18/18 sectors) from Raw Flux (151340 flux in 403.38ms) T38.0: IBM MFM (18/18 sectors) from Raw Flux (151402 flux in 403.31ms) T38.1: IBM MFM (18/18 sectors) from Raw Flux (151360 flux in 403.37ms) T39.0: IBM MFM (18/18 sectors) from Raw Flux (151393 flux in 403.41ms) T39.1: IBM MFM (18/18 sectors) from Raw Flux (151372 flux in 403.43ms) T40.0: IBM MFM (18/18 sectors) from Raw Flux (151386 flux in 403.34ms) T40.1: IBM MFM (18/18 sectors) from Raw Flux (151369 flux in 403.41ms) T41.0: IBM MFM (18/18 sectors) from Raw Flux (151351 flux in 403.38ms) T41.1: IBM MFM (18/18 sectors) from Raw Flux (151328 flux in 403.41ms) T42.0: IBM MFM (18/18 sectors) from Raw Flux (151360 flux in 403.39ms) T42.1: IBM MFM (18/18 sectors) from Raw Flux (151321 flux in 403.35ms) T43.0: IBM MFM (18/18 sectors) from Raw Flux (151356 flux in 403.32ms) T43.1: IBM MFM (18/18 sectors) from Raw Flux (151307 flux in 403.39ms) T44.0: IBM MFM (18/18 sectors) from Raw Flux (151380 flux in 403.36ms) T44.1: IBM MFM (18/18 sectors) from Raw Flux (151350 flux in 403.40ms) T45.0: IBM MFM (18/18 sectors) from Raw Flux (151356 flux in 403.34ms) T45.1: IBM MFM (18/18 sectors) from Raw Flux (151316 flux in 403.37ms) T46.0: IBM MFM (18/18 sectors) from Raw Flux (151398 flux in 403.33ms) T46.1: IBM MFM (18/18 sectors) from Raw Flux (151356 flux in 403.38ms) T47.0: IBM MFM (18/18 sectors) from Raw Flux (151398 flux in 403.39ms) T47.1: IBM MFM (18/18 sectors) from Raw Flux (151354 flux in 403.35ms) T48.0: IBM MFM (18/18 sectors) from Raw Flux (151442 flux in 403.42ms) T48.1: IBM MFM (18/18 sectors) from Raw Flux (151397 flux in 403.42ms) T49.0: IBM MFM (18/18 sectors) from Raw Flux (151392 flux in 403.39ms) T49.1: IBM MFM (18/18 sectors) from Raw Flux (151352 flux in 403.42ms) T50.0: IBM MFM (18/18 sectors) from Raw Flux (151391 flux in 403.36ms) T50.1: IBM MFM (18/18 sectors) from Raw Flux (151338 flux in 403.40ms) T51.0: IBM MFM (18/18 sectors) from Raw Flux (151395 flux in 403.42ms) T51.1: IBM MFM (18/18 sectors) from Raw Flux (151379 flux in 403.44ms) T52.0: IBM MFM (18/18 sectors) from Raw Flux (151386 flux in 403.35ms) T52.1: IBM MFM (18/18 sectors) from Raw Flux (151350 flux in 403.42ms) T53.0: IBM MFM (18/18 sectors) from Raw Flux (151346 flux in 403.36ms) T53.1: IBM MFM (18/18 sectors) from Raw Flux (151313 flux in 403.35ms) T54.0: IBM MFM (18/18 sectors) from Raw Flux (151394 flux in 403.39ms) T54.1: IBM MFM (18/18 sectors) from Raw Flux (151350 flux in 403.36ms) T55.0: IBM MFM (18/18 sectors) from Raw Flux (151385 flux in 403.37ms) T55.1: IBM MFM (18/18 sectors) from Raw Flux (151349 flux in 403.36ms) T56.0: IBM MFM (18/18 sectors) from Raw Flux (151436 flux in 403.33ms) T56.1: IBM MFM (18/18 sectors) from Raw Flux (151397 flux in 403.44ms) T57.0: IBM MFM (18/18 sectors) from Raw Flux (151378 flux in 403.38ms) T57.1: IBM MFM (18/18 sectors) from Raw Flux (151349 flux in 403.37ms) T58.0: IBM MFM (18/18 sectors) from Raw Flux (151392 flux in 403.40ms) T58.1: IBM MFM (18/18 sectors) from Raw Flux (151356 flux in 403.38ms) T59.0: IBM MFM (18/18 sectors) from Raw Flux (151392 flux in 403.29ms) T59.1: IBM MFM (18/18 sectors) from Raw Flux (151352 flux in 403.36ms) T60.0: IBM MFM (18/18 sectors) from Raw Flux (151430 flux in 403.38ms) T60.1: IBM MFM (18/18 sectors) from Raw Flux (151393 flux in 403.40ms) T61.0: IBM MFM (18/18 sectors) from Raw Flux (151388 flux in 403.31ms) T61.1: IBM MFM (18/18 sectors) from Raw Flux (151356 flux in 403.40ms) T62.0: IBM MFM (18/18 sectors) from Raw Flux (151430 flux in 403.39ms) T62.1: IBM MFM (18/18 sectors) from Raw Flux (151398 flux in 403.39ms) T63.0: IBM MFM (18/18 sectors) from Raw Flux (151434 flux in 403.42ms) T63.1: IBM MFM (18/18 sectors) from Raw Flux (151390 flux in 403.38ms) T64.0: IBM MFM (18/18 sectors) from Raw Flux (151433 flux in 403.43ms) T64.1: IBM MFM (18/18 sectors) from Raw Flux (151394 flux in 403.42ms) T65.0: IBM MFM (18/18 sectors) from Raw Flux (151382 flux in 403.37ms) T65.1: IBM MFM (18/18 sectors) from Raw Flux (151354 flux in 403.40ms) T66.0: IBM MFM (18/18 sectors) from Raw Flux (151406 flux in 403.37ms) T66.1: IBM MFM (18/18 sectors) from Raw Flux (151363 flux in 403.41ms) T67.0: IBM MFM (18/18 sectors) from Raw Flux (151389 flux in 403.39ms) T67.1: IBM MFM (18/18 sectors) from Raw Flux (151360 flux in 403.38ms) T68.0: IBM MFM (18/18 sectors) from Raw Flux (151394 flux in 403.44ms) T68.1: IBM MFM (18/18 sectors) from Raw Flux (151344 flux in 403.44ms) T69.0: IBM MFM (18/18 sectors) from Raw Flux (151352 flux in 403.44ms) T69.1: IBM MFM (18/18 sectors) from Raw Flux (151321 flux in 403.40ms) T70.0: IBM MFM (18/18 sectors) from Raw Flux (151390 flux in 403.39ms) T70.1: IBM MFM (18/18 sectors) from Raw Flux (151352 flux in 403.40ms) T71.0: IBM MFM (18/18 sectors) from Raw Flux (151380 flux in 403.33ms) T71.1: IBM MFM (18/18 sectors) from Raw Flux (151355 flux in 403.43ms) T72.0: IBM MFM (18/18 sectors) from Raw Flux (151390 flux in 403.36ms) T72.1: IBM MFM (18/18 sectors) from Raw Flux (151355 flux in 403.37ms) T73.0: IBM MFM (18/18 sectors) from Raw Flux (151368 flux in 403.39ms) T73.1: IBM MFM (18/18 sectors) from Raw Flux (151322 flux in 403.40ms) T74.0: IBM MFM (18/18 sectors) from Raw Flux (151352 flux in 403.44ms) T74.1: IBM MFM (18/18 sectors) from Raw Flux (151324 flux in 403.43ms) T75.0: IBM MFM (18/18 sectors) from Raw Flux (151356 flux in 403.35ms) T75.1: IBM MFM (18/18 sectors) from Raw Flux (151316 flux in 403.31ms) T76.0: IBM MFM (18/18 sectors) from Raw Flux (151390 flux in 403.43ms) T76.1: IBM MFM (18/18 sectors) from Raw Flux (151349 flux in 403.35ms) T77.0: IBM MFM (18/18 sectors) from Raw Flux (151340 flux in 403.38ms) T77.1: IBM MFM (18/18 sectors) from Raw Flux (151314 flux in 403.33ms) T78.0: IBM MFM (18/18 sectors) from Raw Flux (151374 flux in 403.41ms) T78.1: IBM MFM (18/18 sectors) from Raw Flux (151366 flux in 403.39ms) T79.0: IBM MFM (18/18 sectors) from Raw Flux (151394 flux in 403.40ms) T79.1: IBM MFM (18/18 sectors) from Raw Flux (151352 flux in 403.42ms) Cyl-> 0 1 2 3 4 5 6 7 H. S: 01234567890123456789012345678901234567890123456789012345678901234567890123456789 0. 0: ................................................................................ 0. 1: ................................................................................ 0. 2: ................................................................................ 0. 3: ................................................................................ 0. 4: ................................................................................ 0. 5: ................................................................................ 0. 6: ................................................................................ 0. 7: ................................................................................ 0. 8: ................................................................................ 0. 9: ................................................................................ 0.10: ................................................................................ 0.11: ................................................................................ 0.12: ................................................................................ 0.13: ................................................................................ 0.14: X............................................................................... 0.15: ................................................................................ 0.16: ................................................................................ 0.17: ................................................................................ 1. 0: ................................................................................ 1. 1: ................................................................................ 1. 2: ................................................................................ 1. 3: ................................................................................ 1. 4: ................................................................................ 1. 5: ................................................................................ 1. 6: ................................................................................ 1. 7: ................................................................................ 1. 8: ................................................................................ 1. 9: ................................................................................ 1.10: ................................................................................ 1.11: ................................................................................ 1.12: ................................................................................ 1.13: ................................................................................ 1.14: ................................................................................ 1.15: ................................................................................ 1.16: ................................................................................ 1.17: ................................................................................ Found 2879 sectors of 2880 (99%) H:\Element14\Adafruit_Floppy\greaseweazle-1.8-win\greaseweazle-1.8>
It took about 400 mS to read a track and it had to re-read a few tracks, so the process took the better part of a minute. It ended up with 1 missing sector out of 2880, so I'd consider that a relative success (not sure of the integrity of the original floppy).
The IMG file is a 'byte for byte' disk image which Windows does not natively handle, but it turns out that the 7-Zip archive utility can read the FAT12 format images.
Here are the contents of the output.img file viewed using 7-Zip:
The floppy contains drafts of a high school English assignment done by my younger son back in 2002. I guess I had been sorting through unlabeled floppies back in 2018 and left this one in the computer drive. I verified that I could open these files in Microsoft Word, but I won't share the contents for obvious reasons.
So, a fun project for Pi Day.
Happy Pi Day 2023!!
As a bonus, I put a message on the TFT display that is piggybacked on a Pi Pico.