home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / Archives / HardwareProjects / MClock.lha / MouseClock / MClk.doc < prev    next >
Encoding:
Text File  |  1990-03-24  |  14.3 KB  |  384 lines

  1.  
  2.                              MouseClock Project
  3.                                  Rev. 1.21
  4.                                  22-Sep-93
  5.                    Copyright (C) 1993  Adriano De Minicis
  6.  
  7.  
  8.  
  9. WHAT IS IT?
  10. ===========
  11.  
  12. MouseClock is a hardware/software project of a low cost, very small external
  13. battery backed up clock calendar for all Amigas (especially for A1200, A500,
  14. A600).  It is connected to the mouse port #2.
  15.  
  16.  
  17.  
  18. REQUIREMENTS 
  19. ============
  20.  
  21. It works on all Amigas with OS1.2 or greater (tested on A1200, A2000, A500).
  22. Some practice is required to build MouseClock.  If you have never built an
  23. electronic circuit it's better to ask a friend for help.
  24.  
  25.  
  26.  
  27. CONTENTS
  28. ========
  29.  
  30.  1. Description
  31.  2. Shareware notice
  32.  3. Distribution
  33.  4. Disclaimer
  34.  5. Usage of MouseClock (hardware)
  35.  6. Usage of SetMClock (software)
  36.  7. Error messages and suggestions
  37.  8. Hardware description
  38.  9. Construction
  39. 10. Calibration
  40. 11. Thanks
  41.  
  42.  
  43.  
  44. 1. DESCRIPTION
  45. ==============
  46.  
  47. MouseClock, as stated before, is a very small external clock.
  48. The advantages of an external clock are:
  49.  
  50. - Installing it does not void warranty.
  51. - It is compatible with all Amigas: if, for example, you have an A500 and
  52.   you plan to buy an A1200 you can move MouseClock from one computer to
  53.   the other in a few seconds.
  54. - It may be used as an emergency replacement for a damaged internal clock.
  55.  
  56. Someone may suppose that external is cumbersome and/or occupies the
  57. joystick port:
  58.  
  59. - It's very small (the dimensions of my prototype are: 44 x 35 x 16
  60.   millimeters).
  61. - Adding a few parts you can build a "pass trough" joystick version.
  62.   With a switch you select MouseClock or the joystick.
  63.  
  64. How much it costs?
  65.  
  66. - Much less than an internal clock: about 15$
  67.  
  68. This archive contains the documentation (this file) and the software
  69. (SetMClock) to read/write the clock (included source in assembler).
  70. The circuit diagram and the detailed mounting plan will be sent to you on
  71. receipt of the shareware donation (see Distribution).
  72.  
  73.  
  74.  
  75. 2. SHAREWARE NOTICE
  76. ===================
  77.  
  78. MouseClock is SHAREWARE.  If you want to receive the complete circuit
  79. diagram and the mechanical construction plan, send me 10000 (ten thousand)
  80. Lit (Italian Lire) or 7 (seven) US$ by postal money order or cash (money
  81. order is better) to the address below.  DO NOT SEND CHEQUES!.  Please
  82. specify that money is for MouseClock (because I'm working on other shareware
  83. projects).
  84.  
  85. My address is:
  86.  
  87.        Adriano De Minicis
  88.        Via Latisana 37
  89.        33054 Lignano Sabbiadoro  UD
  90.        ITALY
  91.  
  92. Why is this project shareware?.  Because I've spent much more time to write
  93. the documentation, diagrams, and rewriting in assembly SetMClock (originally
  94. in GFA Basic: 17KB compiled!) than to design and build the prototype for my
  95. new A1200.  I think that 7$ is quite reasonable.
  96.  
  97. If there will be enough feedback to this project, I'll publish the projects
  98. on which I'm working:
  99.  
  100. - a 4-ways parallel port switch (completely electronic: no mechanical
  101.   switches), controlled by Amiga (also from Arexx), with all pins 
  102.   bidirectional.
  103. - a simplified 8-bit logic analyzer.
  104.  
  105.  
  106.  
  107. 3. DISTRIBUTION
  108. ===============
  109.  
  110. The files in this archive may be copied and distributed freely (also on
  111. networks) as long as all the files remain unmodified and intact, and as
  112. long as there is no charge for them except a reasonable copying and media
  113. fee.
  114.  
  115. The circuit diagram you will receive sending me the shareware donation is
  116. Copyright by Adriano De Minicis and MUST NOT BE DISTRIBUTED (in any form).
  117.  
  118. You are not allowed to sell MouseClock in commercial way (contact me for
  119. agreements).
  120.  
  121.  
  122.  
  123. 4. DISCLAIMER
  124. =============
  125.  
  126. SetMClock sets as outputs some lines of the mouse port #2 (GamePort).
  127. Remove any peripheral from that connector before running SetMClock, to avoid
  128. damages to the peripheral and/or the Amiga.  Note: when SetMClock ends, the
  129. mouse port returns to the standard configuration.
  130.  
  131. It is possible to connect a joystick to an auxiliary connector if you'll
  132. build the pass-through version of MouseClock (only few additional parts
  133. required).
  134.  
  135. WARNING
  136. -------
  137. NEVER insert or remove MouseClock when the Amiga is on, especially if you
  138. haven't removed the metallic shield of the DB9 connector of MouseClock.  
  139. In fact, pin 7 and 8 (+5V, GND) of the mouse port may be shorted by the
  140. metallic shield of the other connector, shorting the Amiga!.  I STRONGLY
  141. SUGGEST to cut the metallic shield from the DB9 female connector of
  142. MouseClock (not Amiga!).  If you'll do this, there is no risk to short the
  143. Amiga, however is always better not to insert/remove MouseClock when the
  144. Amiga is on.
  145.          
  146. I CANNOT BE HELD RESPONSIBLE FOR ANY KIND OF DAMAGE CAUSED BY THIS PROJECT.
  147.                  BUILD AND USE IT AT YOUR OWN RISK..ETC...
  148.  
  149.  
  150.  
  151. 5. USAGE OF MouseClock (hardware)
  152. =================================
  153.  
  154. Using MouseClock is simple: connect it to the mouse port #2 (gameport)
  155. when the Amiga is off (read the warning notes above!).
  156.  
  157. Base version of MouseClock
  158. --------------------------
  159. Simply use SetMClock to access the clock (see below).
  160.  
  161. Joystick version of MouseClock
  162. ------------------------------
  163. This version allows you to connect a joystick (not an analog joystick or
  164. paddle) to the auxiliary DB9 connector.
  165. Set the switch to the 'Clock' position before calling SetMClock (otherwise
  166. SetMClock doesn't see the clock!). No damage occurs if you use a joystick
  167. when the switch is in the 'Clock' position or vice versa.
  168.  
  169.  
  170.  
  171. 6. USAGE OF SetMClock (software)
  172. ================================
  173.  
  174. SetMClock is the software to set the system time from MouseClock or vice
  175. versa.  It's the replacement of SetClock.  Being written 100% in assembler,
  176. it is quite compact (about 3K).
  177.  
  178. SetMClock requires the file "MClock.upd" (4 bytes) in the directory "S:" to
  179. work properly.  This file is created the first time with the option 'save'.
  180. It is necessary because the clock chip I've used doesn't save the year,
  181. which must be saved on disk.  The year is automatically updated comparing
  182. the current date with the date stored in the file (day, month any year of
  183. the last 'save').  If the current date (read from MouseClock) precedes the
  184. date stored in the file, then the year must be increased.  The only
  185. situation that can cheat MouseClock is when the computer remains off from
  186. the beginning of the new year to the month and day stored in the file.  For
  187. example, if "MClock.upd" contains '15 Jan 1993' and MouseClock reads '10
  188. Jan', then year is 1994; but if MouseClock reads '15 Jan' or later the year
  189. is 1993, with the exception above mentioned.  To avoid this situation,
  190. update the clock for example at the end of January, so that SetMClock has an
  191. entire month to notice that the year is changed.
  192.  
  193. If you don't have a hard-disk, it's better to copy the file "S:MClock.upd"
  194. in all the boot disks that make use of SetMClock.
  195.  
  196. WARNING: Do not run SetMClock if a peripheral other than MouseClock is
  197.          connected to the mouse port #2. See the Disclaimer chapter.
  198.  
  199. NOTE: Do not run multiple copies of SetMClock since they interfere, giving
  200.       wrong results (but there is no damage).
  201.  
  202.  
  203. CLI/Shell Usage
  204. ---------------
  205. SetMClock load     Set system time/date from MouseClock. Requires file 
  206.                    "S:MClock.upd".
  207.                    If you want to set system time every time you boot
  208.                    the Amiga, include this command in the startup-sequence
  209.                    (or user-startup).
  210.  
  211. SetMClock save     Store system time/date into MouseClock and into the file
  212.                    "S:MClock.upd" (creating it if it doesn't exist).
  213.                    Use the AmigaDOS command 'date' or the 'Time' prefs
  214.                    (WB 2.0 or higher) to set the system time. Example:
  215.  
  216.                      date 1-jun-93 12:34
  217.                      setmclock save
  218.  
  219.                    Note: when saving, seconds are reset. To reduce the
  220.                    error, wait for seconds being near zero before running
  221.                    SetMClock (or use the 'zero' option to correct seconds).
  222.  
  223. SetMClock zero     Reset seconds of MouseClock. If the seconds counter was
  224.                    at position 30..59, time is advanced by one minute
  225.                    (seconds are always reset).
  226.  
  227. SetMClock          Shows some help.
  228.  
  229.  
  230. WorkBench Usage
  231. ---------------
  232. Use a project icon which default tool is "SetMClock" (with path) and which
  233. tooltypes are:
  234.  
  235. MODE=load  \
  236. MODE=save   } Use ONLY ONE of this (equivalent to CLI option)
  237. MODE=zero  /
  238.  
  239. The default tooltype is 'load'.
  240.  
  241. You can use the three icons I've supplied as examples. Attention: if you
  242. move SetMClock to another directory (for example C:) you must modify the
  243. default tool of those icons, including the complete path to SetMClock.
  244.  
  245. It's useful to start SetMClock from WB if you have booted the Amiga
  246. from a disk that doesn't call SetMClock in the startup-sequence.
  247.  
  248.  
  249.  
  250. 7. ERROR MESSAGES AND SUGGESTIONS
  251. =================================
  252.  
  253. Can't find battery backed up clock
  254. ----------------------------------
  255. MouseClock is not connected to the mouse port #2, or it doesn't work.
  256. If you have the joystick version of MouseClock probably the switch is
  257. not set to the 'clk' position.
  258.  
  259. Battery backed up clock not set
  260. -------------------------------
  261. MouseClock is found, but date and time are not set. This happens every time
  262. the battery power fails, and thus also the first time.
  263. If this error occurs every time you switch off the Amiga, then the battery
  264. may be low or not connected. Check it (battery voltage must be greater than
  265. 2.2V).
  266.  
  267. Can't open S:MClock.upd
  268. -----------------------
  269. File "S:MClock.upd" does not exist or can't be opened.
  270.  
  271. Can't save S:MClock.upd
  272. -----------------------
  273. Probably the system disk is write protected.
  274.  
  275. Bad data in S:MClock.upd
  276. ------------------------
  277. Garbage found in "S:MClock.upd". Restore with SetMClock save.
  278.  
  279.  
  280.  
  281. 8. HARDWARE DESCRIPTION
  282. =======================
  283.  
  284. To reduce the number of I/O lines (so that MouseClock can be connected to
  285. the mouse port instead of the parallel port) I've used a clock chip with the
  286. I²C bus (IC1).  The other chip (IC2) interfaces the Amiga and the I²C bus.
  287. Diodes D1 and D2, connected to the I²C feedback lines, avoid an excessive
  288. current flow from the battery to the Amiga when the Amiga is off.  If the
  289. diodes are shorted, the current drawn from the battery would be much higher
  290. than the current consumption of IC1, descharging the battery too quickly.
  291.  
  292.  
  293.  
  294. 9. CONSTRUCTION
  295. ===============
  296.  
  297. Together with the circuit diagram you'll receive the mechanical mounting
  298. plans on veroboard (2.54mm step, 1/10"). These drawings refer only to the
  299. base version of MouseClock. If you want to build the joystick extension
  300. you have to make the few modifications shown by the circuit diagram.
  301.  
  302. I suggest to use a thin wire-wrap wire (for example AWG 28) to make the
  303. connections. You can transform directly the connection map to a printed
  304. circuit board (because there are no intersections) if you don't want to
  305. use the veroboard.
  306.  
  307. The NiCd battery I've used has a diameter of about 15mm, a height of 7mm;
  308. the compensator has a diameter of 7mm. If you use different sized parts
  309. you may have to make some small modification to the connection layout.
  310.  
  311. I suggest to use sockets for the two ICs, and to cut with a hack-saw the
  312. metallic shield of the DB9 female connector.
  313.  
  314. Start by fitting the sockets, the two pins for the jumper, all resistors and
  315. capacitors, the quartz, and the transistor.  Next fit the DB9 connector,
  316. the diodes and the additional parts for the joystick extension (if used).
  317. Do not mount the battery. Make a first check of all connections, making sure
  318. that there are no short circuits, expecially between the 5V line and ground
  319. (pins 7 and 8 of the DB9 connector). A short circuit between these lines
  320. can damage your Amiga. Be careful!. Don't be in a hurry to test the clock!
  321.  
  322. When you are sure that it's all ok, mount the battery (with the jumper not
  323. inserted).  Make sure not to short the battery (use a insulated cable to
  324. connect the negative pin of the battery, and don't lean the circuit on
  325. metallic objects:  NiCd batteries don't like to be shorted!).  Make a second
  326. check of all connections.  If there are no errors, insert the two integrated
  327. circuits in their sockets, making sure they have the correct orientation and
  328. they are not swapped.
  329.  
  330. Another check, and then insert the jumper (that supplies the circuits).  If
  331. you have built the joystick version set the switch to the 'clock' position.
  332. Switch off the Amiga, connect MouseClock to the mouse port #2, and switch on
  333. the Amiga.  From the WB, double click on the ClkLoad icon: if appears the
  334. requester "Can't find battery backed up clock" you have done some error in
  335. the circuit.  Switch off the Amiga, and check the circuit (may be the switch
  336. is not in the 'clk' position).  If the circuit works properly you should see
  337. the requester "Battery backed up clock not set" or "Can't open
  338. S:MClock.upd".  Try to double click on the ClkSave icon: there shouldn't be
  339. any message.  Retry with ClkLoad: if no message appears it's all O.K.,
  340. congratulations!.  To see how to use SetMClock or for an explanation of the
  341. error messages see the respective sections of this doc.
  342.  
  343. If the circuit doesn't work and you can't find the error, check if there is
  344. a 1Hz square wave between pin 5 of IC1 and ground. If there isn't then
  345. the quartz oscillator doesn't work: try adjusting the compensator.
  346.  
  347. NOTE: The NiCd battery is probably discharged when you build MouseClock.
  348.       To recharge the battery leave the computer on for some hours (the
  349.       charge time is usually 14 hrs, but it isn't necessary to leave the
  350.       Amiga on for all that time, if you often use the Amiga).
  351.       If you have a NiCd battery charger you can recharge the battery
  352.       with it before soldering the battery to the circuit.
  353.  
  354. Have a good work!  :-)
  355.  
  356.  
  357.  
  358. 10. CALIBRATION
  359. ===============
  360.  
  361. The calibration of the circuit can be omitted, since the clock is quite
  362. precise.
  363.  
  364. If you have a frequency meter with good resolution at low frequencies (must
  365. display fractions of Hertz), adjust the compensator until you read exactly
  366. 128 Hz on pin 8 of IC1.
  367.  
  368. If you don't have a frequency meter, the procedure is longer: if you notice
  369. that the clock is too fast or slow after a week, turn the compensator a
  370. little in one direction.  After another week check the error: if it is
  371. decreased, the direction of the rotation is correct, otherwise, turn the
  372. compensator in the opposite direction.  Many adjustments are needed to
  373. reduce the error.
  374.  
  375.  
  376.  
  377. 11. THANKS
  378. ==========
  379.  
  380. I wish to thank Roberto Borri for his suggestions and debugging,
  381. Fred Fish for his great PD-collection, and the Commodore-Amiga for the
  382. new AGA chipset.
  383.  
  384.