Hi guys,
I think I might be on something of a roll here - I spent the train ride
to/from work (and a good chunk of my lunch break) playing about with state
machine designs for the write side of the floppy disc writer. What I've come
up with is a nifty little finite state machine that interprets instructions
from the acquisition RAM, then executes them and writes
them to disc. The way
I've done it, there are five instructions:
0nnn nnnn: Write Timer. Writes the 7-bit timer value 'n' to the timer, then
outputs a pulse on the WRDATA line when the counter reaches zero
1111 1111: STOP. Sets the STOP flag and halts the state machine until it is
reset.
1011 xxx0: Close Write Gate. Deactivates WRGATE, preventing the head from
writing to the disc.
1011 xxx1: Open Write Gate. Activates WRGATE, allowing the drive head to
write to the disc.
110n nnnn: Wait for 'n' INDEX pulses before continuing execution of SM
instructions.
1100 0000: Wait for a hard-sector track index (sector zero marker) signal
before continuing execution of SM instructions.
As far as I can tell, this is the minimum instruction set required to allow
both soft and hard sectored discs to be duplicated reliably. There is one
'spare' instruction -- 1110 xxxx -- if anyone can come up with a good use for
it, I'm open to suggestions.
The write hardware currently clocks in at 19 macrocells, read hardware is
another 26, the track-index pulse detector (which allows hard-sectored discs
to be read and written) is 18, and the MFM synchronisation detector (including
the neat little state-machine data separator) is another 29. So that's a total
of 92, which leaves 52 for the acquisition control circuitry and registers.
Assuming I don't run out of any other chip resources first, that is.
The disc interface is going to be a standard 34-pin "PC" floppy connector.
It seemed like the best plan - wiring to 3.5 and 5.25" drives can be done with
a standard cable, and 8" drives can probably be connected with a fairly simple
adapter cable.
I do need one thing confirming though - I've read that on hard-sectored
discs, each sector is marked with an index pulse:
---+ +------------+ +----
| | | |
+--+ +--+
And the start of the track (sector 1) looks like this - note the index pulse
half-way between two other index pulses:
---+ +----+ +----+ +----
| | | | | |
+--+ +--+ +--+
1 2 3
My question is, does sector 1 start at 1, 2 or 3? I'm guessing 3, and that's
what the sync detector's set up for at the moment. Basically, it has a timing
window - if a second index pulse arrives within 0.75T (where T = time between
two normal index pulses) of the last one, it is assumed to be a track index
sequence. The threshold value is adjustable in software, so drive speed isn't
an issue.
Thanks.
--
Phil. | (\_/) This is Bunny. Copy and paste Bunny
classiccmp at philpem.me.uk | (='.'=) into your signature to help him gain
http://www.philpem.me.uk/ | (")_(") world domination.