home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / Reference / DevCon / Washington_1988 / Devcon_Extras / Tech_Articles / Disk_Drives < prev    next >
Encoding:
Text File  |  1992-08-27  |  4.3 KB  |  117 lines

  1.  
  2. Disk Drives - what YOU are doing wrong!
  3.  
  4. * Copyright 1988 Commodore-Amiga, Inc.
  5. * This information is provided "as is"; no warranties are made.  All 
  6. * use is at your own risk. No liability or responsibility is assumed.
  7. * Permission granted to reproduce, provided this notice remains.
  8.  
  9.  
  10. A distressing number of our third party hardware and software
  11. developers have been using the floppy disk drives in an incorrect
  12. manner.  If you use the trackdisk.device you are safe.  If you go
  13. directly to the hardware, or build hardware, then this article is
  14. for you.  
  15.  
  16.  
  17. For Hardware types:
  18.  
  19. 1> The disk drive light should not flash on and off during
  20. access.  Our drive activity light reflects the state of the
  21. motor.  Typically the LED signal is driven by IN_USE (pin 4).
  22.  
  23. 2> For compatibility with future systems, we require that drives
  24. refuse to step past track zero.  That is, if the head is already
  25. at zero, and an outward step is received, it should not move the
  26. head.  The drive must still reset it's "DISKCHANGE" latch,
  27. however.
  28.  
  29. 3> The critical specifications for our 90mm (3.5") drives are:
  30. 3ms track-to-track.  15ms settling time.  >80% radial alignment
  31. using a Dysan Alignment disk.  500ms motor spinup.  800ms maximum
  32. power on delay.
  33.  
  34.  
  35. For Software types:
  36.  
  37. This part is primarily directed at people who write custom
  38. boot-loaders for game software.  Due to defective loaders, there
  39. are thousands of Amiga owners who can't load some games, and will
  40. NEVER BE ABLE TO BUY THEM.
  41.  
  42. The ultimate source for information on drive timing comes from
  43. the manufacturer's specifications.  This article simply
  44. highlights the most misused points.
  45.  
  46.  
  47. 1> Don't make bad assumptions.  For example; if you depend on the
  48. motor being on, turn it on before use.  Don't assume that your
  49. boot code will be entered with the disk drive or system in any
  50. reliable state.
  51.  
  52.  
  53. 2> **NEVER** use a loop like this for timing:
  54.  
  55.         move.w    #$1000,D0
  56. busy_wait    dbra        d0,busy_wait
  57.  
  58. This fails to produce accurate timing under a large number of
  59. circumstances.  The speed of the above loop depends on what CPU
  60. is installed in the system, what video mode is selected, what type of memory the program is in, in what relation to vertical
  61. blank the code executes in, what the blitter is doing, what
  62. interrupts are enabled and more other factors than you want to
  63. think about.
  64.  
  65. The 8520 chip provides fast, easy timing.  See the companion
  66. article entitled "How to waste time".
  67.  
  68.  
  69. 3> The STEP line must be used as a low-going pulse.  The
  70. direction must be set up FIRST, with a separate write to the
  71. register.  A typical use would be:
  72.  
  73.         or.b      #%00000010,$bfd100    ;Set up direction
  74.         and.b  #%11111110,$bfd100    ;Pulse low
  75.         nop                        ;Wait a bit
  76.         nop                        ; "   "  "
  77.         or.b      #%00000001,$bfd100    ;Set it high again
  78.         ;-- now wait 3 miliseconds for the head to
  79.         ;-- get to the next track
  80.  
  81. We specify that our drives must get to the next track within 3
  82. miliseconds.  Some drives will step considerably faster, others
  83. will fail at or before 2.8 miliseconds.  When the direction of
  84. step is changed, the settling time must also be added (a total
  85. minimum delay of 18 miliseconds).
  86.  
  87. Note that the TRACK ZERO sensor will not be valid until the head
  88. actually reaches the track.
  89.  
  90.  
  91. 4> When turning on the motor, wait for the READY signal to go low
  92. before reading or writing (steps are ok before then).  Note that
  93. READY is only valid when the motor signal is ON.
  94.  
  95.  
  96. 5> To determine if a disk is in the drive, look at the DISKCHANGE
  97. signal.  If it is low, the disk has been removed (and possibly
  98. inserted again) since the last check.  Step the head to reset the
  99. latch and examine the current state.
  100.  
  101.  
  102. 6> Some code uses an extra track or two for storage or copy
  103. protection.  We will not guarantee that our drives will have more
  104. than the normal 80 tracks.  We will say that using one extra
  105. track is rather safe, two tracks is probably ok, and three tracks
  106. is a very bad idea.
  107.  
  108.  
  109. 7> After a disk write DMA has finished, a delay of 1.2
  110. miliseconds is required before any other operations (drive
  111. select, step, head change, etc.).  The type of disk drives we use
  112. have a gap between the erase head and the read-write head.  The
  113. disk drive keeps the erase head enabled after the end of write gate to compensate for the gap.  Failure wait out the delay may
  114. result in writing over innocent data on other tracks or sides.
  115.  
  116.             -Bryce Nesbitt
  117.