Greaseweasel USB Floppy Interface

Discussion in 'Retro & Arcade' started by Flamin Joe, Dec 4, 2019.

  1. Flamin Joe

    Flamin Joe Member

    Joined:
    Jun 28, 2001
    Messages:
    4,383
    Location:
    4300
    Hi all. I've mentioned in a few threads about a project created by Keir Fraser, the same developer who created Flashfloppy (an open source firmware for the Gotek USB Floppy drive) and that is Greaseweasel. Basically it allows you to access a floppy drive at the flux level using a USB interface which then allows you to read/write many different formats all on a standard PC floppy drive. You can read more about it below.

    https://github.com/keirf/Greaseweazle
    https://www.facebook.com/groups/greaseweazle/

    The purpose of this thread is that I thought I would let the wider retro OCAU know about this and also let people know that I am doing a limited run of interface PCB's which I'm making available here. Basically what the interface PCB does is turn the mess of cables between the STM32 Blue Pill into a nice and neat solution like below (not my photos).

    https://github.com/keirf/PCB-Projects/tree/master/greaseweazle

    76697456_826844574418275_2213782330844119040_n.jpg 74229551_10157796527339122_6917536951855742976_o.jpg

    It should be noted that this is just the first revision of the Greaseweasel and the developer is currently in the process of creating an all in one solution which uses the STM32F7 vs the current STM32F1. But he has assured the firmware will be compatible with both so development will continue.

    What I will supply:

    Currently I'm awaiting the arrival of 6 PCB's (one for myself making 5 available) which I've ordered from OSHpark and is currently on it's way via snail mail. I'm also getting together a few of the other little parts required such as the floppy header so I'll include:
    • Greaseweazel PCB Interface
    • 34 Pin Floppy Header
    • Floppy Power Header*
    • Molex to floppy power adapter
    • 4 x 0805 1k SMD Resistors**
    • 1 x 0805 1.5k SMD Resistor**
    • 40 pin DIP socket
    * It should be noted that not all 3.5" floppy drives are capable of running on just 5 volts supplied by the USB and may require an external power source. I've ordered one of these for myself and I'll include a molex to floppy adapter as seen here if you plan to do this. I had plenty of them spare at work so they didn't cost anything. Personally I would recommend going down this route.

    5.25" Floppy Drives will require external power.

    ** I'll throw in a couple of spare SMD resistors to allow for errors. Also it should be noted that the 1.5K Resistor is not needed if your Blue Pill has the same resistor at R10 on the PCB. Not all Blue Pills out there have the correct resistor installed.

    What you will need:
    • STM32 "Blue Pill" *
    • USB to TLL Adapter (for the intial programming)
    • Floppy Drive
    • 12V/5V 2A Molex Power Supply Adapter (optional but recommended)
    * Like it seems with everything these days, be on the lookout for fake STM32's which use a Chinese clone of the STM32F103C8 chip. There is a guide here on what to look for. I brought mine from this seller which while is probably a Chinese clone of the Blue Pill (others have found the same one on AliExpress), it uses the correct chip and has the 1.5K resistor at R10.

    Cost:

    I'm not planning on making any money on this just looking to offload what I don't need which in turn makes it cheaper for you and me. All up it should be $20.00 including postage. To give you an idea of savings just the making of the 6 x PCB's (mininum order) alone cost me about $31 after conversion from USD, then you've got to add all the other bits and pieces which often have minimum order quantities too.

    Let me know if you are interested, first in first serve. Once these are gone that's it!

    If all goes to plan hopefully these will arrive in time for me to ship them all out to arrive before Christmas as I think they will be a cool little project to do over the Christmas/New Year break. :)

    I think that's just about everything, let me know if you have any questions or if I've missed anything. But again, check out the Facebook page as there are a lot of very knowledgable guys on there who usually respond very quickly to questions.
     

    Attached Files:

    Last edited: Dec 4, 2019
    JSmithDTV, adz, Phido and 3 others like this.
  2. elvis

    elvis Old school old fool

    Joined:
    Jun 27, 2001
    Messages:
    39,282
    Location:
    Brisbane
    I'm in! I've been eyeballing this project for a while (in the process of attempting to read 100+ 3.5" floppies from my SNES backup unit, and some are in bad shape).
     
    Flamin Joe likes this.
  3. OP
    OP
    Flamin Joe

    Flamin Joe Member

    Joined:
    Jun 28, 2001
    Messages:
    4,383
    Location:
    4300
    I realised after I posted this that I overlooked one part and that's the Single In Line socket to connect the PCB to the Blue Pill. Whoops. :) All good I've got some 40 pin DIP sockets which will do the trick.

    Noted. :thumbup:
     
    elvis likes this.
  4. OP
    OP
    Flamin Joe

    Flamin Joe Member

    Joined:
    Jun 28, 2001
    Messages:
    4,383
    Location:
    4300
    It feels like it's been forever but the Greaseweazel PCB's are FINALLY here!

    20191218_202013.jpg

    Took longer than expected but the extra time allowed me to source some better connectors to connect the STM32 to the PCB adapter instead of using the 40 pin DIP sockets which in hindsight would of been unsuitable. There is very little clearance between the one of the 20 pin rows and where the SMD resistors are soldered.

    20191218_203254.jpg

    Here's everything ready to go. Like I said I'll include extra SMD's as as I know how fiddly they are just in case some get lost/damaged etc. I'll include 3 x 1.5K resistors (you might not even need one depending on the STM32 Blue Pill you buy) and 6 x 1k resistors when you only need 4.

    One thing to note is the power connector for the floppy. I went based off what someone else had done with the intention of making up a cable using a couple of the molex to floppy adapters I had so it had floppy power on each end. But after running into issues powering some 3.5" floppies off the Greaseweasel PCB adapter which is just 5v from the USB, I went with the 12V/5V 2A Molex Power Supply Adapter which is a much better option. The power adapter included can then be used so it can power either a 5.25" or 3.5" floppy drive.

    I'll include the power connector anyway just in case but if you are still intent on using the supplied power from the board it would be a better idea just to cut the Molex connector off and solder it directly to the board.

    Price is the same just the $20 including postage and I'll get these out asap but it will probably be too late to beat Christmas unless your close by.

    elvis, PM incoming.

    That leaves just 4 available.
     
    elvis likes this.
  5. elvis

    elvis Old school old fool

    Joined:
    Jun 27, 2001
    Messages:
    39,282
    Location:
    Brisbane
    Woo can't wait to play with this!
     
    Flamin Joe likes this.
  6. OP
    OP
    Flamin Joe

    Flamin Joe Member

    Joined:
    Jun 28, 2001
    Messages:
    4,383
    Location:
    4300
    Just the 2 available now. Another one sold and the other I've decided to keep for myself to do up a second.

    Probably the last chance to get it before Christmas if I ship it by Monday and your within the Express Post next day delivery network.
     
  7. Vanne

    Vanne Member

    Joined:
    Apr 20, 2003
    Messages:
    1,105
    Awesome!! love what your making here :D
     
  8. elvis

    elvis Old school old fool

    Joined:
    Jun 27, 2001
    Messages:
    39,282
    Location:
    Brisbane
    Got my stuff all sorted
    IMG_20191230_173413_823.jpg

    Had to get out my old man spectacles to do these little buggers

    IMG_20191230_174234_073.jpg

    Much swearing when my Arduino failed, but it turned out to be a VERY dirty board from the seller. A quick test found two ground shorts, and a bath in isopropyl and some scrubbing later, and it powered up and took the flash like a champ.

    Software testing scheduled for tomorrow!
     
    Vanne and Flamin Joe like this.
  9. elvis

    elvis Old school old fool

    Joined:
    Jun 27, 2001
    Messages:
    39,282
    Location:
    Brisbane
    It's alive!

    Couldn't work out what was going on at first when I tried to power the device via the 5V floppy header. Seemed to short when connected to USB.

    So I've got a PC power supply rigged to power the floppy (total overkill, but it's all I've got lying around at the moment). And the Ardiuno itself happily runs from USB power.

    Greaseweazle dumps the flux images to "SCP" format which float around 75-85MB each depending on the disk and the read. "disk-analyser" then converts these to something else. At first I had a bad dump, and the 1.6MB Super Wildcard DX (SNES disk copier) format didn't work (produced bad files). Then I redumped and got a better file, and figured out how to tell disk-analyser to not assume all 1.6MB files are Amiga format files.

    Lo and behold, I have usable data!

    Now onto the arduous grind of going through 300+ floppies one by one, flux reading, converting, extracting the files, joining the split SNES ROMs, stripping the headers, then comparing the checksums against know databases (GoodTools, No-Intro, Smokemonster, etc), and then trying to figure out what's a known dump, what's a new one, and what's just a bad dump from a dodgy Taiwanese pirate floppy seller in the 90s. :)

    gw.jpg
     
    Flamin Joe likes this.
  10. OP
    OP
    Flamin Joe

    Flamin Joe Member

    Joined:
    Jun 28, 2001
    Messages:
    4,383
    Location:
    4300
    This is why I was recommending using an external power supply. I had all sorts of troubles getting it to power floppy drives correctly using just the 5v supplied by USB. Supposedly there are 3.5" drives which only need 5v (which makes sense considering 3.5" USB Floppy drives exist) but of the half a dozen drives I have all being either different models or manufacturers, none of them would work properly with just 5v connected.

    This is the best solution I could find other than hooking up a power supply for the job. It's cheap and the build quality is questionable but it does the job required. Regarding the build quality, notice in the photo below the Ground pin appears to be missing. It's not it's just covered by a plastic cover which it seems they neglected to remove during manufacturing.

    https://www.ebay.com.au/itm/1pcs-12...ter-HDD-Hard-Disk-CD-ROM-AC-DC-A/143447306619

    s-l1600 (1).jpg

    Just an FYI, if anyone else is interested in one (I still have 2 left), I'm not going to be able to send any next week. I'm heading down to Adelaide to visit family this Friday and won't be back until the 11th.
     
  11. elvis

    elvis Old school old fool

    Joined:
    Jun 27, 2001
    Messages:
    39,282
    Location:
    Brisbane
    Sorry, I don't think I was clear. My issue was initially if I used the PSU molex connector on the Greaseweazle, it wouldn't power up via the 5V heder from that (despite it being connected to the 5V pin on the Arduino).

    If I plug my TTL cable's 5V pin into the Arduino 5V pin, everything is fine and it powers up. USB also powers the Arduino fine too.

    And oddly this morning, as I powered up the device to remind myself where the problems were, it seems to be fine. So odd. Ah well, it's working regardless, and I'm very happy. At some point I'm going to find a small PC case I can bang my 3.5" drive in, with space for a 5.25" if I ever get it, and a PSU, and attach a carry handle to the top for portability.

    If anyone has a large floppy collection for any platform, whether it's 3.5" or 5.25", whether it's regular old IBM/PC/MS DOS or Amiga/AtariST/C64/whatever, do yourself a favour and get one of these. If you compare other commercial solutions like the KryoFlux, you're looking at AU$ 160 just for the board alone, and then you have to deal with their STUPID licensing that restricts how you release the images you dump for yourself (unless you pay for the ridiculous commercial/archivist license).

    [edit]
    More options here. Again, the pricing on these are all ludicrous: https://www.archiveteam.org/index.php?title=Rescuing_Floppy_Disks
    [/edit]

    As mentioned in the OP, this is the same author as the FlashFloppy firmware (the extended/advanced firmware for the Gotek floppy emulator). This guy knows his stuff, and the projects are getting plenty of attention from folks who do a lot of floppy imaging (regular contributors to archive.org). I've been waiting a long time for a floppy flux reader at this price point for non-Apple hardware, and this is exactly what I was after.
     
    Last edited: Jan 1, 2020
    Flamin Joe likes this.
  12. Reaper

    Reaper Member

    Joined:
    Jun 27, 2001
    Messages:
    11,626
    Location:
    Brisbane, Qld, Australia
    So, why? I do have a large floppy collection, why do I need this? I get it reads floppy discs, however what makes it special? How is it different to just using say, winimage? Will it be able to read discs that are "unreadable"?
     
  13. elvis

    elvis Old school old fool

    Joined:
    Jun 27, 2001
    Messages:
    39,282
    Location:
    Brisbane
    Good questions. And yes, it's very different to WinImage. Here's why:

    Most imaging programs are slave to the floppy controller. Less so in DOS (tools like VGACOPY, for example, could do better retries on bad sectors). But especially in Windows, you have almost no control over what the floppy drive is actually doing.

    Magnetic media, including cassette tapes and floppy disks, use magnetic flux to essentially draw patterns on their surfaces. These patterns are chosen by whatever encoding pattern is established for that medium. For example, 3.5" high density floppies on IBM compatible PC hardware went with MFM, however there are dozens of different encoding techniques.

    Another example is an unrelated project of mine - taking Sega SC-3000 tape images and "remastering" them to perfect digital information. For example, here's a Sega SC-3000 game audio cassette wave form (top to bottom is remastered zoomed out, original zoomed out, remastered zoomed in, original zoomed in):

    [​IMG]

    In both the zoomed out (top two waveforms) and zoomed in (bottom two waveforms), you can see the original analogue recording on the bottom (almost sinusoidal wavy line), and the remastered digital version above (nice square wave). Notice especially the amplitude of the analogue waveform. It should reach 1.0 like the digital one, but never does. This is analogue media dying - the magnetic flux becoming unreadable over years and years.

    Most software / hardware combinations you get conform to an agreed standard. And that's fine as long as the magnetic flux is strong enough to be read, and you have the exact combination of hardware and software to read it.

    However, floppy drives are interesting in that they're quite raw - there's no controller on them. They just read the magnetic flux raw, and pass it on to a controller. Again, you and I have almost no control over this. Your floppy controller on your motherboard or whatever USB connected drive you have does the reading. If it's configured for a certain amplitude of magnetic flux, and a certain speed and amount of retries, and it can't read the data on your floppy, then tough luck.

    Tools like Greaseweazle, Applesauce and others go deeper. They're literally flux readers - they are a programmable controller allowing you to read the magnetic surface of the disk directly, bypassing any proprietary controllers and chips. Greaseweazle itself can't even read "data" off a floppy! You get a finely sampled dump of the magnetic flux - often 80MB or so in size (think like a higher sample rate in audio - going from 11KHz to 22Khz to 44Khz to 48KHz, producing a more accurate but larger file each time). From there you can run other tools (the Greaseweazle author provides a "Disk-Utils" package, including a command line "disk-analyse" program that can read hundreds of disk formats) over the magnetic flux image to interpret and extract the data.

    Why does this matter? A few reasons:

    * Copy protection - certain computers (Amiga, Apple II, etc) bake clever copy protection in to disks by doing weird things with the formats that allow disks to be read, but not written. Magnetic flux reading (and writing back to a new disk) bypasses this protection all together, meaning you don't have to "crack" a game to copy it. Better yet, you can write the flux image back to another real floppy perfectly, INCLUDING the original copy protection!

    * Failing media - again, see the Sega audio cassette wave forms above. On an audio cassette we can easily play with the amplitude (i.e.: turn the volume/amplification up). Although that raises the floor as well, so I often have to do additional post-processing to make the data readable on either a real SC-3000 or an emulator). With a Greaseweazle, you have full control over everything from the motor stepper speed and delay, rotation speed an delay, number of rotations to sample per read, etc. With disk-analyse you can set your period, phase and amplitude parameters to be more or less aggressive in how they interpret data. Media that absolutely refuses to read on a regular PC can very frequently be imaged and restored using these tools.

    * Mismatching hardware isn't a problem - If the physical form factor fits into the drive and can connect via a standard Shugart bus, then Greaseweazle can drive it and read/write floppies. So say you've got a box of Amiga or C64 floppies, and you want to image them on a modern PC that has nothing but USB ports, then tools like these can do it for you. No need to hook up your "real hardware" just to image the disks. Likewise if your original machine's disk drive blows up, for ~$40-ish in parts and cables you can read your entire collection and image them to then load in via new SD-card style or Gotek loaders available for most retro hardware.

    * Weird formats aren't a problem. My Super Wildcard DX SNES Disk Copier formats a high density floppy past the traditional 80 track / 18 sectors-per-track (1.44MB) to 80 tracks / 20 sectors-per-track (1.6MB). This can then squeeze 12mbit on a floppy instead of the usual 10mbit, which means a 24mbit game (common on SNES) could be squeezed on 2 floppies instead of 3. But, do you think I can read a 1.6MB formatted floppy disk on a regular laptop or USB floppy drive under Windows or Linux? Hell no. The only way I can do that is to set up a big clunky DOS machine with VGA copy, but again, I have no hope of reading failing disks. Greaseweazle doesn't care about any of that, and disk-analyse interprets it all without fault.

    * Preservation - the big one. When you take a flux level image, you are taking a sample of the disk at the lowest possible level. That's why you end up with an 80MB+ image even though there's only in the range of 500KB-2MB of data on the disk. Best of all, if new techniques are discovered to better decode the disk contents (including reading copy protection), your flux level image is always valid. Consider the "no intro" efforts that people have had to go to to manually remove obnoxious crack screens and "scene greetz" from egotistical pirates distributing cracked software. Now data can be preserved exactly without all that crap, and even if it can't be interpreted today, the flux level image is safe and can be analysed at our leisure into the future without needing to re-read the floppy.
     
    Last edited: Jan 1, 2020
    Pierre32, kombiman, power and 6 others like this.
  14. Reaper

    Reaper Member

    Joined:
    Jun 27, 2001
    Messages:
    11,626
    Location:
    Brisbane, Qld, Australia
    That was a great explanation and brought back lots of information I'd just plumb forgotten. I've decided that I do indeed need one of these. :)
     
    Flamin Joe and elvis like this.
  15. OP
    OP
    Flamin Joe

    Flamin Joe Member

    Joined:
    Jun 28, 2001
    Messages:
    4,383
    Location:
    4300
    Last one sold pending payment.
     
    Last edited: Jan 1, 2020
  16. Vanne

    Vanne Member

    Joined:
    Apr 20, 2003
    Messages:
    1,105
    This is just like hardware burst nibbler... I'll take one if there are any left? :) or if you decide to do another batch in the future, pen me down for one.
     
  17. OP
    OP
    Flamin Joe

    Flamin Joe Member

    Joined:
    Jun 28, 2001
    Messages:
    4,383
    Location:
    4300
    Would love to help but at this stage the last one I have is sold pending getting payment. Will let you know if that falls through.

    If you go on the Greaseweazel Facebook group there is a guy in Sydney who just recently received a big batch of bare PCB's which he plans on selling sometime mid-January according to his post. It will however require sourcing all the other components yourself although I should still have all the other little bits and pieces you need spare.

    At this stage no plan to do another run of PCB's especially since the guy I mentioned above has a big stack to sell so there doesn't seem much point. Only really did this to get rid of an excess of PCB's and bits and pieces I didn't need and wanted some here in this awesome little community to benefit from it as well. :)
     
    Vanne likes this.
  18. elvis

    elvis Old school old fool

    Joined:
    Jun 27, 2001
    Messages:
    39,282
    Location:
    Brisbane
    Sort of. From what I can tell, the hardware burst nibbler does the analysis for you, and you end up with logical data in bytes. Greaseweazle allows you to do the flux sampling and decode to data bytes as separate steps (again, very useful in case there were errors on the disk, and you want to resample the flux image over and over without re-reading the floppy).

    For example, I had a couple of floppies that were in pretty bad shape. I can ask Greaseweazle to do multi-revolution reads, resulting in 200MB+ of flux sampling data for some samples. From there I can adjust the period and phase error rates on the interpretation of that same image to try and generate a logical image file that has formatted data. These all come out at 1.44MB with slightly different checksums. From there, I can extract the files from within that image and test their individual checksums to see if the internal CRC fixes bit flips and errors.

    This gives me higher confidence that the data I'm reading is digitally accurate, even if the analogue flux reads are slightly different on each sampling.

    Many thanks for me! You saved me a hell of a lot of time printing PCBs and sourcing little components, and the timing was perfect for my Christmas break. :)
     
    Last edited: Jan 2, 2020
    Phido and Flamin Joe like this.
  19. Nitephyre

    Nitephyre Member

    Joined:
    Mar 31, 2007
    Messages:
    1,504
    Location:
    ormeau@gc.qld.au
    Wow, even though I only have a slight idea of what this all is, your explanation was really interesting elvis!
     
    elvis likes this.
  20. Reaper

    Reaper Member

    Joined:
    Jun 27, 2001
    Messages:
    11,626
    Location:
    Brisbane, Qld, Australia
    Got the kit today, thanks for the included print out on how it goes together too. I may wait until I get the blue pill yet before assembling. Should be another week or two. In the meantime will think about how I'll do the drives and power. I may just rig it all into this desktop 286 I currently have right next to me. It already has a power supply and both types of floppies in it. Got some spare rear panel bracket usb connectors too..... yes. May rig something together here.
     
    elvis and Flamin Joe like this.

Share This Page

Advertisement: