home *** CD-ROM | disk | FTP | other *** search
/ CBM Funet Archive / cbm-funet-archive-2003.iso / cbm / documents / disk-drives / 1541-tester.prg / 1541-tester.a7ae (.txt)
Encoding:
Commodore BASIC  |  1993-01-16  |  10.0 KB  |  253 lines

  1. 10 vs$="970127.a": rem 1541 alps drive checkout, needs c64 computer
  2. 20 rem save $801-3000, binary $2e00-$3000:speed@2e00,led@2ec0,dwnld@2f00
  3. 30 :
  4. 40 rem to load into pet:  poke41,8:poke8*256,0:new-then load pgm
  5. 50 rem save binary (2a00-3000) to disk and reload when finished modifying
  6. 60 rem final save must be from monitor 0801 to 3000
  7. 70 :
  8. 80 print"[147]":ie=2*4096+15*256:rem dwnlodr @$2f00
  9. 90 poke53280,1:poke53281,1:printchr$(28):printchr$(142):remgrey,red,caps
  10. 100 o0$=chr$(0):o1$=chr$(1):o3$=chr$(3):t6$=chr$(16):t7$=chr$(17):ff$=chr$(255)
  11. 110 nc=4:ch$(1)="@":ch$(2)="y":ch$(3)="n":ch$(4)="r":ch$(5)=" "
  12. 120 ch=08:fl$="failed":ps$="passed"
  13. 130 ll$="[164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164]"
  14. 140 mq=0:s=0:gosub610:printtab(7)" ***     menu     ***"
  15. 150 printtab(7)"1 - led test"
  16. 160 printtab(7)"2 - write protect test"
  17. 170 printtab(7)"3 - stepper motor test"
  18. 180 printtab(7)"4 - motor speed test"
  19. 190 printtab(7)"5 - alignment test"
  20. 200 printtab(7)"6 - stop limit test"
  21. 210 printtab(7)"7 - read / write test"
  22. 220 printtab(7)"8 - alter system address:";ch
  23. 230 printtab(7)"9 - ends program."
  24. 240 print"        space for all tests [146]"
  25. 250 printtab(7)"your selection?"
  26. 260 geta$:ifa$=""then260
  27. 270 ifa$=" "thengosub2460:goto300
  28. 280 s=val(a$):mq=1:ifs<1 or s>9 then 260
  29. 290 gosub2460:on s goto 300,310,320,330,340,350,360,2450,390
  30. 300 s=1:gosub970:rem led
  31. 310 s=2:gosub1230:rem wr prot
  32. 320 s=3:gosub680:rem hd step
  33. 330 s=4:gosub1410:rem mtr speed
  34. 340 s=5:gosub1620:rem align
  35. 350 s=6:gosub1920:rem limit
  36. 360 s=7:goto2330:rem read/wrt
  37. 370 print"[147]end of drive test":fori=1to700:next:run
  38. 380 run
  39. 390 end
  40. 400 geta$:ifa$<>""then400
  41. 410 geta$:ifa$=""then410
  42. 420 ifin=0thenii=0:goto450
  43. 430 ifa$<>ch$(in)then410
  44. 440 in=0:return
  45. 450 ii=ii+1:ifii>ncthen410
  46. 460 if ch$(ii)<>a$then450
  47. 470 return
  48. 480 print"do not insert a disk for this step.":return
  49. 490 print"insert an "fd$" disk for this step.":return
  50. 500 print"   press 'space' when ready":in=5:goto 400
  51. 510 gosub520:goto400
  52. 520 printleft$(ll$,len(ou$))
  53. 530 print""ou$"":return
  54. 540 tk=1:jb=12:rem bump
  55. 550 print#15,"m-w"chr$(tj)chr$(hj)chr$(2)chr$(tk)o0$
  56. 560 print#15,"m-w"chr$(lj)chr$(hj)o1$chr$(jb*16+dr)
  57. 570 print#15,"m-r"chr$(lj)chr$(hj):get#15,d$:d=asc(d$+o0$):ifd>127then570
  58. 580 ifjb=12thenfori=1to2500:next
  59. 590 return
  60. 600 print""ou$:return
  61. 610 print tab(10)"[147]  1541 alps drive check & alignment"
  62. 620 print tab(10)"program "vs$:print
  63. 630 if s thenprint"step"s"[146]";
  64. 640 return
  65. 650 print"press space to continue, 'r' to repeat"
  66. 660 nc=5:gosub400:oniigoto380,660,660
  67. 670 nc=4:ii=ii-4:return
  68. 680 gosub610:rem head stepper test
  69. 690 hf=0:print"drive"dr"head stepper test":gosub480
  70. 700 print" press 'space' when ready":in=5:gosub400
  71. 710 gosub540:print"[147]the stepper pulley must now be"
  72. 720 print"positioned for a clearance of from"
  73. 730 print"0.25 to 0.40 mm (0.010 to 0.020 in)"
  74. 740 print"between the pulley stop and the step of"
  75. 750 print"the pulley."
  76. 760 ou$="is the clearance correct? (y/n)":gosub510
  77. 770 oniigoto380,780,910,710
  78. 780 print"the head should move to the inside"
  79. 790 tk=35:jb=11:gosub550
  80. 800 ou$="did the head move to the inside? (y/n)"
  81. 810 gosub510
  82. 820 oniigoto380,830,910,810
  83. 830 print"the head should move to the outside"
  84. 840 tk=1:jb=11:gosub550
  85. 850 ou$="did the head move to outside? (y/n)"
  86. 860 gosub510
  87. 870 oniigoto380,880,910,860
  88. 880 print"the head should move smoothly"
  89. 890 forj=1to3:tk=35:jb=11:gosub550:tk=1:gosub550:next
  90. 900 ou$="did head move smoothly? (y/n)":gosub510:oniigoto380,920,910
  91. 910 hf=1
  92. 920 ov$=" head stepper test"
  93. 930 ou$=ps$+ov$:ifhfthenou$=fl$+ov$
  94. 940 gosub600:gosub650:ifiiandmqthen370
  95. 950 ifiithenreturn
  96. 960 goto710
  97. 970 gosub610:rem led test
  98. 980 lf=0:print"drive"dr"led test":gosub480
  99. 990 gosub2270:rem led pgm @$2ec0 to $3c0 (move$2e00+to$300+)
  100. 1000 ou$="is led off ? (y/n)"
  101. 1010 gosub510:oniigoto380,1020,1170,1010
  102. 1020 ou$="is led on ? (y/n)":gosub520
  103. 1030 print#15,"m-w"chr$(197)o3$chr$(1)chr$(169):rem lda # to $3c5
  104. 1040 print#15,"m-e"chr$(192)o3$:rem exec $3c0
  105. 1050 geta$:ifa$<>"y"anda$<>"n"then1040
  106. 1060 ifa$="y"then1080
  107. 1070 ifa$="n"then1170
  108. 1080 print"the led should blink"
  109. 1090 fori=1to4
  110. 1100 t=ti
  111. 1110 print#15,"m-e"chr$(192)o3$:rem exec $3c0
  112. 1120 ifti-t<3 then1110
  113. 1130 t=ti
  114. 1140 ifti-t<20then1140
  115. 1150 next:ou$="did the led blink ? (y/n)"
  116. 1160 gosub510:oniigoto380,1180,1170,1160
  117. 1170 lf=1
  118. 1180 ov$=" led test":ou$=ps$+ov$
  119. 1190 iflfthenou$=fl$+ov$
  120. 1200 gosub600:gosub650:ifiiandmqthen370
  121. 1210 ifiithenreturn
  122. 1220 goto970
  123. 1230 gosub610:remwp sw
  124. 1240 print"write protect switch adjustment:"
  125. 1250 gosub2270:rem led pgm @$2ec0 to $3c0 (move$2e00+to$300+)
  126. 1260 print"with no disc in drive, the led should"
  127. 1270 print"be off.  with a disk inserted halfway,"
  128. 1280 print"the led should be on.  adjust switch"
  129. 1290 print"to get the proper response."
  130. 1300 ou$=" press space when done ":gosub520
  131. 1310 print#15,"m-e"chr$(192)o3$:rem exec $3c0
  132. 1320 geta$:ifa$<>" "then1310
  133. 1330 ou$="does led show correctly? (y/n)":gosub510
  134. 1340 ov$=" write-protect[160]switch test"
  135. 1350 oniigoto380,1370,1360,1230
  136. 1360 ou$=fl$+ov$:goto 1380
  137. 1370 ou$=ps$+ov$
  138. 1380 gosub520:gosub650:ifiiandmqthen370
  139. 1390 ifiithen return
  140. 1400 goto1230
  141. 1410 gosub610:in=0:print"motor speed adjustment"
  142. 1420 gosub2270:remspd @$2e00 to $300
  143. 1430 gosub490:gosub540:gosub500
  144. 1440 print"[145][145][145] doing speed check on drive"
  145. 1450 print"adjust speed deviation to 0 ms"
  146. 1460 print"press 'space' when speed adjusted"
  147. 1470 print#15,"m-w"chr$(5)o3$o1$chr$(11):rem wr md
  148. 1480 tk=tv:jb=14:gosub550:rem start
  149. 1490 fori=1to4:print#15,"m-r"chr$(6+i)o3$:get#15,b$:sv(i)=asc(b$+o0$):next
  150. 1500 ifsv(3)=0orsv(4)=0then1610
  151. 1510 sa=(256*sv(4)+sv(2)+2-2000):sb=(256*sv(3)+sv(1)+2-2000)
  152. 1520 sd=int((sa+sb)/20+.5):sp=abs(sd)
  153. 1530 print"[145]speed deviation is "sd "[157] ms     "
  154. 1540 iffp=0andsp<1thenprint"speed ok as is":goto1580
  155. 1550 fp=1:geta$:ifa$=" "thenprint"[147]":goto1580
  156. 1560 ifsp>5then1470
  157. 1570 print#15,"m-w"chr$(5)o3$o1$chr$(78):goto1480:rem rd mode
  158. 1580 gosub540:gosub650:ifiiandmqthen370
  159. 1590 ifiithenreturn
  160. 1600 goto1410
  161. 1610 print"test failed--check disk":fori=1to1000:next:goto1410
  162. 1620 gosub610:print"head alignment"
  163. 1630 print"put alignment disk 970016-01 in drive"
  164. 1640 print"put scope probes on pins 7 and 8 of"
  165. 1650 print"uf3 (short board) or uh7 (long board)"
  166. 1660 print"differentally added at 50 mv/cm."
  167. 1670 print"trigger at pin 9 of uc2 (long board)"
  168. 1680 print"or pin 37 of uc1 (short board)."
  169. 1690 print"set sweep speed at 20ms per cm."
  170. 1700 gosub540:gosub500
  171. 1710 jb=11:print"[147]the drive is now on track 17."
  172. 1720 print"for checking purposes, the lobe sizes"
  173. 1730 print"must be within 30% of each other."
  174. 1740 print"for alignment, adjust the stepper such"
  175. 1750 print"that the lobe sizes are within 15% of":print"each other."
  176. 1760 print"typing 'h' will offstep the head for"
  177. 1770 print"hysterisis check."
  178. 1780 print"when the lobes reappear check for equal"
  179. 1790 print"lobe size.  if lobe sizes are unequal"
  180. 1800 print"adjust to split the difference."
  181. 1810 print"type 'b' to restore the drive."
  182. 1820 print"press 'space' when done."
  183. 1830 geta$:if a$=""thentk=17:gosub550:goto1830
  184. 1840 if a$="h"thenhy=1-hy:goto1880
  185. 1850 if a$=" "then1900
  186. 1860 if a$="b"thengosub540:jb=11:goto1830
  187. 1870 goto1830
  188. 1880 ifhythentk=20:gosub550:goto1830
  189. 1890 tk=14:gosub550:goto1830
  190. 1900 ifmqthen370
  191. 1910 return
  192. 1920 gosub610:rem stop adj
  193. 1930 geta$:ifa$<>""then1930
  194. 1940 cf=0:print"stepper limit stop check":gosub480:gosub500
  195. 1950 gosub540:tk=1:jb=11
  196. 1960 print"[147]there should be a clearance of from"
  197. 1970 print"0.25 to 0.40 mm (0.010 to 0.020 in)"
  198. 1980 print"between the stop and the step on the":print"pulley."
  199. 1990 print"watch the pulley and press the 's' key."
  200. 2000 print"the pulley must rotate clockwise"
  201. 2010 print"against the stop.  if the pulley does"
  202. 2020 print"not rotate or rotates counterclockwise"
  203. 2030 print"then the stop is not set correctly."
  204. 2040 geta$:if a$<>"s"thengosub550:goto2040
  205. 2050 print#15,"m-w"chr$(74)o0$o1$ff$
  206. 2060 print#15,"m-w"chr$(32)o0$o1$chr$(64)
  207. 2070 ou$="did correct movement occur? (y/n/r)":gosub520
  208. 2080 geta$:ifa$<>"y"anda$<>"n"anda$<>"r"thengosub550:goto2080
  209. 2090 print"[147]":ifa$="r"then1950
  210. 2100 ifa$="n"then2210
  211. 2110 print"second test of stop limit adjustment"
  212. 2120 print"watch the pulley and press the 's' key."
  213. 2130 print"the pulley must not move.  if it does,"
  214. 2140 print"then the stop is not set correctly."
  215. 2150 geta$:if a$<>"s"thengosub550:goto2150
  216. 2160 print#15,"m-w"chr$(74)o0$o1$ff$
  217. 2170 print#15,"m-w"chr$(32)o0$o1$chr$(64):gosub520
  218. 2180 geta$:ifa$<>"y"anda$<>"n"anda$<>"r"thengosub550:goto2180
  219. 2190 print"[147]":ifa$="r"then1950
  220. 2200 ifa$="y"then2220
  221. 2210 cf=1
  222. 2220 ov$=" stop limit adjustment":ou$=ps$:ifcfthenou$=fl$
  223. 2230 ou$=ou$+ov$:gosub600
  224. 2240 gosub650:gosub540:ifiiandmqthen370
  225. 2250 ifiithen return
  226. 2260 goto1920
  227. 2270 rem downloader
  228. 2280 pokeie+3,0:pokeie+4,46:rem $2e00
  229. 2290 pokeie+5,0:pokeie+6,3:pokeie+7,1:rem1pg to $300
  230. 2300 pokeie+8,ch:sysie
  231. 2310 ifstthenprint"download failed":end
  232. 2320 return
  233. 2330 gosub610:print"write/read tests":gosub490:gosub500
  234. 2340 print"[147]newing test ";
  235. 2350 print#15,"n0:f15":gosub2440:ifathenprint:print"failed  "b$:goto2420
  236. 2360 printb$
  237. 2370 open7,ch,7,"#":restore:print"write/read tests"
  238. 2380 readtr:iftr=-1then2420
  239. 2390 print#15,"u2";7;dr;tr;1
  240. 2400 print"write/read on track"tr;:gosub2440:ifa thenprint"";
  241. 2410 printb$:goto2380
  242. 2420 close7:gosub650:ifiithen370
  243. 2430 goto2330
  244. 2440 input#15,a,b$:return
  245. 2450 input"[147]system address  8[157][157][157]";ch:goto140
  246. 2460 sy=0:close15:open15,ch,15:fd$="f15"
  247. 2470 print#15,"m-r"ff$ff$:get#15,a$:a=asc(a$+o0$)
  248. 2480 print#15,"m-r"chr$(254)ff$:get#15,b$:b=asc(b$+o0$)
  249. 2490 ifa=254andb=103thensy=15:tv=36:bf=3:lj=0:hj=0:tj=6:return
  250. 2500 print"system not identifiable"
  251. 2510 print"return code for $fffe and $ffff is:"b,a:end
  252. 2520 data 1,5,10,15,20,25,30,35,-1:rem r/w trks
  253.