[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Apple floppy adaptor. I'm stuck!
Michael J. Mahon wrote:
> Tristan Mumford wrote:
>> Michael J. Mahon wrote:
>>
>>
>>>Tristan Mumford wrote:
>>
>>
>> -big snip-
>>
>>>>The current code only deals with one phase on at a time. Partially
>>>>because it looked like that was all the standard routines dealt with,
>>>>and partially because it seems logical that no matter what a stepping
>>>>routine would probably have each single phase on exclusively at some
>>>>point of rotation.
>>>>
>>>>That code does seem similar in spirit to mine. Just that looks better
>>>>thought out :)
>>>
>>>The normal seek behavior of RWTS and the Disk ][ Driver is to "idle"
>>>with all phases off (though the boot ROM leaves phase 0 on after the
>>>recalibration seek).
>>>
>>>To move, the driver turns on the "current" phase (the one last
>>>energized), then turns on the adjacent phase (in the desired direction),
>>>then turns off the original phase and waits for the stepper to
>>>stabilize. It repeats this cycle twice for each track moved.
>>
>>
>> Well, given that description maybe it really is alright just checking for
>> the 4 phases individually or none at all. As I have no control over the
>> shaping of the steps anyway, as long as I'm grabbing the primary parts of
>> the phase it should all be good... right?
>>
>> My current method just uses a switch with 1, 2, 4, 8 and default, which
>> handles the unsupported and no phase conditions.
>> It decides direction and whether it has to do anything based on the
>> previous phase state sampled. Nothing too flashy.
Added for clarity for those non-C people, and non-technical types:
switch(variable) is the equivalent of the beginning of a case block in
BASIC.
I have the four stepper phase lines connected to four consecutive IO pins on
the same port of the uC. I AND the port data byte with 0xF to filter out
activity on the other four pins from messing up my evaluation.
The states are 1, 2, 4, and 8 corresponding to the on state of bits 0-3 of
the byte. Ie, 0000 0010 would be 2, 0000 1000 would be 8. Anyhow, if you
want a better understanding of binary look it up! it really is a very
useful number base.
>>
>> Then there's some code that tracks the head and moves it. It also stops
>> headbump conditions, as not all floppy drives stop automatically at 0 and
>> 80 tracks.
>
> Sounds like it should work.
I'm glad you think so. That gives me some resolve to keep trying, after I
repair the controller that is. I can't test it otherwise.
Before it all went bad, the stepping bug was fixed. It was just an idiotic
mistake that stopped the head from going down tracks further than where it
was on powerup.
--
-----> http://members.dodo.com.au/~izabellion1/tristan/index.html <-----
===== It's not pretty, it's not great, but it is mine. =====