Add license; finish README.

This commit is contained in:
David Given
2018-12-14 21:33:44 +01:00
parent b000773dfc
commit db7f91a641
2 changed files with 147 additions and 14 deletions

19
COPYING Normal file
View File

@@ -0,0 +1,19 @@
Copyright © 2007-2009 David Given
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

142
README.md
View File

@@ -8,6 +8,45 @@ FluxEngine is a very cheap USB floppy disk interface capable of reading (and eve
**Big warning.** Right now it is a hacked together prototype. It is not ready to use. Unless you eat and breathe embedded systems code and were born with a soldering iron in your mouth (hopefully, turned off) then this is not for you. If you were... please, give it a try!
### Infrequently asked questions because nobody's got round to asking them yet
**Q.** Why not just use a USB floppy drive? There are lots and they're cheap.
**A.** Because USB floppy drives typically support a very limited set of
formats --- typically only IBM 1440kB and 720kB. The FluxEngine should work
on (almost) anything.
**Q.** But aren't floppy disks obsolete?
**A.** Absolutely they are. That doesn't mean they've gone away. Good luck
with any old hardware, for example; a classic Mac won't boot without a
classic Mac boot disk, and you can't make them on PCs (because they're
weird). This is where the FluxEngine comes in.
**Q.** But how can you read and write non-PC formats on a PC floppy drive?
**A.** Because the FluxEngine hardware simply streams the raw magnetic flux
pulsetrain from the drive to the PC, and then the analysis is done off-line
in software. It doesn't rely on any floppy disk controller to interpret the
pulsetrain, so we can be a lot cleverer. In fact, the disk doesn't even have
to be spinning at the same speed.
**Q.** That's awesome! What formats does it support?
**A.** I'm glad you asked the question. Not a lot, currently.
### Formats that it supports
Currently, not a lot.
- IBM MFM 1440kB and 720kB formats, a.k.a. standard PC floppy disks
- Brother 240kB word processor disks
...aaaand that's it. If you want more, please [get in
touch](https://github.com/davidgiven/fluxengine/issues/new); I need samples
of floppy disks to scan and play with.
How?
----
@@ -81,9 +120,12 @@ Here's the physical stuff you need.
bottom because there are components that stick out on the other side and
the bottom needs to go flush against the drive.)
3. **If you're using pins:** solder you 17-way pins to either side of the
3. **If you're using pins:** solder your 17-way pins to either side of the
board, from 0.2 to 3.0 inclusive.
4. Optional: solder the ends of your floppy drive power supply cable to any
convenient VDD and GND pins on the board. Remember to check the polarity.
And you're done!
### Building the firmware
@@ -119,11 +161,65 @@ touch](https://github.com/davidgiven/fluxengine/issues/new).
### Using it
So you have client software, firmware, and hardware all ready. What next?
So you have client software, programmed the firmware, and the hardware is all
ready. What next?
1. Attach the FluxEngine to your floppy disk drive. Pin
1. Attach the FluxEngine to your floppy disk drive. Pin 0.2 is REDWC and
connects to pin 2 on the floppy drive. Pin 3.0 is DSKCHG and connects to
pin 34 on the floppy drive. All the other board pins connect in the
obvious order. Odd pins on the floppy drive are left unconnected.
The sampling system is dumb as rocks.
2. **Important.** Make sure that a sacrificial disk is in the drive.
(Because if your wiring is wrong, you'll probably corrupt the disk.)
3. Connect the floppy drive to power. Nothing should happen. If anything
does, disconnect it and check step 1.
4. Connect the FluxEngine to your PC via USB --- using the little socket on
the board, not the big programmer plug.
5. Do `.obj/fe-rpm` from the shell. The motor should work and it'll tell you
that the disk is spinning at about 300 rpm. If it doesn't, please [get
in touch](https://github.com/davidgiven/fluxengine/issues/new).
6. Insert a standard PC formatted floppy disk into the drive (probably a good
idea to remove the old disk first). Then do `.obj/fe-readibm`. It should
read the disk, emitting copious diagnostics, and spit out an `ibm.img`
file containing the decoded disk image (either 1440kB or 720kB depending).
7. Success!
### The programs
The FluxEngine client software is a largely undocumented set of small tools.
You'll have to play with them. They all support `--help`. They're not
installed anywhere and after building you'll find them in the `.obj`
directory.
- `fe-inspect`: dumps the raw pulsetrain / bitstream to stdout. Mainly useful
for debugging.
- `fe-readbrother`: reads 240kB Brother word processor disks. Emits a
256-byte-sector FAT filesystem. (You can access this with mtools although
you'll need to edit the media type bytes in the boot sector and change
them from 0x58 to 0xf0.)
- `fe-readibm`: reads 720kB or 1440kB IBM MFM disks. Emits a standard
filesystem image.
- `fe-rpm`: measures the RPM of the drive (requires a disk in the drive).
Mainly useful for testing.
- `fe-seek`: moves the head. Mainly useful for finding out whether your drive
can seek to track 82. (Mine can't.)
- `fe-testbulktransport`: measures your USB throughput. You need about 600kB/s
for FluxEngine to work. You don't need a disk in the drive for this one.
### How it works
It's very very simple. The firmware measures the time between flux transition
pulses, encodes them, and streams them over USB to the PC.
There's an 8-bit counter attached to an 12MHz clock. This is used to measure
the interval between pulses. If the timer overflows, we pretend it's a pulse
@@ -139,15 +235,13 @@ rollover at 21us.
data difficult to analyse, so 12 was chosen to be derivable from the
ultra-accurate USB clock.)
VERY IMPORTANT:
Once at the PC, we do some dubious heuristics to determine the clock rate,
which depends on what kind of encoding is being used, and that in turn lets
us decode the pulsetrain into actual bits and derive the raw floppy disk
records from there. Reassembling the image and doing stuff like CRC checking
is straightforward.
Some of the pins on the PSoC have integrated capacitors, which will play
havoc with your data! These are C7, C9, C12 and C13. If you don't, your
floppy drive will be almost unusable (the motor will run but you won't see
any data). They're easy enough with some tweezers and a steady hand with a
soldering iron.
Some useful numbers:
Some useful and/or interesting numbers:
- nominal rotation speed is 300 rpm, or 5Hz. The period is 200ms.
- a pulse is 150ns to 800ns long.
@@ -164,6 +258,26 @@ Some useful numbers:
Useful links:
http://www.hermannseib.com/documents/floppy.pdf
- [The floppy disk user's
guide](http://www.hermannseib.com/documents/floppy.pdf): an incredibly
useful compendium of somewhat old floppy disk information --- which is
fine, because floppy disks are somewhat old.
https://hxc2001.com/download/datasheet/floppy/thirdparty/Teac/TEAC%20FD-05HF-8830.pdf
- [The TEAC FD-05HF-8830 data
sheet](https://hxc2001.com/download/datasheet/floppy/thirdparty/Teac/TEAC%20FD-05HF-8830.pdf):
the technical data sheet for a representative drive. Lots of useful
timing numbers here.
Who?
----
The FluxEngine was designed, built and written by me, David Given. You may
contact me at dg@cowlark.com, or visit my website at http://www.cowlark.com.
There may or may not be anything interesting there.
License
-------
Everything here is licensed under the MIT open source license. Please see
[COPYING](COPYING) for the full text. The tl;dr is: you can do what you like
with it provided you don't claim you wrote it.