home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / PROGRAMS / CLOCKK / MDCLCK13.LBR / MDCLOCK.WZ / MDCLOCK.WS
Text File  |  2000-06-30  |  11KB  |  237 lines

  1.                        M─-CLOCK
  2.                           or
  3.            ┴ chea≡ clocδ fo≥ thσ rev« ▓ MDs
  4.  
  5.                           by
  6.                       Mikσ Allen
  7.                  400╩ Summe≥ WinΣ Way
  8.                  Gleε Burnie¼ M─ 21061
  9.                     (301⌐ 76╕-1721
  10.  
  11.      Fo≥ ß lonτ timσ ╔ haΣ beeε wonderinτ t∩ wha⌠ gooΣ ì
  12. usσ ╔ coulΣ pu⌠ thσ I/╧ expansioε heade≥ (tha⌠ strangσ ì
  13. lookinτ ▓ row≤ oµ 2░ pin≤ each⌐ iε m∙ rev« ▓ MD3«  Theε ì
  14. iε thσ MarcΦ 198╢ issuσ oµ BYTE¼ Ciarcia'≤ Circui⌠ ì
  15. Cellarô tooδ ß looδ a⌠ rea∞-timσ clocks.
  16.  
  17.      "Aha,ó se· I¼ "jus⌠ wha⌠ ╔ need.ó  S∩ ╔ tooδ ß ì
  18. looδ a⌠ thσ schematiπ fo≥ thσ clocδ tha⌠ useΣ ß 825╡ ì
  19. Programmablσ Periphera∞ Interfacσ anΣ thσ MSM583▓ ì
  20. clock«  I⌠ lookeΣ t∩ mσ tha⌠ al∞ ╔ haΣ t∩ d∩ t∩ makσ i⌠ ì
  21. worδ witΦ thσ I/╧ expansioε connecto≥ wa≤ t∩ inver⌠ thσ ì
  22. RESE╘¡ (rese⌠ not⌐ signal.
  23.  
  24.      S∩ ofµ ╔ raε t∩ m∙ junquσ bo° (╔ havσ higΦ clas≤ ì
  25. junk!⌐ anΣ m∙ catalog≤ t∩ seσ wherσ ╔ coulΣ ge⌠ wha⌠ ì
  26. thσ cheapest«  I⌠ seemeΣ tha⌠ JD╥ Microdevice≤ (122┤ S« ì
  27. Bascoφ Ave.¼ Saε Jose¼ C┴ 95128⌐ haΣ thσ bes⌠ price≤ oε ì
  28. al∞ thσ critica∞ parts«  Ofµ wen⌠ aε orde≥ t∩ them«  ì
  29. HaΣ ╔ purchaseΣ thσ part≤ tha⌠ ╔ duτ ou⌠ oµ m∙ junδ bo° ì
  30. froφ loca∞ source≤ ╔ woulΣ havσ spen⌠ ß tota∞ oµ ì
  31. $18.69«  ╔ spen⌠ ß littlσ less.
  32.  
  33.      Thσ circui⌠ i≤ baseΣ oε thσ MSM583▓ clocδ chi≡ ì
  34. froφ OKI«  Thσ thinτ i≤ ß ver∙ olΣ chi≡ anΣ i≤ ver∙ ì
  35. slo≈ bu⌠ ha≤ thσ advantagσ oµ beinτ cheap«  I⌠ wil∞ ruε ì
  36. oε a≤ littlσ a≤ 2.▓ volt≤ anΣ draw≤ ver∙ littlσ powe≥ ì
  37. iε thσ standb∙ mode«  Idea∞ fo≥ batter∙ bacδ-up.
  38.  
  39.      Thσ MSM583▓ i≤ organizeΣ abou⌠ ß ┤ bi⌠ bu≤ ì
  40. structure«  (Remembe≥ thσ 4004?⌐  I⌠ ha≤ ┤ addres≤ anΣ ì
  41. ┤ datß lines«  Therσ arσ als∩ READ¼ WRITE¼ HOL─ anΣ ì
  42. Chi≡ Selec⌠ lines«  Thσ function≤ oµ READ¼ WRIT┼ anΣ ì
  43. Chi≡ Selec⌠ arσ obvious«  Thσ HOL─ linσ i≤ ß littlσ ì
  44. strange«  I⌠ stop≤ thσ clockí  ╔ supposσ therσ arσ use≤ ì
  45. fo≥ i⌠ wheε reading¼ bu⌠ ╔ couldn'⌠ finΣ any«  Whilσ ì
  46. settinτ thσ clock¼ i⌠ i≤ useΣ t∩ sto≡ thσ clocδ unti∞ ì
  47. yo⌡ wan⌠ i⌠ t∩ start«  That'≤ useful.
  48.  
  49.      Thσ addresse≤ t∩ thσ MSM583▓ froφ 00╚ througΦ 0C╚ ì
  50. arσ useΣ t∩ addres≤ 1│ fou≥ bi⌠ register≤ withiε thσ ì
  51. MSM5832«  Thesσ register≤ havσ ┤ bi⌠ value≤ a≤ follows:
  52. (NOTE║ Thesσ diffe≥ froφ thσ tablσ iε Ciarcia'≤ ì
  53. article«  ThrougΦ harΣ experiencσ ╔ havσ founΣ tha⌠ hσ ì
  54. i≤ wronτ anΣ thesσ arσ correct.)
  55. èADDRESSô   FUNCTIONô                 RANGE
  56. 0░        1≤ oµ second≤            ░->9
  57. 0▒        10≤ oµ second≤           ░->5
  58. 0▓        1≤ oµ minute≤            ░->9
  59. 0│        10≤ oµ minute≤           ░->5
  60. 0┤        1≤ oµ hour≤              ░->9
  61. 05
  62.  bit≤ 0,▒ 10≤ oµ hour≤             ░->2
  63.  bi⌠ ▓    AM(0)/PM(1⌐              ░->1
  64.  bi⌠ │    12(0)/024(1⌐ h≥ forma⌠   ░->1
  65. 0╢        Da∙ oµ thσ weeδ          ░->6
  66. 0╖        1≤ oµ da∙ oµ montΦ       ░->9
  67. 08
  68.  bit≤ 0,▒ 10≤ oµ da∙ oµ montΦ      ░->3
  69.  bi⌠ ▓    regular(0)/leap(1⌐ yea≥  ░->1
  70. 0╣        1≤ oµ month≤             ░->9
  71. 0┴        10≤ oµ month≤            ░->1
  72. 0┬        1≤ oµ year≤              ░->9
  73. 0├        10≤ oµ year≤             ░->9
  74.  
  75.  
  76.      T∩ reaΣ thσ MSM583▓ yo⌡ se⌠ thσ REA─ linσ higΦ anΣ ì
  77. senΣ ou⌠ aε address«  Theε yo⌡ wai⌠ ╢ useπ anΣ reaΣ thσ ì
  78. data«  Writinτ i≤ ß littlσ morσ difficult«  Yo⌡ senΣ ì
  79. ou⌠ thσ HOL─ line¼ wai⌠ 15░ useπ theε senΣ ou⌠ thσ ì
  80. address«  Wai⌠ ╢ useπ anΣ theε senΣ ou⌠ thσ data«  Se⌠ ì
  81. thσ writσ linσ higΦ fo≥ ▒ useπ anΣ theε bacδ low«  Dro≡ ì
  82. thσ holΣ linσ wheε yo⌡ wan⌠ thσ clocδ t∩ start.
  83.  
  84.      Sincσ i⌠ i≤ s∩ slow¼ i⌠ canno⌠ interfacσ directl∙ ì
  85. witΦ thσ Z8░ bus«  T∩ givσ yo⌡ aε example¼ i⌠ take≤ ╢ ì
  86. usec« fo≥ thσ datß t∩ bσ read∙ afte≥ thσ addres≤ i≤ ì
  87. sent«  Thi≤ i≤ mucΦ to∩ slo≈ fo≥ thσ bu≤ tha⌠ i≤ ì
  88. availablσ iε thσ MD«  Thσ workarounΣ i≤ t∩ usσ ß 825╡ ì
  89. t∩ buffe≥ thσ address¼ datß anΣ contro∞ lines«  ╔ stolσ ì
  90. thσ circui⌠ directl∙ froφ thσ Ciarciß article¼ usinτ ì
  91. thσ bottoφ ┤ line≤ oµ thσ 825╡ ┴ por⌠ a≤ bΘ-directiona∞ ì
  92. datß line≤ t∩ thσ MSM5832¼  thσ bottoφ ┤ line≤ oµ thσ ┬ ì
  93. por⌠ a≤ thσ addres≤ line≤ t∩ thσ MSM583▓ anΣ thσ to≡ ┤ ì
  94. line≤ oµ thσ ├ por⌠ a≤ thσ contro∞ line≤ t∩ thσ ì
  95. MSM5832«  Thi≤ wa∙ al∞ thσ timinτ caε bσ establisheΣ iε ì
  96. software«  Fo≥ instance¼ ╔ caε senΣ ou⌠ thσ addres≤ oε ì
  97. thσ ┬ port¼ wastσ ß littlσ timσ anΣ theε reaΣ thσ ì
  98. resul⌠ oε thσ ┴ port«  Inefficien⌠ usσ oµ thσ 8255¼ bu⌠ ì
  99. wh∩ cares«  ╔ decideΣ t∩ usσ thσ IO3░¡ signa∞ fo≥ thσ ì
  100. 825╡ chi≡ select«  Thi≤ mean≤ tha⌠ por⌠ ┴ i≤ a⌠ I/╧ ì
  101. locatioε 30H¼ por⌠ ┬ a⌠ 31H¼ por⌠ ├ a⌠ 32╚ anΣ thσ ì
  102. contro∞ fo≥ thσ 825╡ a⌠ 33H.
  103.  
  104.      Thσ onl∙ critica∞ par⌠ iε thσ circui⌠ i≤ thσ 1N34┴ ì
  105. diode«  Iµ yo⌡ mus⌠ substitute¼ makσ surσ yo⌡ usσ ß ì
  106. germaniuφ diodσ witΦ ß forwarΣ voltagσ dro≡ oµ 0.╡ ì
  107. volt≤ o≥ less«  ╔ useΣ ß piecσ oµ perµ boarΣ tha⌠ ╔ haΣ ì
  108. lyinτ arounΣ t∩ builΣ thσ clock«  Thσ 3x╡ perµ boarΣ ì
  109. tha⌠ ╔ cal∞ ou⌠ iε thσ part≤ lis⌠ i≤ ß littlσ large¼ ìèbu⌠ i⌠ caε bσ cu⌠ down«  ╔ useΣ ß littlσ ╡ minutσ epox∙ ì
  110. t∩ gluσ dowε thσ socket≤ anΣ thσ batter∙ holder«  ╔ ì
  111. stuffeΣ thσ variou≤ component≤ wherσ i⌠ lookeΣ likσ ì
  112. the∙ fi⌠ thσ bes⌠ anΣ theε poin⌠-t∩-poin⌠ wireΣ ì
  113. everythinτ usinτ #2╢ soliΣ wire«  I⌠ go⌠ ß littlσ ì
  114. tedious¼ especiall∙ solderinτ thσ 4░ conducto≥ ribboε ì
  115. cablσ t∩ thσ board«  Theε ╔ installeΣ thσ 4░ piε ì
  116. connecto≥ oε thσ enΣ oµ thσ ribboε cable«  ╔ founΣ thσ ì
  117. bes⌠ wa∙ t∩ d∩ thi≤ wa≤ t∩ pu⌠ ß couplσ block≤ oµ wooΣ ì
  118. iε ß visσ anΣ theε squeezσ thσ connecto≥ ont∩ thσ cablσ ì
  119. usinτ thσ vise«  Thσ wooΣ help≤ t∩ distributσ thσ forcσ ì
  120. evenl∙ acros≤ thσ connecto≥ anΣ als∩ protect≤ thσ ì
  121. connecto≥ itself«  Probabl∙ thσ easies⌠ wa∙ t∩ moun⌠ ì
  122. thσ boarΣ i≤ witΦ somσ foaφ tapσ tha⌠ i≤ sticδ oε botΦ ì
  123. sides«  Radi∩ Contro∞ modeler≤ usσ i⌠ alot«  It'≤ ì
  124. calleΣ 'serv∩ tapeº anΣ caε bσ founΣ a⌠ mos⌠ an∙ hobb∙ ì
  125. shop.
  126.  
  127.      Well¼ afte≥ ß couplσ oµ day≤ oµ tryinτ t∩ inducσ ì
  128. blindnes≤ iε m∙ alread∙ weaδ eyes¼ i⌠ wa≤ timσ t∩ tr∙ ì
  129. it«  ╔ pluggeΣ i⌠ in¼ beinτ ver∙ carefu∞ t∩ makσ surσ ì
  130. tha⌠ ╔ haΣ thσ connecto≥ orienteΣ correctly¼ anΣ ì
  131. starteΣ checkinτ voltages«  Beinτ ß chickeε a⌠ hear⌠ ╔ ì
  132. haΣ no⌠ installeΣ thσ chip≤ iε thσ boarΣ yet«  ì
  133. Everythinτ seemeΣ likσ i⌠ wa≤ wha⌠ i⌠ shoulΣ be¼ s∩ ╔ ì
  134. turneΣ ofµ thσ MD¼ pluggeΣ iε thσ chip≤ anΣ turneΣ thσ ì
  135. powe≥ bacδ on.
  136.  
  137.      Therσ i⌠ sat«  Thσ M─ workeΣ fine¼ bu⌠ ╔ wasn'⌠ ì
  138. surσ wha⌠ o≥ iµ thσ clocδ wa≤ doing«  Bacδ t∩ Ciarcia'≤ ì
  139. article«  Hσ haΣ ß BASI├ prograφ tha⌠ wa≤ supposeΣ t∩ ì
  140. allo≈ yo⌡ t∩ reaΣ anΣ se⌠ thσ clock«  ╔ pulleΣ ou⌠ m∙ ì
  141. pristinσ BASI├ disδ (╔ prograφ mostl∙ iε 'Cº o≥ Pascal⌐ ì
  142. anΣ entereΣ thσ program«  Well¼ thing≤ lookeΣ ok«  ╔ ì
  143. coulΣ se⌠ anΣ reaΣ thσ clock¼ althougΦ iε ß rathe≥ ì
  144. unusefu∞ format«  Theε ╔ noticeΣ tha⌠ thσ second≤ ì
  145. weren'⌠ settinτ properly«  Well¼ reall∙ thσ were«  Wha⌠ ì
  146. Ciarciß didn'⌠ tel∞ u≤ i≤ tha⌠ yo⌡ can'⌠ se⌠ thσ ì
  147. secondsí  Writinτ t∩ thσ second≤ anΣ 10≤ oµ second≤ ì
  148. register≤ reset≤ theφ t∩ zero«  OK¼ no≈ ╔ understooΣ ì
  149. that«  Thσ nex⌠ thinτ ╔ noticeΣ wa≤ that¼ accordinτ t∩ ì
  150. Ciarcia¼ thσ day≤ oµ thσ weeδ werσ supposeΣ t∩ bσ ß ì
  151. numbe≥ betweeε ▒ anΣ 7«  ╔ wa≤ checkinτ ou⌠ thing≤ likσ ì
  152. lea≡-year≤ anΣ 1▓ anΣ 2┤ hou≥ timσ format≤ anΣ ╔ haΣ ì
  153. se⌠ thσ da∙-oµ-thσ-weeδ t∩ 7«  I⌠ tickeΣ ove≥ anΣ wen⌠ ì
  154. t∩ 0í  Checkinτ somσ othe≥ article≤ tha⌠ ╔ havσ oε thσ ì
  155. MSM583▓ clocδ ╔ founΣ ou⌠ tha⌠ thσ da∙-oµ-thσ-weeδ ì
  156. reall∙ goe≤ betweeε ░ anΣ 6.
  157.  
  158.      So¼ ╔ starteΣ writinτ program≤ t∩ makσ nicσ prett∙ ì
  159. timσ anΣ datσ display≤ oε m∙ MDT60«  Thing≤ werσ goinτ ì
  160. swimmingl∙ unti∞ ╔ noticeΣ tha⌠ ever∙ timσ ╔ presseΣ ì
  161. thσ rese⌠ button¼ ╔ los⌠ abou⌠ 3░ seconds«  ì
  162. Investigatinτ furthe≥ ╔ founΣ ou⌠ tha⌠ ╔ wa≤ losinτ thσ ì
  163. timσ froφ wheε ╔ presseΣ thσ rese⌠ buttoε anΣ wheε ╔ ìècalleΣ u≡ thσ prograφ t∩ reaΣ thσ time«  Lookinτ a⌠ thσ ì
  164. schematiπ ß littlσ harde≥ anΣ witΦ m∙ trust∙ Inte∞ datß ì
  165. booδ a⌠ m∙ sidσ ╔ discovereΣ tha⌠ wheε thσ 825╡ wa≤ ì
  166. rese⌠ al∞ thσ I/╧ line≤ g∩ t∩ thσ inpu⌠ mode«  Thi≤ ì
  167. mean⌠ tha⌠ thσ holΣ linσ whicΦ i≤ normall∙ aε outpu⌠ ì
  168. froφ thσ 825╡ t∩ thσ MSM583▓ wa≤ beinτ pulleΣ higΦ anΣ ì
  169. wa≤ stayinτ higΦ unti∞ thσ 825╡ wa≤ programmeΣ b∙ thσ ì
  170. reaΣ timσ program«  I⌠ madσ mσ wonde≥ iµ Ciarciß haΣ ì
  171. eve≥ eveε buil⌠ thσ circuit.
  172.  
  173.      Afte≥ mucΦ heaΣ-scratchinτ ╔ decideΣ tha⌠ thσ ì
  174. easies⌠ approacΦ wa≤ t∩ forcσ thσ Chi≡ Selec⌠ t∩ thσ ì
  175. MSM583▓ t∩ bσ lo≈ unti∞ thσ 825╡ coulΣ bσ programmed«  ì
  176. Thi≤ wa≤ donσ b∙ usinτ anothe≥ par⌠ oµ thσ 74LS0┤ tha⌠ ì
  177. ╔ wa≤ usinτ t∩ inver⌠ thσ RESE╘¡ signal«  ╔ useΣ i⌠ t∩ ì
  178. inver⌠ anothe≥ I/╧ linσ froφ thσ 8255«  Thi≤ linσ woulΣ ì
  179. bσ pulleΣ higΦ (anΣ inverteΣ lo≈ t∩ thσ MSM5832⌐ unti∞ ì
  180. thσ 825╡ coulΣ bσ programmeΣ anΣ tha⌠ particula≥ linσ ì
  181. commandeΣ low«  A≤ lonτ a≤ thσ MSM583▓ i≤ no⌠ selected¼ ì
  182. i⌠ keep≤ oε keepinτ timσ bu⌠ ignore≤ al∞ thσ commanΣ ì
  183. lines«  Jus⌠ wha⌠ ╔ needed«  Thσ clocδ ignore≤ al∞ ì
  184. command≤ unti∞ thσ 825╡ i≤ programmeΣ properly!
  185.  
  186.      Aligninτ thσ clocδ i≤ eas∙ anΣ tedious«  Jus⌠ seσ ì
  187. ho≈ mucΦ yo⌡ arσ ofµ iε ß giveε perioΣ oµ timσ (sa∙ ß ì
  188. day⌐ anΣ theε adjus⌠ thσ trimme≥ capacito≥ slightly╗ ì
  189. les≤ capacit∙ iµ yo⌡ arσ runninτ slow¼ morσ i⌠ yo⌡ arσ ì
  190. fast«  Iµ yo⌡ havσ acces≤ t∩ ß frequenc∙ counte≥ therσ ì
  191. i≤ ß faste≥ way«  SenΣ thσ clocδ aε addres≤ oµ 0FH«  ì
  192. Connec⌠ thσ counte≥ t∩ piε ╣ oµ thσ MSM583▓ anΣ adjus⌠ ì
  193. thσ capacito≥ unti∞ yo⌡ reaΣ exactl∙ 102┤ hz.
  194.  
  195.      A≤ aε exercise¼ ╔ decideΣ t∩ seσ iµ ╔ coulΣ writσ ì
  196. program≤ iε al∞ thσ differen⌠ language≤ tha⌠ ╔ haΣ t∩ ì
  197. reaΣ anΣ se⌠ thσ clock«  ╔ wa≤ ablσ t∩ reaΣ anΣ se⌠ thσ ì
  198. clocδ iε 808░ assembl∙ language¼ MicroSof⌠ BASIC¼ MI╪ ì
  199. 'Cº anΣ Turb∩ Pasca∞ 3.0«  ╔ wa≤ unablσ t∩ writσ ì
  200. routine≤ iε PILO╘ sincσ ╔ coulΣ finΣ n∩ instructioε t∩ ì
  201. reaΣ aε I/╧ por⌠ althougΦ therσ i≤ onσ t∩ outpu⌠ t∩ aε ì
  202. I/╧ port«  Thσ program≤ arσ rathe≥ brutσ force¼ bu⌠ ì
  203. the∙ work«  ╔ als∩ wrotσ aε inser⌠ fo≥ usσ witΦ BYE5.
  204.  
  205.      Abou⌠ thi≤ timσ ß budd∙ oµ minσ witΦ ß Radi∩ Shacδ ì
  206. Colo≥ Compute≥ (a⌠ whicΦ ╔ haΣ beeε scoffinτ greatly⌐ ì
  207. showeΣ mσ ß publiπ domaiε schematiπ drawinτ prograφ ì
  208. tha⌠ hσ had«  I⌠ wa≤ reall∙ ß nicσ effor⌠ anΣ workeΣ ì
  209. well¼ iµ ß littlσ slowl∙ a⌠ times«  I⌠ endeΣ u≡ ì
  210. creatinτ ╣ disδ file≤ whicΦ werσ screeε dump≤ oµ ì
  211. differen⌠ part≤ oµ thσ schematic«  Wσ tooδ ß looδ a⌠ ì
  212. thσ prograφ tha⌠ tooδ thosσ file≤ anΣ sen⌠ theφ t∩ thσ ì
  213. printe≥ anΣ decideΣ tha⌠ i⌠ woulΣ bσ eas∙ t∩ writσ aε ì
  214. 808░ prograφ t∩ d∩ thσ samσ thing«  So¼ ╔ sa⌠ dowε iε ì
  215. fron⌠ oµ thσ CoC∩ anΣ dre≈ thσ schematic«  Wσ theε ì
  216. transferreΣ thσ file≤ t∩ m∙ M─ b∙ modeφ anΣ ╔ sa⌠ dowε ì
  217. t∩ writσ thσ CADPRIN╘ program«  Man∙ hour≤ oµ confusioε ìèlater¼ ╔ haΣ ß prograφ tha⌠ coulΣ takσ thσ screeε dump≤ ì
  218. generateΣ b∙ COCOCA─ oε ß CoC∩ anΣ dum≡ theφ t∩ m∙ ì
  219. Epsoε M╪-8░ t∩ prin⌠ thσ schematic.
  220.  
  221.      Thσ bottoφ linσ i≤ tha⌠ ╔ ho≈ havσ ß filσ calleΣ ì
  222. MDCLCK12.LB╥ tha⌠ contain≤ al∞ thσ program≤ ╔ havσ ì
  223. writteε fo≥ usinτ thσ clock¼ ß part≤ list¼ thi≤ articlσ ì
  224. anΣ thσ CADPRIN╘ prograφ fo≥ aε EPSO╬ o≥ OK╔ ML92/9│ ì
  225. printe≥ anΣ thσ ╣ file≤ tha⌠ contaiε thσ schematic«  ì
  226. Therσ arσ als∩ ß couplσ oµ nea⌠ program≤ t∩ se⌠ anΣ ì
  227. reaΣ thσ clocδ b∙ Johε Osne≤ wh∩ als∩ madσ thσ mod≤ t∩ ì
  228. CADPRIN╘ fo≥ thσ OKIs«  Hopefull∙ somσ peoplσ ou⌠ therσ ì
  229. wil∞ looδ a⌠ thσ CADPRIN╘ prograφ anΣ makσ ì
  230. modification≤ s∩ tha⌠ i⌠ caε bσ useΣ witΦ othe≥ ì
  231. printers«  ╔ d∩ hopσ thi≤ happens¼ 'causσ ╔ plaε oε ì
  232. usinτ CADPRIN╘ witΦ othe≥ hardwarσ article≤ iε thσ ì
  233. future«  MDCLCK12.LB╥ i≤ availablσ oε thσ MO╥ BB╙ o≥ oε ì
  234. ß FLOB.
  235.  
  236.                          -30-
  237.