Author Topic: Floppy Disk Eraser  (Read 30887 times)

FyberOptic

  • King of Earth
  • Administrator
  • Hero Member
  • *****
  • Posts: 2522
  • Oh god what is that?
    • Fybertech.com
Floppy Disk Eraser
« on: March 29, 2010, 02:04:29 pm »
So, floppy drives have always been an item of interest to me. My ultimate goal is to read a 1.44MB floppy's contents using my own homebrew floppy controller. I haven't reached that point just yet, since I still have to create a PLL to keep in sync with the bit stream, not to mention decode the MFM, neither of which I've done before. But I did think up something recently which doesn't require that level of complication, and might actually be useful. And that's a floppy disk eraser! It came to mind when I found a ton of old floppy disks that I needed to erase.

To do it, I interfaced with the parallel port of the PC for now. That's definitely not fast enough to read or write to the floppy, but it's fine for controlling the signals to manipulate the heads and motor. I connected with 7 signals: the track 0 detection, drive select, motor enable, step direction, write enable, and head select. All are outputs except the track 0 detect, which you use to know when you've pulled the heads back all the way. The basic procedure is: select the drive, enable the motor, pull the head back to track 0, then for the next 80 tracks you activate the write head for both sides of the disk, waiting long enough for one rotation for each erase, then step the head to the next track. After doing that multiple times to cover the entire disk, you drag the head back to track 0, then deselect the drive.

Here's a boring Youtube video doing basically what floppy drives always do:

[youtube]http://www.youtube.com/watch?v=-r3ieR6LStY[/youtube]

The reason this works to erase the disk, despite not sending it any data, is because activating the write-enable line also enables the erase head. It's like writing lots of 0s to the disk, pretty much. Even the floppy controller in a PC can't make the disk this blank to my knowledge, because during a format it's writing track information back to the disk. We just leave the write data pin disconnected, and since the drive uses TTL logic, it should float "high" automatically. All the floppy signals are inverted, so that makes the data write pin indicate binary "0" all the time.

In the end, and after some math, I realized that it's not as fast as I had hoped. I found that it's probably about the same speed as ripping a floppy disk image on the PC, since there's a finite period of time required for the actual rotations to occur, so that the head can pass over the entire media. At 300rpm, that's 5 rotations a second, meaning a minimum of 200ms needed for each rotation. And you have to do this for both sides of the disk for each track. So even if you don't account for the time it takes to step and everything, the bare minimum time of erasure would be 32 seconds. Though I suppose if one didn't mind messing up the drive, you could make it spin faster!

For powering this particular drive, which requires both 12v and 5v, I used an external hard drive power supply, which has a standard molex connector. I rigged up a male connector onto the end of a string of connectors from an old dead power supply, which gave me the floppy power connector I needed.




I only took one photo, and this was from before I switched cables to one that didn't keep falling apart on me:




Lastly, here's the C code I wrote to make it happen.  It requires the inpout32.dll DLL for interfacing with the parallel port.  floppyclear.c


I might still interface this with a basic microcontroller sometime, then just add a pushbutton. Then you get a standalone floppy eraser. But you'd probably want to use one of the smaller 5v-only drives, like what they use in laptops, so that you'd only need one voltage rail to power the entire device.

So yeah, a simple little project. Might be a good learning experience for anyone wanting to understand the interface of floppy drives.  I would go into more detail on how they work in general, but I'll save that for another time!
« Last Edit: March 29, 2010, 02:10:41 pm by FyberOptic »