On 25 Feb 2011 at 0:18, Philip Pemberton wrote:
You'll be throwing away a fair amount of timing
resolution, and you
need to be careful about timing overflows. Use the appropriate
CatweaselClock value to get the most resolution without the value
clipping to 127.
Floating-point isn't necessary, I think. The CW's sample count is a
max of 127, which gives a quantization error of about 1%. Since ISV
and other variations are larger than that for most disk drives. A
fixed-point fractional multiply using 16 bits is more than
sufficient. In fact, CW software must leave some headroom for speed
variation, so the clock rate used is usually considerably lower than
that needed for a full-range sample. In MFM disks, counts of 30, 45
and 60 (decimal) are fairly typical for the CW.
If memory serves, the Catweasel starts counting from
0, in which case
you'll need a -1 on the end of that. The DiscFerret uses a stored byte
of '0' as a special value -- "the counter overflowed, add 127 to the
next count value". It actually counts from 1, i.e. "there was a 10ns
gap between the last two transitions". Bit 7 is still used for the
state of the INDEX bit, though if the group wishes, a config bit could
be added to use the entire 8 bits for timing data...
The Catweasel never records a 00 count. It's used by some software
as an end-of-sample marker (by writing into the sample buffer) and,
in some CW boards, a value of 128 is used to halt writing.
--Chuck