Commit Graph

1540 Commits

Author SHA1 Message Date
David Given
99e222d012 Change the record mechanism to use an upcounter, not a timer. 2018-10-13 16:54:51 +02:00
David Given
1e7e91c4cd Intervals of 0x00 are actually 0x100 ticks. 2018-10-13 16:54:17 +02:00
David Given
66cdf0c00c Always process data in a consistent order. 2018-10-13 16:53:45 +02:00
David Given
aa7d420754 Start work on an autocalibrator to detect precompensation, but something's gone
wrong and our reads are all bunk.
2018-10-13 12:04:37 +02:00
David Given
b46d55cc07 The USB capture/replay interface now uses timestamps rather than intervals;
this makes the hardware considerably simpler and more reliable (as I don't need
to spend time resetting the timers between pulses). Still doesn't help writes,
though. Simplify and improve clock detection; add an abortive attempt at an FM
decoder (turns out that the Brother doesn't use FM).
2018-10-13 01:19:17 +02:00
David Given
333fd989de Rename decode to mfmdecode now that I've found what might be an FM disk. 2018-10-11 22:52:59 +02:00
David Given
9dcfbc2ab1 More replay timer simplification: more robust? 2018-10-10 23:15:20 +02:00
David Given
5d4e929302 Added the fluxdump command, for exporting a fluxmap into something like
Audacity where it can be visualised.
2018-10-10 23:02:45 +02:00
David Given
1c0cc1f831 Rewrite the pulse replay logic to be, maybe, more reliable? Add lots of decoder
debugging.
2018-10-10 22:32:58 +02:00
David Given
1430dfc4e1 Add the test pattern generator back again. Try some experimental code to
convert a fluxmap into an encoding_buffer, but locking each pulse to a us grid.
I'm not sure whether this is good enough for reliable decoding, but early
indications look promising.
2018-10-09 23:46:24 +02:00
David Given
5bd01d5ebc Refactor all the raw buffer stuff to be less bad. Add an encoded buffer, which
will be used for assembling fluxmaps to write to the floppy.
2018-10-09 22:49:10 +02:00
David Given
40b9fbc25d Fix ghastly DMA ordering bug leading to corrupted writes. Writes are less
corrupted! Still can't reliably read back what I wrote, though. Added a test
pattern feature to write, to aid debugging.
2018-10-09 00:23:21 +02:00
David Given
443082f3c4 Written my first data --- it's kinda garbled, but there's definitely sectors in
there!
2018-10-06 23:30:14 +02:00
David Given
30271d7e95 Just enough writing works to utterly destroy tracks now. 2018-10-06 23:01:24 +02:00
David Given
8f1cef48b1 Realise that the weird data dropouts were due to a stray capacitor on the
board... so remove it. Better now. Also realise that PSoC Creator lies to you
about clocks, so adjust the sample clock to be derivable from the USB clock,
making it both the right frequency and much more accurate --- decode success is
dramatically improved (presumably due to less jitter). Redesign the capture
logic to use a timer; simpler now.
2018-10-06 18:32:57 +02:00
David Given
74d051dff3 Start sketching out the write code; attempt to make more robust in the face of
the weird data dropouts.
2018-10-06 13:47:34 +02:00
David Given
bf3e689708 Sketch out the replay logic, although it's not connected to anything yet. 2018-10-05 23:42:32 +02:00
David Given
d6b71beacf Reduced the sampling rate to 8MHz; 16MHz means that on a 720kB disk some
samples are more than 128 ticks apart! Doubled the settling time to make reads
more reliable; added disk change logic to rehome the disk when you replace
floppies.
2018-10-05 22:58:56 +02:00
David Given
5a0229b06f Rewrite most of the MFM decoder... again. Now it parses the records to find out
what they are and how big they are. After lots of tinkering with the clock
code, it now correctly decodes a 720kB floppy into records. Something seems to
have gone wrong with 1.44MB floppy capture, though.
2018-10-05 21:57:24 +02:00
David Given
3276ed785e Replace the MFM decoder logic with something which very nearly works. Now I
search for the sync region before each record and recalculate the clock from
that. Unfortunately, knowing when I've reached the end of a record and so
should start resyncing is hard without parsing the records themselves, and so I
frequently lose byte phase between records.
2018-10-04 22:36:36 +02:00
David Given
339cdd5105 Add a partially working MFM decoder --- MFM's fine, it's aligning to sync bytes
which is hard.
2018-10-04 00:02:13 +02:00
David Given
fccabb3266 Add back in the hacky output file, for testing; replace the capture logic with
an upcounter, and replace the pulse-in-high-bit stuff.
2018-10-03 19:45:27 +02:00
David Given
a8738915e9 You can now read complete disk images into a database file. 2018-10-03 00:03:50 +02:00
David Given
841c1ed516 Attempt to capture rollover events --- don't think it works. Add a basic
command processor.
2018-10-02 23:03:07 +02:00
David Given
913829afbb Discover timers; drastically simplify and betterify everything. 2018-10-02 00:17:37 +02:00
David Given
51cb1ae785 We just read our first floppy! Turns out the secret is to, once again, remove
C7 from the board as it's preventing the READ DATA line showing anything.
2018-10-01 23:30:51 +02:00
David Given
4e19882d76 Archival checkin of messed-about non-working code to actually read data from
disk. Something's wrong with the DMA; requesting a transfer every 2us with a TD
size of 64 bytes is somehow leading to an nrq interrupt every 8us. Mysterious.
2018-09-30 01:13:39 +02:00
David Given
e5155d98cc You can now transfer gibberish from the FluxEngine to the PC to test bandwidth.
On Windows we're getting 620kB/s.
2018-09-29 18:32:06 +02:00
David Given
c174e5cafe You can now measure the rotation speed from the interval between index pulses. 2018-09-29 16:37:04 +02:00
David Given
026842b8a4 There's a seek command now, which might even work. 2018-09-29 14:51:01 +02:00
David Given
7d98ec7e01 Okay, the USB stuff works! I can send a command to the device and receive the
reply.
2018-09-29 12:13:00 +02:00
David Given
09ec9065cc Fix incredibly stupid crashing bug. 2018-09-26 00:52:26 +02:00
David Given
d06e201933 Finally figure out the secrets of WCID, so we don't need a signed driver to do
raw endpoints. Hurrah! Rip out the CDC stuff in favour of them.
2018-09-26 00:37:19 +02:00
David Given
7fc3b882d6 Lots of wasted time trying to make raw endpoints work --- but you can't do that
on Windows because libusb can't talk to any device without a signed driver.
Stupid Windows.

Luckily I can get 500+kB/s out of CDC, even on Windows, so let's use that.
2018-09-25 00:11:06 +02:00
David Given
a332fd0308 Added some Unix stuff and a crude benchmark. 2018-09-24 01:12:14 +02:00
David Given
264cf47c00 Add the skeleton of the client-side program. 2018-09-23 13:13:29 +02:00
David Given
755ae2950d Attempt to DMA data gibberish data from a fake acquisition unit and send it out
over USB.
2018-09-23 02:05:20 +02:00
David Given
9d00a1e5ea Bolt on USB UART. 2018-09-22 22:08:49 +02:00
David Given
a59c764dc5 Initial project boilerplate. 2018-09-22 21:44:33 +02:00
David Given
ee608cf66f Initial commit 2018-09-22 21:05:57 +02:00