Floppy Drive Pin 9 Is Not My Friend
Ah, pin 9. I’ve written here about pin 9 problems several times already, but it’s still an ongoing source of trouble for my Yellowstone drive controller card. Depending on the specific model of disk drive used, pin 9 may be:
- The -12V supply input, required for the drive to work correctly
- Unconnected, but OK to provide -12V anyway
- A second +5V supply input, in parallel with pin 11
- A manual eject input that turns on the eject motor when it’s low
Yellowstone doesn’t have any way of knowing how the drive expects pin 9 to be used, and the wrong assumption may cause serious problems. In my earlier discussions about pin 9, I’d thought that the Disk II was the only drive that required -12V on pin 9, and I wasn’t aware that any drives used pin 9 for manual eject. Now I see that the situation is more complicated. Here’s a list of every disk drive that should be expected to work with Yellowstone, along with their usage of pin 9. Some of these I have directly examined, and others are inferred from their list of compatible computers.
Drive | Pin 9 |
---|---|
Disk II, A2M0003 | requires -12V |
Unidisk 5.25, A9M0104 | probably requires -12V? |
Disk IIc, A2M4050 | probably requires -12V? |
bare 5.25 from Apple IIc | requires -12V |
Duo Disk, A9M0108 | probably requires -12V? |
AppleDisk 5.25, A9M0107 | unconnected |
Floppy Emu 5.25 mode | unconnected |
Floppy Emu dual 5.25 mode | unconnected |
Apple 3.5 Drive, A9M0106 | unconnected |
Mac 800K External, M0131 | probably unconnected? |
Apple SuperDrive (Apple FDHD Drive), G7287 | probably unconnected? |
Laser 3.5 | ??? |
Chinon3.5 | ??? |
Applied Engineering 3.5 | ??? |
American Micro Research 3.5 | ??? |
bare 800K 3.5 drive, black label | probably unconnected? |
bare 800K 3.5 drive, red label | manual eject input |
bare auto-inject 3.5 SuperDrive | manual eject input |
bare manual-inject 3.5 SuperDrive | +5V |
Floppy Emu 3.5 mode | unconnected |
Unidisk 3.5, A2M2053 | unconnected |
Floppy Emu Unidisk 3.5 mode | unconnected |
Floppy Emu Smartport hard disk mode | unconnected |
Footnotes on the “probably” entries in the table:
Unidisk 5.25: manualzz says it requires -12V
Duodisk 5.25 and Disk IIc: manualzz says they’re not compatible with the IIe card for Macintosh LC. This card lacks -12V, so I assume the drives require -12V
M0131: is compatible with the Mac Plus, which provides -12V to external drives, and also compatible with later Mac models that don’t provide -12V
G7287: is compatible with the Mac Plus and Apple IIgs (for 400K/800K disks only), which provide -12V to external drives, and also compatible with Mac models that don’t provide -12V
bare 800K 3.5 drive, black label: works as an internal drive in the Mac Plus with a straight-through “red stripe” cable, where -12V is provided on pin 9, and works as an internal drive in the Mac SE, where -12V is not provided to internal drives
Almost all of the 5.25 inch drives appear to require -12V, so it’s important for Yellowstone to handle that well. On the other hand, the only drives that won’t work with -12V on pin 9 are bare/internal 3.5 inch drive mechanisms, and that’s going to be rare. Most people will be using a proper external drive like the M0131 or G7287. Even if there were no problems with -12V, using a bare/internal 3.5 inch drive on an Apple II wouldn’t be a great experience, because outside of GS/OS there’s no easy way to trigger a disk eject. This doesn’t seem like an important usage case.
Given this, I think a reasonable solution could be for Yellowstone to directly connect -12V to pin 9, and say that bare/internal 3.5 inch drives aren’t supported. Or going slightly better, say that bare 3.5 inch drives are supported but require a special cable where pin 9 is disconnected.
Another solution might be to put a pair of removable -12V jumpers on the Yellowstone PCB, one for each drive connector. The jumpers would normally be installed, but could be removed if using a bare 3.5 inch drive. Maybe I’ll do that, but I’m not a fan of manual configuration jumpers, because they create an opportunity for people to accidentally screw up and cause confusion or worse. Since -12V is either required or permitted in 99 percent of the disk drive setups people are likely to encounter, it seems more foolproof to design for that assumption, and require a special cable for the rare case of a bare 3.5 inch drive.
The gold-plated solution would be to automatically recognize whether -12V is needed, and programmatically enable -12V with a transistor. That should be theoretically doable, based on the existing drive detection logic, since only 5.25 inch drives require -12V. Yellowstone first searches for a 3.5 inch drive at each connector, and if it fails to find one then it searches for a 5.25 inch or Smartport drive. So it could begin with -12V disabled, and only enable -12V if it fails to find a 3.5 inch drive. But I’m almost certainly not going to do this, partly due to concerns that the drive type might be misdetected sometimes, but mostly due to being tired of this whole pin 9 saga. I would rather find a simple and reliable solution and move on, even if it’s not the most elegant.
The latest version of Yellowstone is v2.1, which has a 2.2K series resistor between the -12V supply and pin 9. I had convinced myself this would work for both the Disk II and for the bare manual-inject SuperDrive. Now that I see the full picture, I realize the resistor idea is garbage. So there will need to be a v2.2 PCB to fix this, plus at least one other hardware issue that I’ve identified with v2.1.
Read 15 comments and join the conversation15 Comments so far
Leave a reply. For customer support issues, please use the Customer Support link instead of writing comments.
I don’t think Apple was worried about compatibility, because the incompatible bare drives were all either installed in newer machines (with a revised cable for old ones) or in external enclosures that mitigated the problem. Of course 5.25″ drives were never supported on Macs, ruling them all out. This is a tough one to solve.
Maybe you could connect pin 9 to -12V through a resistor or fuse so that connecting the wrong type of bare drive to Yellowstone wouldn’t result in fried components?
> Maybe you could connect pin 9 to -12V through a resistor
That’s exactly what is does right now, described in the final paragraph as garbage. 🙂 It causes the bare 3.5 inch drives to continuously eject, and also throws off the -12V analog reference for 5.25 inch drives, though supposedly (from my earlier tests) not by enough to cause problems.
At this point, I think the choice is between having a removable -12V jumper for bare 3.5 inch drives, or requiring a special cable for bare 3.5 inch drives where pin 9 is not connected.
Steve,
I haven’t seen a schematic of a drive that uses pin 9 as a remote disk eject. Do you have one that you can link to?
I know you’re ready to dump the whole mess, and I wouldn’t blame you. However, if you want to take one more stab at it, I can try to suggest some things.
You might be able to automate detection of pin 9 usage on the Yellowstone. Yes, it means more parts, sorry.
First the +5V: fairly easy to detect the +5V, and lock out the -12V.
Second the drives that need -12VDC: the schematic I saw shows the drive using the -12V as one end of a 10K pot with the other end at +12V. You should be able to detect the +12V and the Yellowstone card can turn on the -12V. I don’t know what the timing will do there. It looks like it would be OK as long as the -12V was applied before the drive attempted to read a disk.
Third: the drives that use pin 9 as a remote drive eject: I need to see a schematic to see if there’s an easy way to differentiate that drive from the other two.
Here’s one example of an 800K drive that uses pin 9 as a manual eject: http://www.textfiles.com/bitsavers/pdf/apple/disk/sony/MP-F51W-03_800K_Unified_Schematic.tif
Thank You Steve.
OK, here’s how I would do the detection process:
Measure the voltage on pin 9.
If +5V, leave open circuit. Done.
If 0V, leave open circuit. Done.
If +12V, Switch in a resistor. Measure the difference.
Example: switch in a 5K resistor. If this drive needs -12V, you should now measure -4V.
If this drive uses pin 9 as an eject, you will now measure +3.5-3.6V.
You can adjust the test resistor to give you the kind of values you can easily measure.
If you can only measure positive values, use a 10K resistor. Now if the drive needs -12V, you’ll measure 0V.
If the drive uses pin 9 as an eject, you’ll measure +7.09-7.18V.
(Note: all these values were done on paper. Actual metered testing should be done to verify)
How does that sound?
Quick recap, mostly a response to Merlin.
All of that automatic switching was already discussed in comments to earlier Yellowstone postings. It must be done at power-up, it must be fast (before the computer tries to access the floppy drives for the first time), and it must be done without support from either CPU or FPGA, so it has to be done completely in hardware (a fast microcontroller would be possible, but adds even more firmware that needs to be updated). That increases the parts count and the cost, plus that hardware needs to be at least partly analog, plus the hardware must support at least all the drives in the list in this post, plus the hardware must be TESTED with at least all the drives in the list in this post. Jumpers or switches plus perhaps a replaceable fuse are way cheaper, but not as convienient.
The multi-step approach needs some control logic, so you can’t get away with just a few analog components.
Looking at MP-F51W-03_800K_Unified_Schematic.tif:
Pin 9 labelled as -EJECT goes via R66 (2.2 kΩ) to the base of Q7 (2SB624), which is also connected via R55 (10 kΩ) to +12 V, and via R54 (2.2 kΩ) to the collector of Q6 (DTC114EK), controlled by IC1 pin 25.
Blindly assuming that IC1 pin 25 is low on power-up, R54 is irrelevant, but R55 and R66 will pull pin 9 to +12 V. The actual voltage measured at pin 9 highly depends on the measurement circuit. A modern 10 MΩ DMM will measure +12 V, period. A cheap analog voltmeter with 2 kΩ/V in the 10 V range (i.e. 20 kΩ) would show less voltage, but at the same time, it starts driving Q7. Q7 has a DC gain of somewhere between 50 and 400, the combined base resistor of the meter and R66 of about 22 kΩ would allow a base current of about 0.5 mA, resulting in a collector current of 250 to (theoretical) 2000 mA. That would trigger the eject motor just by measuring the voltage at pin 9. Not what you want.
Assuming the opposite, IC1 pin 25 is high on power-up, will make Q6 switch R54 to GND, that should drive Q7 into saturation, R55 becomes irrelevant, so the base voltage of Q6 is about 0.6 V to 0.7 V below 12 V, i.e. about 11.3 V to 11.4 V. That drives pin 9 via R66 to the same voltage. How much the voltage you measure again depends on the resistance of the measurement circuit.
Given only that floppy drive circuit, it is clear that if some hardware on the Yellowstone starts measuring voltage at pin 9, it has to do so with a high resistance. That rules out several cheap microcontrollers where the ADC input impedance is in the kΩ range.
The multi-steap approach does not consider the Disk II (see https://www.bigmessowires.com/2021/07/14/current-limiting-strategies-again/ and https://www.bigmessowires.com/2021/06/27/yellowstone-and-macintosh-floppy-drives/), which has a 10 kΩ trimpot between pin 9 and +12V, plus some circuit at the wiper of the trimpot, plus some capacitors between pin 9 and GND.
Any resistor less than 10 kΩ to -12V will make pin 9 negative as soon as the capacitors have charged up. Initially, when the capacitors are empty, they behave like a dead short to GND, so pin 9 starts at 0 V, goes up to +12 V because the capacitors are reverse-charged via the trimpot, then you switch in a resistor and the voltage will go down again, discharging the capacitors, then charging them at the specified polarity. With 5 kΩ, you will end at -4 V. The exact timing depends on the resistor you switch in.
Things will become really interesting with a short power cycle that does not completely discharge the capacitors in the Disk II.
Disk II: http://retro.co.za/ccc/apple2/A2DISK2.GIF
C5 (10 µF polarized) is the relevant capacitor. It probably won’t like being reverse charged at every power-up, even if it is only through R28 (10 kΩ), and only for a short time.
So you need to detect the Disk II as fast as possible. And you need to detect manual eject drives like the MP-F51W-03_800K_Unified_Schematic.tif before the eject motor starts spinning. (It should not hurt to apply voltage to the motor if that is only a short pulse that does not spin up the motor.)
Steve,
Crap, you’re right about the filter cap on the Disk II board.
I didn’t expect the IC on the MP-F51W-03_800K to be trying to eject the disk. If it does run the eject motor, my test fails.
Yes, I did expect the test to run the motor. I wasn’t expecting to run the motor for any length of time. I was expecting computer ( FPGA ) speeds in the measuring. However, I flat missed the filter cap on the Disk II. That throws the timing right out the window. If I can come up with a solution, I’ll let you know. Definitely a sticky one…
An off the cuff thought – can you use the Disk II’s filter cap as a way of differentiating between it and the MP-F51W-03_800K drive? Still the same voltage test, but maybe without any switching in and out of resistors? The Disk II drive’s pin 9 will start at 0V, and start to ramp up. The MP-F51W-03_800K drive’s pin 9 will almost immediately rise to +12V (unless that IC does something stupid like running the eject motor on power up). Yes, that electrolytic cap will start to see a reverse voltage. How quickly and well can you measure that voltage with your chip (and maybe a bit of additional hardware)?
Of course, as you mentioned, with a short power cycle, where C5 on the disk II drive doesn’t get completely discharged, we’re done.
Sorry, Steve, I don’t see any way to make it completely foolproof. Fools are just too ingenious.
Steve (and others, Thank You), this might still work, no resistors.
Measure pin 9.
If +5V leave alone.
If +12V pin is eject.
If -voltage, drive is a Disk II on a short power cycle, apply -12V.
If voltage is 0V and stays there, leave alone pin not used.
If voltage is 0V and starts to rise, drive is a Disk II, apply -12V.
If your chip can catch the Disk II voltage starting to rise before the voltage gets above 1V to 1.5V you should be OK.
(https://en.wikipedia.org/wiki/Electrolytic_capacitor#Polarity Section Reverse Voltage)
Now if the CX-23077A chip on the MP-F51W-03_800K drive runs the eject motor, the logic fails. It will probably detect the drive as no connection to pin 9.
Everybody, does that work? Or did I miss another one?
While I’d originally hoped to avoid needing any manual configuration, I think I’m OK with it here, given the circumstances. Connecting a bare 3.5 inch drive just isn’t going to be very common, so most people would never have to configure anything. For those few that do, it seems reasonable to expect they can remove a jumper or use a different cable (perhaps after accidentally triggering eject or blowing a fuse and then belatedly reading the manual).
But if auto-detection is important enough, the software-driven “gold-plated” solution I mentioned should work. Yellowstone already needs to detect what types of drives are present anyway, so it could use the detection result to enable -12V. This wouldn’t require anything but a transistor for pin 9 on each connector, with an extra FPGA pin to turn on the transistor, and some code/logic to control it. It would start with -12V off, and only enable it after determining (through disk I/O) that the drive is not a 3.5 inch drive.
The only real downside I see (other than more complexity and development time) is that it would be using 3.5 inch drive detection as a proxy for pin 9 usage, rather than directly examining pin 9. Maybe there’s a scenario where that would do the wrong thing.
@Merlin
The new detection steps look good as far as I can judge (never owned or used Apple-II hardware). But so far, we always assumed ideal or near-ideal hardware. Your detection for the Disk-II relies on a working C5, which is probably an electrolytic capacitor. Disk-II sales started in 1978, so those caps are now well over 40 years old. That does not automatically mean that C5 has lost its capacity, but it is more likely than 40 years ago.
I wonder if it would make sense to add a small serial EEPROM for configuration. A CPLD could, on power-up, fetch a byte from the EEPROM and set voltage-control wires appropriately, even before the CPU starts up, and otherwise allow a boot loader stored in “ROM” to select appropriate start-up behavior, which might include reading 256 bytes from EEPROM into RAM and running it at address $Cs00. A 512×8 EEPROM would cost $0.10 in quantity 1,000 at Digi-Key, and could allow a nice means of handling system configuration.
In order to drive down the BoM, have you considered 0ohms or solder bridges instead of configurable headers? As you say the majority of users will never need to use Yellowstone with anything but 5.25” drives. Those that do can simply remove to resister or open the bridge, knowing that this will allow compatibility with their niche use-case but may cause compatibility issues with other drives
Yes I’d initially thought to use a solder bridge, just to keep everything as simple as possible. But now I’m planning to use a DIP switch with a PTC resettable fuse, so it doesn’t require any tools or special cables to change the configuration or change it back. That’s about as user-friendly as I can make it while still having the pin 9 setting be manual. In some ways I think this is even better than automatic, since none of the automatic solutions seemed like they would be 100 percent reliable.