Re: [hatari-devel] Re: Hatari floppy drive detection with EmuTOS |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
- To: hatari-devel@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [hatari-devel] Re: Hatari floppy drive detection with EmuTOS
- From: David Savinkoff <dsavnkff@xxxxxxxxx>
- Date: Wed, 15 Jan 2014 17:09:11 -0700 (MST)
- Thread-index: jH8sxcOvQRkI69Uz10dMLVPFybX3CQ==
- Thread-topic: Hatari floppy drive detection with EmuTOS
----- Nicolas Pomarède wrote:
> Le 15/01/2014 20:49, Roger Burrows a écrit :
> > On 15 Jan 2014 at 18:56, Nicolas Pomarède wrote:
> >>
> >> approx 1.5 sec per drive to complete would match the time needed to do
> >> the spin up associated to the restore command (if the head is already
> >> near track 0) ; but what I don't understand yet is that the WD1772 doc
> >> says it needs to count 6 revolutions (index hole) from the floppy drive
> >> to determine when the spin up is good.
> >>
> >> But my understanding about this is that if the drive is disconnected,
> >> you will never receive the index pulse, so the revolutions counter will
> >> stay at "0", spin up will never complete, and restore will never
> >> complete too, because it needs spin up to complete first.
> >>
> > Ah, I see your point! That's what the WD1772 docs seem to say. Perhaps, as
> > long as you have at least 1 drive connected (which is all I've tested on real
> > hardware), then the FDC sees the index pulses from the _connected_ drive when
> > it's trying to do a restore on the _unconnected_ drive? In other words, the
> > restore will only complete as long as at least one drive is connected. It
> > seems unlikely, but who knows? If I don't have any drives connected, loading
> > EmuTOS is going to be tricky ...
> >
>
> No, I don't think that the case, signals are really separated when you
> choose one drive or the other. And it wouldn't solve the case where you
> only have one drive and it still detected.
>
> Note that to detect index pulses you normally need one drive, but also
> one floppy in it.
On 3.5" drives, the index is in the drive. Thus, no floppy is required.
> So, there must be something else in the WD1772 (maybe
> an internal timeout), else a disk with no floppy would not be able to do
> the spin up sequence either.
> Which means only drive with a floppy would be detected, which is
> obviously not the case.
>
> By doing a restore without spinup and just testing if signal TRK0 is
> received, you can check if a drive is ON, without having to bother about
> the spin up.
>
> But for now, I don't see what part of the doc explain how the spinup
> succeed when the drive if off or empty.
>
>
> > Here are the floppy detection times (in clock ticks) from my tests:
> > 1) Both drives connected
> > Time to detect presence of drive A: 258
> > Time to detect presence of drive B: 1
> > The time for drive A is mostly motor spinup time (6 revolutions at approx 300
> > rpm is 1.2 seconds = 240 ticks). Drive B was obviously at track 0 to begin
> > with.
> >
> > 2) Only drive A connected
> > Time to detect presence of drive A: 258
> > Time to detect absence of drive B: 153
> >
> > I looked at my docs again and the step time for step rate 0x03 is actually
> > 3msec: 3*255 = 0.765 seconds = 153 ticks! Again drive A is spinup time.
> >
> > Regards,
> > Roger
>
> Thanks for those numbers, they confirm the effect of the spin up
> sequence that I need to analyze better.
>
> Regarding case 1), drive B is detected immediatly because when you
> select another drive, the WD1772 is not aware of that. So the status
> register remains with "motor on + spin up complete" (even if drive B has
> no motor running !), which means the restore command+spinup completes
> very fast on B, as the head is already on track 0 I guess.
>
> I'm working on other parts of the WD1772 emulation at the moment, so I
> can't mix too many things at the same time in the code, I will come back
> at this spinup "problem" after.
>
> Thanks
>
> Nicolas
>
>
>