2018-09-22 21:05:57 +02:00

The sampling system is dumb as rocks.

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 (this very rarely happens in real life).

An HD floppy has a nominal clock of 500kHz, so we use a sample clock of 12MHz (every 83ns). This means that our 500kHz pulses will have an interval of 24 (and a DD disk with a 250kHz nominal clock has an interval of 48). This gives us more than enough resolution. If no pulse comes in, then we sample on rollover at 21us.

(The clock needs to be absolutely rock solid or we get jitter which makes the data difficult to analyse, so 12 was chosen to be derivable from the ultra-accurate USB clock.)

VERY IMPORTANT:

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:

  • nominal rotation speed is 300 rpm, or 5Hz. The period is 200ms.
  • a pulse is 150ns to 800ns long.
  • a 12MHz tick is 83ns.
  • MFM HD encoding uses a clock of 500kHz. This makes each recording cell 2us, or 24 ticks. For DD it's 4us and 48 ticks.
  • a short transition is one cell (2us == 24 ticks). A medium is a cell and a half (3us == 36 ticks). A long is two cells (4us == 48 ticks). Double that for DD.
  • pulses are detected with +/- 350ns error for HD and 700ns for DD. That's 4 ticks and 8 ticks. That seems to be about what we're seeing.
  • in real life, start going astray after about 128 ticks == 10us. If you don't write anything, you read back random noise.

Useful links:

http://www.hermannseib.com/documents/floppy.pdf

https://hxc2001.com/download/datasheet/floppy/thirdparty/Teac/TEAC%20FD-05HF-8830.pdf

Description
No description provided
Readme 20 MiB
Languages
C++ 61.5%
C 36.7%
Python 1.1%
Verilog 0.3%
Makefile 0.2%
Other 0.1%