home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 3 / goldfish_volume_3.bin / files / hard / hack / pcdrv2am / pcfloppy2amigahd.doc < prev    next >
Encoding:
Text File  |  1994-12-07  |  17.5 KB  |  319 lines

  1. Wageningen, the Netherlands    6 december 1994
  2.  
  3. HOW TO MAKE A PC DOUBLE DENSITY AND HIGH DENSITY FLOPPYDRIVE WORK.
  4.  
  5. This is a second draw of the document I am making. It describes a way to
  6. connect a PC double density drive to the amiga as an 880 kb diskdrive and how
  7. to connect a PC high density drive as an 880/1760 kb diskdrive. Keep mailing
  8. me if you think the information is incorrect or incomplete. 
  9.  
  10. I own an amiga 2000 and I have wondered why the PC drives can't be used for
  11. the amiga, because they are a lot cheaper. The solutions to this problem will
  12. be usefull for both internal and external drives.
  13. In this document I will explain the how the interaction between the drive and
  14. the amiga works and I will show how I solved the problems. I have constructed
  15. both a double density drive (DD) and a high density drive (HD). The schemes I
  16. used worked fine for me. However I can't garantee that it will work with every
  17. other brand of PC drive. I have used the HD drive over a year now. I am not
  18. satisfied how it works (sometimes I get read write errors). The high density
  19. ID misses a bit sometimes. This means the amiga is trying to write a DD track
  20. on a HD disk. I think this wrinkle can be ironed out so I post this anyway.
  21. For these hacks you will be needing at least a solder iron and some knowledge
  22. on how to use logical circuits like NAND gates, OR gates and flipflops.
  23.  
  24. CONNECTING A DOUBLE DENSITY DRIVE:
  25.  
  26. HOW IS A DRIVE MOUNTED BY THE SYSTEM ?
  27. At first when you connect the PC drive to the amiga and boot the system the
  28. drive will not be recognized by the system. Nearly all signal lines of the
  29. floppy drive cable are constructed with a low active state. This means that a
  30. not used a signal line is high (+5 Volt) and of course a active signal line is
  31. low (0 Volt). The amiga will pull down the SELECT line (there four of them:
  32. DF0:-DF3:) of the drive down and will now be checking the READY line to see if
  33. there is a low pulse coming. If so there is a drive connected, else if it
  34. stays high no drive is mounted for that unit number. This checking is done
  35. when the drive motor is not spinning. The trouble with pc drives is that only
  36. when the motor is spinning at enough speed the READY line will react to the
  37. SELECT signal. So this interaction has to be added to the interface. In a time
  38. diagram it looks like this:
  39.  
  40.     SELECT  ~~~~~~|__|~~~~~~|__|~~~~~~|__|~~~~~~|__|~~~~~ amiga signal
  41.  
  42.     READY   ~~~~~~|__|~~~~~~|__|~~~~~~|__|~~~~~~|__|~~~~~ signal from drive
  43.  
  44.  
  45.  
  46. HOW SWITCHES THE SYSTEM THE MOTOR ON ?
  47. The amiga has a different way of switching the motor on then the one used in
  48. PC. With a PC it is simply done by pulling the MOTORON line of the drive low.
  49. The disadvantage of this way is that all the drives will respond to this
  50. signal, causing a powerdrain of the floppy port. The amiga has its own elegant
  51. solution of avoiding this. With the falling signal of the SELECT line the
  52. signal of the MOTORON line (MTRXD amiga side) is saved in a flipflop. Was at
  53. this time the MTRXD signal low the motor will turn on (MOTORON low) was the
  54. signal at that time the MTRXD signal high the motor will be turned off
  55. (MOTORON high). When the SELECT signal is put to high again the motor will
  56. stay in the same state (on or off). In this way only the motor of the drive
  57. which received the SELECT line pulse will be affected. In a time diagram it
  58. looks like this:
  59.  
  60.     SELECT    ~~~~~~|__|~~~~~~|__|~~~~~~|__|~~~~~~|__|~~~~~~ amiga signal
  61.  
  62.     MTRXD     ~~~~~|_____|~~~~~~~~~~~~~|_____|~~~~~~~~~~~~~~ amiga signal
  63.  
  64.     MOTORON   ~~~~~~|_________|~~~~~~~~~|_________|~~~~~~~~~ signal to drive
  65.  
  66. WHAT ABOUT THE DRIVE RESET LINE ?
  67. By booting the amiga the drive reset line is pulled low to make sure the motor
  68. of all the drives is off. This is because only with the motor off the READY
  69. line of the drive will respond to the drive SELECT line described under
  70. mounting a drive. This is done by connecting the drive reset line (DRESB) to
  71. the preset gate of the flipflop of the MOTORON signal.
  72.  
  73. HOW DO YOU GET A DISKCHANGE SIGNAL ?
  74. The amiga checks for a diskchange by pulling the SELECT line low at intervals.
  75. When a disk is in the drive it responds by with a low pulse on the diskchange
  76. line. The amiga thinks the only way to get the DISKCHANGE signal switch back
  77. again it also has to generate a STEP signal, thats why your drives are always
  78. clicking with no disk in it. The time diagram looks the as the one with the
  79. READY line, just picture instead of READY, DISKCHANGE.... You can get this
  80. signal by tapping in on the switch at the drive which pressed when a disk is
  81. in the drive or if your lucky on PIN 2 of the drive connector. 
  82.  
  83. HOW DO YOU MAKE THIS ?
  84. The most easy way of adding a drive is an internal one (DF1:). In this case
  85. most will be done for you on the amiga motherboard when you install a jumper
  86. for DF1: (only with an amiga 2000, 3000 and 4000). You will need to put in a
  87. jumper to the activate the mounting signal. The location of it can be found in
  88. the documentation of your computer. This will also take care of the MOTORON
  89. signal and the drive reset line. The only thing you have to make between the
  90. drive and the amiga is a working DISKCHANGE signal. Even this can SOMETIMES be
  91. found on the drive. For external you will have to make all the above
  92. mentioned signals yourself in an interface board which will be located in the
  93. drive casing between to cable coming from the amiga and the drive. For schemes
  94. see FIGURE 1 of the iff picture.   
  95.  
  96. CONNECTING A HIGH DENSITY DRIVE: 
  97.  
  98. HOW IS THIS DRIVE MOUNTED BY THE SYSTEM ?
  99. Now we come to the part you have been looking for. For a High density drive to
  100. work with the amiga you need at least a kickstart 37.175 (2.0). There is
  101. however a bug only in the 37.175 kickstart. When you used the HD drive with a
  102. DD floppy and you change it back for a HD floppy you will still be in the DD
  103. mode so you will get a read error of the roottrack. The program HDFixer in
  104. aminet archive disk/misc/HDFixer.lzh will remove this bug. I haven't tried it
  105. because I have 2 other DD drives myself. How is a high density drive
  106. recognised by the system. The thing I didn't tell you with the double density
  107. drive is that the system isn't happy with testing the READY line once, no to
  108. be on the save side it does it only 32 times. If there is a HD disk in the
  109. drive it will not pull the READY line low the second time the SELECT line is
  110. low. For every even puls on the SELECT line no READY puls is given.
  111.  
  112. In a time diagram it looks like this:
  113.  
  114.     SELECT  ~~~~~~|__|~~~~~~|__|~~~~~~|__|~~~~~~|__|~~~~~ amiga signal
  115.  
  116.     READY   ~~~~~~|__|~~~~~~~~~~~~~~~~|__|~~~~~~~~~~~~~~~ signal from drive
  117.  
  118. When the READY signals are put in a long integer it will give the following
  119. result:
  120.     FFFFFFFF    = no drive connected (READY stays high, all 1's)
  121.     00000000    = double density disk in HD drive or double density drive 
  122.     AAAAAAAA    = high density disk in HD drive (READY alternating 1010)
  123.     55555555  = Oops, made a design error on the board now there is a 5.25   
  124.                  inch amiga drive connected.
  125. I found these definitions disk.h in resources of the includes for 2.0. There
  126. is also a flag for DRIVE3_5_150RPM mentioned in trackdisk.h
  127.  
  128. In the package is also a little program (=DriveID) I made which checks all
  129. four units for their ID so you can check out if your board is working. Maybe
  130. you find out you have a HD drive already. Some guys are always lucky (or are
  131. they just stupid ?). 
  132.  
  133. HOW DO YOU MAKE THIS ?
  134. The signals described with the DD drive are all working in the same way as the
  135. HD drive. Exception is of course the drive ID or mounting signal. I generate
  136. the signal for HD drive by using a flipflop as you can see in figure 2.
  137. Remember that when you are making this an internal drive you can ignore the
  138. flipflop motor part. Also in case of a HD drive do NOT place the jumper on the
  139. amiga motherboard mentioned in the double density drive part or you will end
  140. up with a perfect running DD drive (No HD ID can come through if the
  141. motherboard constantly is pulling down the READY line, this is also the case
  142. for a genuine amiga HD drive, the FB 357 A or the slim one the FZ 357 A). If
  143. someone bought the chinon FB 357 A and he says it doesn't format HD disks,
  144. just tell him/her it will probably gives read/write errors with DD disk also
  145. (LIE!) and you swap it for you own DD drive). 
  146. On this HD interface board is no diskchange signal so don't forget to make
  147. this. In order to make the HD drive work you need also to halve the speed of
  148. the drive motor ( 300 rpm to 150 rpm). The motor of the drive is a step motor
  149. this means it needs a puls to turn the motor an angle further. Normally there
  150. is a quartz crystal and a IC on the print where the motor is. The IC is
  151. regulating the speed of the motor on the timebase of this crystal. You will
  152. have to remove the crystal from the board by first desoldering the two pins
  153. and then remove it (it will probably be glued to the board). Then install the
  154. crystal on your interface board (you left space for it ?). The board will have
  155. a oscillator circuit on it so it works now there too. Then the signal is fed
  156. through a flipflop which will divide the signal by two, both signals will go
  157. through some NAND gates who are networked to change from the normal frequency
  158. to the halved frequency (from the flipflop) by using a tap on the HD switch of
  159. the drive. It will be right under the HD hole in a high density disk (the one
  160. on the other side of the write protected hole). Someone said to me there is a
  161. problem connecting the oscillator out signal back to the drive motor chip
  162. because when the crystal is removed there are two connections. Well.. Eeh.
  163. Just pick one with your eyes closed and pray. Just kidding ! Actually you can
  164. use both of them but NOT at the same time. The crystal was part of a
  165. oscillator circuit just like the one you made. So it will only work when there
  166. is a high enough voltage difference between those pins. I my case it didn't
  167. matter which one I choosed. You could try connecting the other pin to GROUND
  168. for eliminating disturbing signals but you could also weaken the frequency
  169. signal to much that way(I didn't use this). Try it out ! 
  170. For the HD drive there are the scheme is shown in figure 2. You can see by the
  171. dotted areas that I use a NAND gate in combination with a inverter. I use this
  172. to get around with no more then 5 ICs. If anyone can do it better let me know!
  173. I am thinking of using other ICs or even replace the whole thing by one PAL IC
  174. and 74LS74 (flipflop).
  175.  
  176. I developped the whole interface board with a solder iron and a multimeter. I
  177. am also not an expert in making oscillator circuits. I think the crystal is
  178. working at a frequency of about 1 Mhz. I don't know if my circuit has the
  179. same frequency as when the crystal was working on the drive board. You are
  180. also connecting an oscillating wire to another oscillator circuit on the drive
  181. board which could interfere with each other. Since I don't have an
  182. oscilloscoop I can't check this. If you are having trouble with the drive
  183. speed you could try removing some capacitors on the oscillator board of the
  184. drive. I also have recently found an alternative (up to 2Mhz) for the
  185. oscillator circuit on the interface board, this one will work with only one
  186. inverter so maybe that is just what you needed if you are short of one
  187. inverter. 
  188.  
  189. In HD mode the drive doesn't give any bits through to the amiga. It won't
  190. accept any data for writing a track either. This is because the drive knows
  191. the disk is not spinning at its normal speed. This is simply eliminated by
  192. glueing another small magnet or a small piece of magnet just on the opposite
  193. site of the original one on the flywheel. Now there are two index signals in
  194. one revolution so the drive chips think the motor is spinning at normal speed.
  195. It only checks if the motor is going too slow so it doesn't matter a thing
  196. that there is apparently twice the normal speed in DD mode. I even heard that
  197. a original amiga high density drive also has more than one index pulse per
  198. revolution. (The index signal could be generated by an optical sensor, in that
  199. case drill an extra hole in the flywheel.) I have recently heard of some
  200. people thinking it won't work because for high density disks you need a higher
  201. writing current then with double density drives. This might be the case, but
  202. since the drive hardware is thinking it has a high density floppy in it will
  203. choose a higher current automatically.  
  204.  
  205. SOME WORDS ABOUT THE FIGURES.
  206. For the flipflops I used the 74S74 chips. They are trigger with a positive
  207. egded clock signal (thats why I invert the SELECT signal)and the SET and RESET
  208. (or CLEAR) signals are LOW ACTIVE !  
  209. As I already pointed out nearly all drive signals are designed with a low
  210. active puls. However I don't know if the signal coming directly from the drive
  211. switches, like DISK PRESENT and HD switch, will act in the same way. So before
  212. you start soldering, check out if they work the same as in my scheme. If not
  213. simple use an inverter or rewire the scheme to correct this.
  214.  
  215. CONNECTIONS TO PC DRIVE
  216. I checked out some books and magazines to give you some detail on the drive
  217. connector. Only the even number connections are used for signals. The odd
  218. numbered pins are connected to ground.
  219.  
  220. PIN 2: DISKCHANGE
  221. Output signal. This is a tricky one to start with. It is used for a
  222. number of different signals by each manufactorer. The first one is the
  223. most widely spread used. DISKCHANGE is perfect to use for the amiga
  224. diskchange signal.
  225. HIGH DENSITY/DOUBLE DENSITY input signal to switch drive motor between
  226. 300 and 360  rpm. Only used for 5 1/4 inch floppy drives.
  227. IN USE input signal for letting the drive know something is coming up
  228. soon. Also used for driving led at front of the drive.
  229. HEAD LOAD input signal for the drive to put the head to the disk and pre
  230. magnetise it. (Rarely used)
  231. PIN 4: IN USE
  232. Another pin use in more ways than one
  233. IN USE is the most likely candidate. see pin 2 (Sometimes you can have
  234. DISKCHANGE and HEAD LOAD). With internal Amiga drives IN USE is always
  235. connected to the MTRX signal.
  236. PIN 6: DRIVE SELECT 3
  237. see PIN 10. Pin 6 is sometimes used for the READY signal (see PIN 34).
  238. PIN 8: INDEX 
  239. output signal will be low when the magnet on the flywheel of the drive
  240. passes the Hall sensor (when drive SELECT is low).
  241. PIN 10: DRIVE SELECT 0 
  242. input signal for selecting the last drive which is then connected to this
  243. line. You will have to get the drive jumpers set to the drive select you
  244. want. Normally the drives are left with the jumper on SELECT 0 and the
  245. cable is twisted to change select lines (Yes that's why there is a
  246. twist). 
  247. PIN 12: DRIVE SELECT 1 see pin 10
  248. PIN 14: DRIVE SELECT 2 see pin 10
  249. PIN 16: MOTORON 
  250. input signal switches to motor on. Sometimes the amiga way of switching
  251. on the motor with DRIVE SELECT can be set with a jumper on the drive.
  252. PIN 18: DIRECTION SELECT
  253. Input signal. When low stepping direction of the head is to the axis
  254. (inside) of the disk. High is to the outside of the disk.
  255. PIN 20: STEP
  256. Input signal. With every low pulse the head is stepped to the next (by
  257. pin 18 determined) track when the drive is selected.
  258. PIN 22: WRITE DATA
  259. Input signal. Here the data to be written on the track is coming in from
  260. the computer.
  261. PIN 24: WRITE GATE
  262. Input signal. When low the data from pin 22 is written on the disk.
  263. PIN 26: TRACK 0
  264. Output signal. When the head is above the first track this line will be
  265. low when SELECT is active.
  266. PIN 28: WRITE PROTECT
  267. Output signal. When the write protect hole is open (disk is write
  268. protected) and SELECT is low this signal will be low.
  269. PIN 30: READ DATA
  270. Output signal. When SELECT is low then the data on the track is written
  271. to this line.
  272. PIN 32: SIDE 1 SELECT
  273. Input signal. When the SELECT is active this line set the head (upper or
  274. lower) on which side is selected.
  275. PIN 34: READY
  276. Output signal. Low when SELECT is active and the disk is spinning at the
  277. right speed (INDEX signal) or, in a older simpler version, if a disk is
  278. in the drive. It tells the computer that the drive ready to do a read or
  279. a write of the track. The signal is high when the drive is empty (no
  280. disk), when the motor isn't running or the motor is running too slow.
  281. Also very shortly after a Head step signal it is high (15 ms).  
  282. You see in this way the drive is not mounted by the amiga! 
  283. (Rarely used as DISKCHANGE or IN USE).
  284.  
  285.  
  286. EPILOG
  287. If you post me your experience and questions about this about this hack I will
  288. then put them in this document. That way I can ensure a better working
  289. alternative. If you just don't understand certain parts of this document
  290. please send me a Email and I will try to enlighten you (or correct my error).
  291. Also tell if parts of the information are missing. Because of my poor
  292. equipment I am relying on your contribution to perfect this hack( or is it
  293. contribution to this perfect hack?). I don't have  much sparetime for testing
  294. out your suggestions. I have changed my expirimental board so much that when I
  295. point my soldering iron to it, it will probable desingrate. My board consists
  296. of an island print with wires soldered to make the connections. The wires run
  297. over IC so it is difficult to make changes.
  298. Apart from my DriveID program you can use the Drivetest program which you can
  299. find in the aminet archive in the directory hard/test (DriveTest.lha; 16095
  300. bytes). The only program which is missing, is the one which tells you how fast
  301. your drive is spinning in both DD and HD mode. This is extremely usefull for
  302. people who don't have a scope or frequence counter (like me!). It can be done
  303. by watching the INDEX signal and measure the time intervals get an average and
  304. recalculating them into revolutions per minute. So if anyone knows how to do
  305. this, mail it to me and I will include it in the package. Along with other
  306. ideas and amendments I will put it then on aminet.   
  307.  
  308.  
  309.  HAPPY HACKIN' 
  310.  
  311. Dick Diederik 
  312.  
  313. Email:     Dick.Diederik@Medew.ENTO.WAU.NL
  314.  
  315. Snail mail: 
  316. Dick Diederik 
  317. van Doesburglaan 32 
  318. 6708 MC Wageningen
  319. The Netherlands