Howdy folks. I've been looking into how floppy drives work again, interested in tinkering with them myself for fun in projects, but have some questions. I also wouldn't mind some confirmations/corrections of my info by folks who actually know about this stuff, unlike myself!
My basis for all of this is on the 1.44MB floppy for the moment, so correct me where necessary:
- Spins at 300RPM, therefore 5 rotations per second, or 200ms per rotation
- 500kbit/s data rate, therefore 2us per data bit
- Since MFM encoding is two physical bits per data bit, encoded rate would be 1000kbit/s, 1us per bit
- Since 1 rotation is 1/5 of a second, and the data rate is 500kbit/s, that would be roughly 100,000 data bits per track?
- At 100,000 data bits per track, that'd make a 1.44MB floppy capable of 2,000,000 data bytes (which sounds right?)
Now, even assuming this is correct, I have questions on implementation.
At 1us per MFM encoding bit, you'd need a clock capable of 1mhz to read the bits fast enough, right? But even so, I have a feeling that there would be sync problems, and have heard that a PLL is required for reading disks like this. PLLs are still a bit out of my league at the moment, but I always learn such things as I go along, so I might could figure it out if push comes to shove. If you had a PLL, I assume the clock would need to be much higher to be able to match up with the data rate from the floppy. I thought that an alternative might be some kind of a software-based PLL, if you had a microcontroller running fast enough in comparison.
What about writing to disks, though? I mean if you're reading from them, you usually have all the sync bits to help you align your clock with the PLL. But how would you align it with the disk rotation speed if the disk was totally blank, with nothing like that to sync by? Would the sync of the PLL also be tied in with the passing of the index hole of the disk?
What is the actual physical procedure of reading and writing to a floppy? I'm assuming that as long as the disk is in the drive and the motor is spinning, that the data line is constantly spitting out bits. What about writing? Do you pull the /wgate (?) signal to 0v, and then immediately start spewing encoded bits into the write pin? And by spewing bits, I mean toggling the pin high and low, since as far as I understand, it doesn't matter if it's physically high or low at any particular moment, it's the transition between the two that counts when reading/writing the floppy.
Are there any delay times you'd have to take into consideration, in regards to like how soon you triggered to write and the time you started sending out the data? Seems like it would be very hard to write into an individual track at a particular spot during a random write, considering how fast the disk is spinning and how close the bits are.
I also understand that you can't put too many bit transitions on the disk too close to one another, or they would create too large of a magnetic field in one area. Hence the need for encoding, such as with MFM. If you did this to every track on the whole disk though, would the magnetic field be noticeable? Like if you held a piece of metal near it?
I'm also curious if anyone knows where there are any technical documents on floppy disks/drives, PC floppy disk layout (the gaps and header and sync and all that), MFM encoding, etc. I'm having a hard time finding such things.
My reasons for messing with floppies ranges from simply learning, to using them for a fun way of storage in microcontroller projects, to being able to read in other older floppy disks for computers of which the drives have long since failed (like my Atari 800 drive). I just find tinkering with this kind of stuff to be more fun in many respects than Flash memory and SD cards. Probably because I grew up messing with it all.
Anyhow, I think that's all I meant to ask for now. I would very much appreciate any info and/or confirmations anyone can provide!