AFDT 0.3 - APPLE FLOPPY DRIVE TESTER 0.3
(c) 2015, Enrico Rolfi  



DISCLAIMER

I AM IN NO WAY RESPONSIBLE FOR ANY DAMAGE OCCURED DIRECTLY OR INDIRECTLY THROUGH THE USAGE OF THIS PROGRAM OR THROUGH THE READING AND APPLICATION OF THIS DOCUMENT. USE IT AT YOUR OWN RISK.



DESCRIPTION

This program allows you to do some basic operations with an Apple Floppy Drive, like reading its status flags and sending some basic commands to it. The program communicates with the Floppy Drive using the LPT (or Parallel Port) of the PC. 
I wrote this program because, while repairing old Apple Floppy Drives, I needed a way to test their basic functionalities without having to turn on the Macintosh, waiting for it to load the System, etc. 
Also by using AFDT you can reduce the chances of harming your Macintosh in any way when using a broken (or unproperly repaired) Floppy Drive unit. (you might only broke your PC with AFDT -- of course be careful if your PC is as valuable as is your old Mac).



CONNECTION

You have to build your own Y cable to connect the Apple Floppy Drive to the LPT port of you PC. You will also need to find a suitable Power Supply for the Apple Floppy Drive, which needs both +5V and +12V. I'm using a Power Supply from a portable Hard Drive for the purpose. You can also use the Molex power connector that is inside your desktop PC.

Before connecting your Apple Floppy Drive with the LPT of your PC, please double check the pinout in the following schematic for the Y cable. You can also verify it with the provided source code of the software. I will try to document it carefully, but remember that I am not responsible for any damage that might occur to your hardware.


                    Y Cable

                        ______________  PC LPT
Floppy  _______________/
                       \______________  PSU




FLOPPY SIDE 				LPT SIDE + [PSU]
(20 pin female connector)		(Male DB 25 Connector)

1 (RED wire)				Chassis+[GND from PSU]							
2					2				
3					Chassis+[GND from PSU]
4					3
5					Chassis+[GND from PSU]
6					4
7					NC				
8					5
9					NC
10					6
11					[+5V from PSU]
12					7
13					[+12V from PSU]
14					8
15					[+12V from PSU]
16					10
17					NC
18					9
19					NC
20					1




FLOPPY SIDE
(20 pin female connector)
           ____
__________|    |_____________
| 1 3 5 7 9  11 13 15 17 19  |
| 2 4 6 8 10 12 14 16 18 20  |
|____________________________|



LPT SIDE 
(Male DB 25 Connector)
______________________________________________
\    1  2  3  4  5  6  7  8  9  10 11 12 13  /
 \    14 15 16 17 18 19 20 21 22 23 24 25   /
  \________________________________________/




USAGE

The usage of this program is very simple. You will be presented a menu with possible choices:

_____________________________________________________________________________

	Main Menu:

 	 1 - Get Current Direction 	15 - Set Direction Forward
	 2 - Check Stepping Status 	16 - Set Direction Backward
	 3 - Check Motor Status 	17 - Perform Head Step
	 4 - Check Eject Status	
					19 - Turn Motor ON
	 6 - Get Floppy Sides		20 - Turn Motor OFF
	 7 - Check Drive Status		
	 8 - Get Floppy Status 		22 - Eject Floppy
	 9 - Get Write Protect Status
	10 - Check Track0 Sensor 	 E - Enable Drive
	11 - Measure Speed 		 D - Disable Drive
	
	 X - Exit
_____________________________________________________________________________


A typical sequence of usage is the following:

First power up you Drive and insert a Floppy

Then choose:

E - to Enable drive
19 - to turn motor on
11 - to measure turning speed

To move the head forward over the disk, you need to set the direction first by choosing 15 or 16, then you can move the head by choosing 17.

On 800Kb floppies, after doing 16 steps, you are going to measure a faster speed (by choosing 11 again).



LIBRARIES

This program uses Parapin 1.5.1-beta1 library for controlling the LPT.



BUILDING

You can build the program using the following command:

sudo gcc apple_floppy_tester.c -lparapin -lpthread -lrt -oafdt



KNOWN PROBLEMS AND POSSIBLE IMPROVEMENTS

In the current version of this program, there are a few known problems:

- Motor turning speed won't change with old 400k floppy drive. This is due to the lack of the PWM signal. I wasn't able to generate it using the LPT as it is a very fast 22KHz signal.

- It is not possible to read (or even write) actual data from a floppy disk. The data bit time is 2us and this program is not able to read so fast from the LPT. It should be possible by using the LPT port in EPP mode, though.



LICENSE

You can do what you want with this program. 
Suggestions for improvements and corrections are welcome.
