Saturday, March 11, 2017

Floppy failure

I continued my analysis of the power section of my Canon P170-DH calculator today, and recorded a series of oscilloscope screen-shots on floppy disk to document it. But when I tried to read the floppy, my USB floppy reader said the disk was corrupt. Bummer.

So I slid a new, unused floppy into the 'scope. It said the floppy was unformatted. What the...? Ok, format it! Format failure. I then tried to format another new one in my USB floppy reader, which refused. I even tried installing a real floppy drive in my Windoze machine, and that refused. Suddenly none of my floppy drives will read or write ANY of my floppy disks.

Has there been a global floppy disk failure? Sheesh!

What to do... what to do...

The 'scope will also talk GPIB so I looked for a GPIB-to-USB adapter, only to find they're well over $100. How about GPIB-to-Ethernet? Even more, except I found one on eBay for less than $100. Great! But then I noticed a serial port on the back of the 'scope next to the GPIB port. I wonder...

I dug up the manuals for the 'scope online and discovered you can do via the serial port just about anything you can do through the GPIB. You can even configure the 'scope to send "hardcopy" through the serial port in my preferred TIFF image format. Only problem is it's kinda hard to figure out where the end of an image is.

I dumped a few images and examined the results. TIFFs are binary, so any individual character could show up in the byte stream, but all the files sent across the serial link end with a three byte sequence LF-CR-LF. That seems like it'd be reasonably rare. So I wrote a quick-and-dirty program to monitor the serial port. When it sees the TIFF byte-order flag "MM" that starts each image it creates a new file. It then transfers the data byte-by-byte until it sees the LF-CR-LF sequence and closes the file.

Feeding it the files I captured earlier gives identical results, which make me happy. Doing a direct capture is faster than I expected, taking only a few seconds. I always think of serial as slow (and it is), but when you're transferring a 39,728 byte file over a 115,200 bps link, it should take under 4 seconds.

Here's the image currently on my 'scope screen. It shows the three outputs of the non-filament secondary winding of the pulse transformer against the negative end of the primary winding at the bottom.


Now I can stop screwing around with floppy disks!

No comments:

Post a Comment