Giter Club home page Giter Club logo

adafruit_floppy's Introduction

Adafruit Floppy

Build Status

Adafruit Floppy

This is a helper library to abstract away interfacing with floppy disk drives in a cross-platform and open source library.

Adafruit Floppy is a project to make a flexible, full-stack, open source hardware/software device for reading, archiving, accessing and duplicating floppy disk media. It joins a family of open source hardware and software such as greaseweazle and fluxengine, and increases the availability and accessibility of floppy disk controllers by:

  1. porting the greaseweazle / fluxengine firmware to Arduino so that it is less tied to specific hardware. this is important as, during 2021 we learned that silicon shortages can make specific chips extremely difficult to find - having a cross-platform firmware alleviates dependancies on specific chips.

  2. adding firmware support for the RP2040 chip / pico. this is an ultra low cost dev board, at $4 each - and can make for an excellent alternative to higher cost atmel/stm chips. (of course, the firmware should be able to run on many chips, but we want to make sure this is one of them!)

  3. adding hardware support for reading apple ii disks. many flux readers focus on 34-pin disk drives but do not have interfacing for apple disk ii drives. the drives are available and could be used for archiving a vast number of floppies out there! this will require adding an index sensor so we can image disks into 'woz' formats. currently, applesauce hardware and software can do this for apple ii disks - applesauce is amazing and an excellent tool and we recommend it to folks! at this time, it appears to be closed source hardware, firmware and software, so we are not able to integrate their design into an open source design.

  4. adding a2r support to fluxengine and writing an open source a2r to woz converter, which will benefit the entire community.

  5. as 'extra credit' we may look into analog flux data acquisition methods for repair of damaged disks.

Any hardware, firmware, or software we write is going to be fully open source under permissive licenses such as MIT, BSD or Unlicense. we will probably sell accessories, assembled PCBs, cables, etc in the Adafruit shop to help get hardware into folks hands but the designs will always be re-createable by others without any licensing agreements, NDAs, or discussion.

Currently we are focusing on high-RAM (> 128KB SRAM) and high speed (> 100MHz) processors, so that we can buffer a full track of flux transitions at once. Initial versions proved that this could be done with GPIO only, and no use of special peripherals. However, for the greatest timing accuracy we now use the timer peripheral on SAMD51 and the PIO peripheral on RP2040.

Tested working on:

  • SAMD51 chipset hardware - Overclock to 180MHz, select Fastest optimization, and use TinyUSB stack for best performance
  • RP2040 chipset hardware - Works with philhower core and TinyUSB stack. Overclock to 200MHz and select -O3 optimization for best performance

Follow our progress!

We have a full playlist on YouTube of our progress!, or check out some of these videos of the software at a very early stage of development:

click_click_click.mp4
part6_flux.mp4

Frequently Asked/Accused Questions

There's a LOT of preconceptions about floppy disks and how / why we have this library. Here are some answers!

  • How are you connecting a 3.3V logic microcontroller to a 5V Floppy Drive directly WITHOUT a level shifter, won't this destroy the board? Floppy drives are powered by 5V, and they use open drain outputs. That means that if the microcontroller pulls the index pin (for example) high to 3.3V, the logic level will be 3V. Is this out of spec? Maybe! But it does seem to work. Of course its always polite to use a level shifter, so if you can please add it to your hardware design. We do recommend a stronger external pullup on the READDATA line, 4.7K or so seems fine, other lines are fine with an internal pullup.
  • Did you know there are USB Floppy Drives for $10 on Amazon? Yes, we are aware. These are recycled laptop floppy drives with a controller chip that presents a mass storage interface to the sectors on disk. They are great for basic access to 1.44MB IBM PC MFM-formatted diskettes. They will not work for GCR formatted diskettes (we know because we tried) and may not work with non-FAT formatted diskettes (we don't have any but the controller chip is very specialized and may freak out). USB floppy drive controllers will not get you flux-level readings, and can't cope with damaged diskettes to read sector data that does not pass CRC to perform data recovery. They are also, of course, no good with 5.25" floppy diskettes.
  • Why do you need a flux level reading of disks??? Flux level readings are essential for data recovery, restoration, archiving of damaged or copy-protected floppies. You can read more about floppy disk preservation efforts here: https://wiki.archiveteam.org/index.php/Rescuing_Floppy_Disks

Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit!

MIT license, all text above must be included in any redistribution.

adafruit_floppy's People

Contributors

caternuson avatar hathach avatar jepler avatar ladyada avatar ptorrone avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

adafruit_floppy's Issues

Has gw been modified for this project ?

When using your arduino pico code I get the following error.
Arduino 1.8.16, macOS 10.15.7, Greaseweazle v0.31

$ ./gw read --device /dev/cu.usbmodem14101 xxx
ERROR: Greaseweazle firmware v1.0 is unsupported
To perform an Update:

  • Run "gw update" to install firmware v0.31

Brilliant piece of work (again).

Thank you
John Luke

Feature Request: Roland D-10/20/50 Support

There are people in the world that would like to have this available to pull their arrangements off of Roland's proprietary floppies. I have the schematics and pin outs. It is similar to the Apple II interfaces. I will contribute as much as possible if this is feasible.

multiple revolutions

It appears that specialty operations, such as using g64conv to convert the second side of a flippy disk from a two-sided .scp of the disk taken from the top side, may require operation similar to the genuine greaseweazel hardware: capture multiple revolutions without gaps.

the current implementation in this repo simply captures 3 different copies of the same track, from one falling index pulse to the next.

Making a change like this has a big impact on the structure of the code. A ping-pong buffer system could be adopted, so that flux is entering buffer A and then buffer B; once buffer A is filled, it can be transmitted over USB. Probably rp2040 is forced to go interrupt based to enable this, which we want to do anyway.

I don't have any proof that this is why my flippy-floppy dump didn't work; there are also g64conv bugs—with the geniune greaseweazel scp file, the directory data which should be on track 18 is on track 14 of the resulting g64 file! but it is intact. (track 18 sectors 0 and 1). By contrast, my rips with feather rp2040 to scp do not have track 18 sector 0, but do have track 18 sector 1 (again, transposed incorrectly to track 14 by g64conv). I know the flip side reads correctly because it happens to have two index windows and can be flipped in a standard PC 5.25 drive (teac).

Adafruit_Floppy VS original Greaseweasle compatibility

Hello!

I hope i didn't miss that information, but which version of original Greaseweasle FW is current 0.3 Adafruit_Floppy compatible with or is aiming to be compatible with?

I am currently struggling whether to pick Adafruit_Floppy as alternative to boot FW for my project, or use Pi Pico as passthrough in GW mode and let a BluePill to do the job.

I am more interested in writing disks than reading. Is Adafruit_floppy made mainly with reading disks in mind or both write/read capabilities are taken into account during developement?

Info on pi pico pinout and compiling.

I saw the video on the playlist describing how this firmware can be used with the pi pico however setting this up with this device is very minimal.
(https://youtu.be/hcgtolaM_6g)
The wiring to the pico is quite descriptive," start at GP2 and connect all the pins thru to GP14 in a row, skipping over the ground pads (dont forget to connect one of the grounds of course)" however I cannot properly figure out which pins interface directly with the floppy disk drive (and in addition 5.25 data connectors if compatible)
Perhaps the precompiled firmware for the feather rp2040 will be cross compatible with my pico but I don't know for sure until I have the ability to wire it to my disk drive. If that is not the case it'd be helpful to know how to set that image up.

Regards.

Feature suggestion: littleFS support?

https://hackaday.com/2019/01/24/cool-tools-a-little-filesystem-that-keeps-your-bits-on-lock/
https://github.com/littlefs-project/littlefs

On top of the basic drive I/O routines it might be useful to implement littlefs, a filesystem made for microcontrollers. AFAIK all you need to do to port it is to provide it with implementations of a few functions for reading/writing/syncing blocks.

The filesystem is simple and light weight, far more robust than FAT, and every operation is atomic.

Greaseweazle stuck on read

Hi, i have issue with Adafruit_Floppy (Raspberry Pi Pico RP2040 (philhower core)), using Greaseweazle.
When i try to read ibm.1440 (gw read test.img --device=com14 --format=ibm.1440), floppy drive goes to green and spin, but i dont get any data and progress, and head doesnt move.

img

I use last release (0.2.0) of Adafruit_Floppy and Greaseweazle 1.4.

Can you help me please?
Thanks

Unable to compile sketch - Release 0.2.0

Hello, i have issues with compile release 0.2.0, for my Raspberry Pi Pico RP2040.
I get this two errors:

greaseweazle.ino:81:2: warning: #warning "This firmware will not support Apple ][ drives" [-Wcpp]
81 | #warning "This firmware will not support Apple ][ drives"

Adafruit_Floppy.h:269:52: error: expected class-name before '{' token
269 | class Adafruit_MFM_Floppy : public BaseBlockDriver {

  • Arduino board: Raspberry Pi Pico
  • Arduino IDE version: 2.0.2

capture_track waiting for index pulse

Capturing a track from index pulse to next index pulse will run into trouble when reading disks that are not index aligned, e.g. Amiga Disks. A sector might start before an the index and end after the index, flux transitions might be lost when the capture does not overlap.

Request for wiring a apple ii 5.25 20 Pin to RP2040 pico/feather

Thank you for opening an issue on an Adafruit Arduino library repository. To
improve the speed of resolution please review the following guidelines and
common troubleshooting steps below before creating the issue:

  • Do not use GitHub issues for troubleshooting projects and issues. Instead use
    the forums at http://forums.adafruit.com to ask questions and troubleshoot why
    something isn't working as expected. In many cases the problem is a common issue
    that you will more quickly receive help from the forum community. GitHub issues
    are meant for known defects in the code. If you don't know if there is a defect
    in the code then start with troubleshooting on the forum first.

  • If following a tutorial or guide be sure you didn't miss a step. Carefully
    check all of the steps and commands to run have been followed. Consult the
    forum if you're unsure or have questions about steps in a guide/tutorial.

  • For Arduino projects check these very common issues to ensure they don't apply:

    • For uploading sketches or communicating with the board make sure you're using
      a USB data cable and not a USB charge-only cable. It is sometimes
      very hard to tell the difference between a data and charge cable! Try using the
      cable with other devices or swapping to another cable to confirm it is not
      the problem.

    • Be sure you are supplying adequate power to the board. Check the specs of
      your board and plug in an external power supply. In many cases just
      plugging a board into your computer is not enough to power it and other
      peripherals.

    • Double check all soldering joints and connections. Flakey connections
      cause many mysterious problems. See the guide to excellent soldering for examples of good solder joints.

    • Ensure you are using an official Arduino or Adafruit board. We can't
      guarantee a clone board will have the same functionality and work as expected
      with this code and don't support them.

If you're sure this issue is a defect in the code and checked the steps above
please fill in the following fields to provide enough troubleshooting information.
You may delete the guideline and text above to just leave the following details:

  • Arduino board: INSERT ARDUINO BOARD NAME/TYPE HERE

  • Arduino IDE version (found in Arduino -> About Arduino menu): INSERT ARDUINO
    VERSION HERE

  • List the steps to reproduce the problem below (if possible attach a sketch or
    copy the sketch code in too): LIST REPRO STEPS BELOW

density pin

The density pin is used differently depending on the manufacturer, some use it as an output to signal the media type (mostly teac drives) some use it as an input to switch the rpm (300/360) when using HD media (e.g. Sony 920), and at some it is NC.
Detecting the media type can only be done by counting the transitions when reading a track. Or when writing a track by firstly trying to write a HD track and reading it back while counting the transitions, a DD disk will return much less transitions than written.
And another problem is that all HD drives change the sensitivity/write strength of the head depending on the sensor for the HD hole of a disk, so that a DD image written to a HD disk will fail. Covering the HD hole will circumvent this issue.

Could I use this library with an ESP32?

Thank you for opening an issue on an Adafruit Arduino library repository. To
improve the speed of resolution please review the following guidelines and
common troubleshooting steps below before creating the issue:

  • Do not use GitHub issues for troubleshooting projects and issues. Instead use
    the forums at http://forums.adafruit.com to ask questions and troubleshoot why
    something isn't working as expected. In many cases the problem is a common issue
    that you will more quickly receive help from the forum community. GitHub issues
    are meant for known defects in the code. If you don't know if there is a defect
    in the code then start with troubleshooting on the forum first.

  • If following a tutorial or guide be sure you didn't miss a step. Carefully
    check all of the steps and commands to run have been followed. Consult the
    forum if you're unsure or have questions about steps in a guide/tutorial.

  • For Arduino projects check these very common issues to ensure they don't apply:

    • For uploading sketches or communicating with the board make sure you're using
      a USB data cable and not a USB charge-only cable. It is sometimes
      very hard to tell the difference between a data and charge cable! Try using the
      cable with other devices or swapping to another cable to confirm it is not
      the problem.

    • Be sure you are supplying adequate power to the board. Check the specs of
      your board and plug in an external power supply. In many cases just
      plugging a board into your computer is not enough to power it and other
      peripherals.

    • Double check all soldering joints and connections. Flakey connections
      cause many mysterious problems. See the guide to excellent soldering for examples of good solder joints.

    • Ensure you are using an official Arduino or Adafruit board. We can't
      guarantee a clone board will have the same functionality and work as expected
      with this code and don't support them.

If you're sure this issue is a defect in the code and checked the steps above
please fill in the following fields to provide enough troubleshooting information.
You may delete the guideline and text above to just leave the following details:

  • Arduino board: INSERT ARDUINO BOARD NAME/TYPE HERE

  • Arduino IDE version (found in Arduino -> About Arduino menu): INSERT ARDUINO
    VERSION HERE

  • List the steps to reproduce the problem below (if possible attach a sketch or
    copy the sketch code in too): LIST REPRO STEPS BELOW

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.