Device initialisation
#1
I've been driving the SCP board from my own software for some time, but have noticed occasional strangeness in behaviour.  I've finally spotted a pattern to it, which usually begins with me unplugging the device for more than a few seconds before use.

After opening the device I always select drive 0, turn the motor on, then seek to cyl 0.  Instead of seeking to cyl 0 it seems to position the drive head at cyl -4, and using a slower than normal step rate.  If I then sequentially read the content of tracks 0 upwards, the first 4 show as blank and cyl 4 shows the output from physical cyl 0, etc.  If I stop my program and re-run it everything works completely normally, with cyl 0 correctly located and a normal step rate used.

It seems like I should be initialising more of the board when I first open it.  Can you advise on what I need to change from the firmware defaults?  I have hardware version 1.1 and firmware version 1.2 installed.

The cyl -4 issue feels like it might be related to the flippy mode somehow, which I'm not changing.  I've noticed your own software doesn't suffer from the same problem, but it's likely to be applying more to restore the user's configuration settings...
Reply
#2
I don't do anything to "initialize" the board.  It's ready to use on power up.   The board itself knows nothing about tracks.  When you tell it to step to track 0, it just steps outwards until the TRK0 sensor line goes low, at which point it stops.

There is nothing to "restore".  You just turn on the board, and send it commands.  Make sure that you aren't calling CMD_SETPIN33 with the wrong value.  On power-up, the pin is low (flippy mod off).
Reply
#3
I've spent some time going over this, and have a guess at what might be happening.  When I unplug the USB cable the drive lines see something, which I observe as a brief flash of the motor LED and an audible shift in the drive head position.  If the head is close to track 0, I suspect it's being moved outwards past the TRACK0 position.  When a SEEK0 is issued on the next use it doesn't see TRACK0 and steps out never result in it being set.  I think the long seek I hear is probably it being bumped up against the head stop, before the firmware step limit is exceeded.  I noticed that if I move the head to cyl 10 before I unplug it, it doesn't have a problem, perhaps because the head jump leaves it >= cyl 0.

I also noticed that this only happens if my 3.5" drive is being powered externally.  If I use the power connector on the SCP card I don't get the glitch when I unplug it, and everything is fine.  Though I still need to use external power for some types of drives, so it's only a temporary work-around.

I can also reproduce it with your software, and think it must have been variations in head position that masked it earlier.  My reproduction steps are:
  1. use external power source for floppy drive
  2. start SCP software
  3. read track 0 using disk analyzer
  4. close SCP software
  5. unplug USB cable (listen for drive head activity)
  6. wait 5 seconds
  7. plug USB back in and wait for board to boot
  8. start SCP software (listen for long seek attempt to find track 0)
Are the drive lines glitching when the board is unplugged?  If so, can that be prevented?
Reply
#4
I can't replicate the issue you are having on my setup. What make/model of drive are you using? Have you tried using a different drive, just to rule that out as an issue?

Kind regards,

Francis
Dreamland Fantasy Studios
http://www.dfstudios.co.uk
Reply
#5
The problem is with your flippy mod. You need a pull-down resistor on the input to the FET that enables the stepping past track 0. The line floats when powered externally with the SCP not connected and this will cause a problem for drive electronics. Add a 10K-47K resistor from ground to the pin 33 input and that will solve the issue. I had to do the same with mine.
Reply
#6
I'm not using a flippy mod, just a plain ol' unmodified 3.5" floppy drive (SONY MPF920).  I tried setting pin 33 low on startup, but it didn't make any difference.

I've just tried an ALPS DF354N062F, and that's not showing any signs of the same problem.  However, I do know another user using an Amstrad 3" floppy drive with an external PSU, and he's reporting the same symptoms.  His drive has an adapter to convert the wiring, but it's a simple mapping and shouldn't involve any flippy changes.

I don't have time to run any more tests at the moment, but later I'll try to confirm the head movement by seeking in ~20 steps and stepping out until I see the TRACK0 line signalled.
Reply
#7
Oh, I thought you were using a 5.25" drive. The pin 33 flippy mode is only for 5.25" drives.   For a 3.5" drive, that must be a drive issue.  I have never seen this before, and nobody has reported it.  Keep in mind that you must always be powering the SCP board first, then powering up the drive.  Drives needs to have their state lines set (not floating) on power up or there could be problems.  Now, having said that, you can power the SCP and a drive on at the same time (like in an external enclosure) because the SCP initializes the floppy port in about 80us, so it's guaranteed that SCP will have the port line states set correctly prior to the completion of the drive's initialization procedure.
Reply
#8
I usually have the drive connected to a separate power brick, which always has power.  The SCP only gets power when it's plugged in and my PC is on, so it's always going to start up after the drive.  I think I had the same drive setup with the KryoFlux board, though I've used that a lot less overall so I might not have noticed whether it did the same.

I'll either change to my ALPS drive (which is probably better anyway), or use the power from the SCP board.  I'll still add a software work-around in case anyone else is affected by the same issue (just one person so far).
Reply
#9
Interestingly, I get a similar stepping effect when using an HxC SD floppy emulator with the SuperCard Pro.  Since it shows the head position on the display, I can also see where it thinks the head is:  https://www.youtube.com/watch?v=EIJkca7ppbk

This time it seems to step in rather than out towards (or beyond) zero, but that might depend on what the direction line is seeing.  It probably moves the head further than on a real drive, which wouldn't handle pulses too close together.  What worries me a little is "WA" shown on the display, suggesting the write line is active too.

As before, it only happens when I use an external power source for the drive.  Everything is fine if I take the drive power from the SCP.
Reply
#10
I would expect this. This is no different than if you were to pull a FDC card out of an XT card slot. The drive lines will float. You MUST have the SuperCard Pro powered up either before or at the same time as the floppy drive. There are no exceptions to this rule.
Reply




Users browsing this thread: 1 Guest(s)