correctly reading an entire track reliably from PC drive

OK Great news.  As I stumbled on in the last post:

I’ve fixed my reading issues, and I’m now reliably reading, in one shot, an entire amiga track from the unmodified standard PC drive!!

When seeing double 1’s earlier, I had the extra second 1 basically thrown out.  I didn’t process anything, but just ignored it.  Because I assumed I was simply detecting the 1 TWICE, I thought this made sense.  However, this detection of back to back ones MUST HAVE BEEN a “10” detected as “11”.  I changed the code to write a “10” when it sees a “11” and now it reads every track perfectly!!

This is really an exception issue and if you recall, I was getting like a small percentage of bad bytes.  I just re-ran the new track data through the MFMSanityCheck program I wrote and I get 0 bad bytes!!  This means everything is perfect MFM!!

About the author

keith

Amateur Electronics Design Engineer and Hacker

6 Comments

  • Thanks.

    I’ve tested several different disks, both my test disks, and a real floppy. No problem retrieving an entire track on any disk. All checksums match perfectly.

    I still think there is a minor timing issue that is causing these spurious bits, but because it’s the exception (in some cases, just one bad bit out of a sector, maybe 5 bad bits a whole track) I’m just not horribly concerned about tracking it down. And the detection of the problem is easy and reliable, and the fix is simple.

    If it ain’t broke, don’t fix it! 🙂

  • Besides, old floppy can be unstable, quite enough to introduce a couple of error bits. So reading track one more time to let the error float away seems to be all right.

  • I’m not sure I understood you.

    What do you mean by “. So reading track one more time to let the error float away seems to be all right.” ???

    I only need to read each track exactly once to get a good copy of it. Now, if it doesn’t pass checksum, then, of course, I can re-read it.

    The 5 or 6 bad bits no longer occur since I’ve fixed the code. So everything comes out perfect now.

    Is this what you meant?

  • What I wanted to say was that it could be old/worn floppy’s fault that sometimes wrong bits have been read within the track. Of course, this is not the case with ‘good’ floppies.

  • ahhh, ok. Sure.

    I am looking forward to writing some code that will read bad disks or shaky disks that can’t normally be read within the amiga.

    As you know, MFM has some inherent structure to it, and this structure allows us to guess or predict a bit. First thing, clock bits don’t matter. While they serve the important purpose of keeping things in sync, once we’ve read them, they get masked away.

    Next, clock bits are put down in a particular manner based on what bits are next to them. We know, for instance, that the a “1” clock bit is never placed next to a 1 data bit. This single clock bit tells us the values of the data bits on either side of it.

    There are only 32 different possible bytes that can be formed by properly output MFM data, so a single-bit error might be fixable.

    In any event, we always have the checksums (unless they are corrupt) to tell us if we’ve got it right. Now if there are multiple bits, I think the checksums are too weak to help, in some cases.

    Anyways, further down the road, I really want to explore the possibilities. I think this work might become more and more important as more floppies start to fail.