home *** CD-ROM | disk | FTP | other *** search
/ The CDPD Public Domain Collection for CDTV 2 / CDPD_II_2352.bin / ab20 / ab20_archive / hardware / mousehack.txt < prev    next >
Text File  |  1992-10-13  |  13KB  |  301 lines

  1.               Converting A Microsoft Serial Mouse To Work On The Amiga
  2.  
  3.  
  4.  
  5.      Introduction
  6.  
  7.  
  8.        From reading the occasional complaints on Comp.Sys.Amiga, it appears that
  9.      many people are interested in replacing their stock Amiga mouse with
  10.      another type of input device.  Witness the Atari Trackball modifications
  11.      and also the Boing Optical Mouse.
  12.  
  13.        This article will explain the basics of the Amiga mouse, and in
  14.      particular, how to modify the Microsoft Serial Mouse (the newer white dove
  15.      bar one) to work on the Amiga.  The principles outlined in this article can
  16.      be applied to modifying other mice.  Matter of fact, other mice may be
  17.      simpler to modify (i.e. the Microsoft Bus Mouse).  The reason I chose the
  18.      Serial mouse was that it was laying around already.
  19.  
  20.  
  21.      Disclaimer
  22.  
  23.  
  24.        This modification requires opening up your Microsoft serial mouse and
  25.      removing a chip and adding two resistors, one of which is a surface mount
  26.      resistor.  If you feel uncomfortable with this then either find someone
  27.      that isn't or don't try this modification yourself.
  28.  
  29.        I make no claims that this modification will work for you.  It worked for
  30.      me, your mileage may vary...
  31.  
  32.  
  33.      Amiga Mouse
  34.  
  35.  
  36.        The Amiga supplied mouse is rather simple as mice go.  It provides the
  37.      basic XY quadrature signals and lets the Amiga figure it out from there.
  38.      This is actually a good thing, as it lets us use other devices by simply
  39.      removing any back end processing or signal massaging circuits to get back
  40.      to the raw XY signals.
  41.  
  42.        Basically, the Amiga mouse has two rollers that touch the mouse ball in
  43.      the X and Y direction.  As the ball rotates in the X (right <-> left)
  44.      direction, X roller shaft spins.  If the ball rotates in the Y (up down)
  45.      direction, the Y roller shaft spins.  Any combination of XY direction, and
  46.      the roller shafts spin a proportionate amount in the X and Y  directions.
  47.  
  48.        Each shaft is connected at the end to a slotted disk.  Each disk has a
  49.      LED emitter/ detector pair that "reads" the slots as they spin by, creating
  50.      a logic pulse for each slot seen.
  51.  
  52.        Notice that there are two detectors for the X disk and two for the Y
  53.      disk.  Each pair are mounted physically 180 degrees apart on the slotted
  54.      disk.  The odd number of slots appear to be cut into each disk, so that it
  55.      is impossible for the pair of logic pulses to occur exactly at the same
  56.      time.  This is how the mouse can signal the direction that the mouse is
  57.      moving.
  58.  
  59.        For example, lets look at just the X slotted disk/detector pair.  Lets
  60.      call the two output signals Xa and Xb.  If the mouse is moving to the
  61.      right, the signals would look like this;
  62.  
  63.                ____         _______          _______
  64.            Xa      |       |       |        |       |
  65.                    |_______|       |________|       |________
  66.  
  67.  
  68.                   ____         _______          _______
  69.            Xb         |       |       |        |       |
  70.                       |_______|       |________|       |________
  71.  
  72.  
  73.        The graphics are terrible, but you get the picture.  If the mouse is
  74.      moving in the opposite direction, then Xb would go low first, followed by
  75.      Xa.
  76.  
  77.        The same thing happens for the Ya and Yb pair.  In fact, you can treat
  78.      the Y pair as up down equivalent to the X pair.
  79.  
  80.        Each of the four detector signals (x pair, y pair) is conditioned by a
  81.      LM339 Quad Voltage Comparator IC.  The LM339 basically shapes up the
  82.      signals before being sent to the Amiga.  Each of the four comparators is
  83.      used, one for each of the detector signals.
  84.  
  85.        An example of the comparator circuit looks like this;
  86.  
  87.  
  88.  
  89.           o Vcc                   100 K               o Vcc
  90.           |                                           |
  91.           |                 ____/\/\/\/\____          \
  92.           /                |                |         /
  93.          |                 |    |\          |         \ 3.3K
  94.          |  detector       |    |  \        |         /
  95.          \_________________|____|+   \      |         |
  96.           |                     |      \____|_________|____  Pin x on DB9
  97.           \        o Vcc        |      /
  98.      2.2K /        /        ____|-   /
  99.           \   10K  \       |    |  /
  100.           /        /       |    |/
  101.           |        |_______|
  102.          ---       |
  103.           -        \
  104.              2.7K  /
  105.                    \
  106.                    |
  107.                  -----
  108.                   ---
  109.                    -
  110.  
  111.  
  112.        The 10K, 2.7K resistor divider sets a trip voltage of around 1.0 volts
  113.      for the comparator.  This is important since the detector puts out around
  114.      .5V for a low pulse.  The resistor divider is also shared by all four
  115.      comparators in the LM339.
  116.  
  117.        The two mouse buttons are simply switches to ground.  When you press one
  118.      of the buttons, it grounds a DB9 pin.  The corresponding pull-up resistors
  119.      must be inside the Amiga.
  120.  
  121.        The mouse cord terminates inside the mouse in a connector marked CN-1.
  122.      Below is the pinouts for the mouse cord.
  123.  
  124.        DB9     CN-1       Function
  125.      -------------------------------------
  126.         6       1         Left Button
  127.         9       6         Right Button
  128.         8       9         Signal Ground
  129.         7       8         Vcc (+5 Volts)
  130.         3       5         Ya
  131.         1       2         Yb
  132.         2       3         Xa
  133.         4       4         Xb
  134.         5       7         No Connect
  135.       Shield Drain Wire   Ground
  136.  
  137.        The DB9 pinout is per the convention for DB9 connectors.  The CN-1 pinout
  138.      is per the numbers molded into the top of the connector.
  139.  
  140.  
  141.      Microsoft Serial Mouse
  142.  
  143.  
  144.        The Microsoft serial mouse starts out the same as the Amiga mouse, with
  145.      an almost identical roller shaft/slotted wheel/LM339 arrangement.  The
  146.      similarities stop there.  Since this is a device that is hooked to an IBMPC
  147.      serial port, the mouse must send signals that look a lot like serial data
  148.      for the UART inside the PC to understand it.  Also, the mouse must derive
  149.      its power from a serial pin which the mouse driver sets to +12 volts.
  150.      These two differences is where the modifications come in.  First lets look
  151.      at the Microsoft mouse's circuits then we'll get into the modification.
  152.  
  153.        The Microsoft mouse uses a similar roller shaft/slotted wheel arrangement
  154.      as the Amiga mouse does.  The one difference to note is that the Microsoft
  155.      mouse uses one LED emitter per X and Y axis and has a dual detector that is
  156.      all in one package.  This is apparently a cost reduction measure but the
  157.      net effective output is the same as the Amiga mouse.  The dual quadrature
  158.      signals for X and Y direction are identical to the Amiga mouse.
  159.  
  160.        Each of the XY pairs goes to a LM339 comparator just like the Amiga
  161.      mouse.  The resistor values are different and there is also a diode to
  162.      ground on each detector output (presumably for protection).
  163.  
  164.        The four outputs of the LM339 as well as the two switch inputs are fed
  165.      into the microprocessor marked "Mitsumi MS02".  This uP apparently reads
  166.      all the input events and sends a serial data stream to the UART in the PC.
  167.  
  168.        There is a zener diode circuit to limit the +12v down to +5 volts for the
  169.      LM339 and uP.  Unfortunately, the emitter LED's and the resistor divider
  170.      circuit are powered directly from the +12V.
  171.  
  172.  
  173.      Modifications for the Microsoft Serial Mouse
  174.  
  175.  
  176.        To perform this modification, you will need the following items;
  177.  
  178.        Soldering Iron
  179.        Solder
  180.        Solder Wick (or a desoldering station)
  181.        1) 470 1/4 Watt resistor
  182.        1) 10K surface mount resistor (clever people may be able to use
  183.              a 1/4W or 1/8W regular resistor).
  184.        9 conductor w/shield cable. If your Amiga mouse is dead, this is
  185.              the best cord to use.  The cable must be small enough to fit
  186.              thru the slot at top of the mouse
  187.        Phillips screwdriver
  188.  
  189.        First disassemble the Microsoft mouse.  Turn the mouse over, peel off the
  190.      serial number label.  Under it you will find two recessed screws.  Remove
  191.      the screws.  Turn the mouse right side up.  pull up gently on the bottom
  192.      end (away from the buttons) of the top of the mouse case. lightly pull back
  193.      on the top to disengage the latch that is inside the mouse near the front.
  194.      It might help to use a small screwdriver to push gently on the tab just
  195.      above the mouse cord at the same time.  The cover should come off.
  196.  
  197.        Remove the mouse cord by disconnecting the cable at CN1.  Remove the two
  198.      screws, one on each side of the ball assembly.  The circuit board should
  199.      now come out of the lower housing.
  200.  
  201.        Remove the IC nearest the CN1 connector.  It should be marked "Mitsumi
  202.      MS02"  Do this carefully, as we will use the holes to solder in the new
  203.      mouse cable.
  204.  
  205.        Notice the thick trace running thru the center of the IC just removed.
  206.      It has 6 surface mount resistors connecting it to various pads of the IC.
  207.      It also connects directly to Pin 8 of the IC.  This is VCC (+5V).  Now find
  208.      the surface mount resistor directly to the left of the CN1 connector pads.
  209.      It should be marked "182".  Now take the 470 ohm resistor and fashion the
  210.      leads to fit between the VCC trace and the top side of the 182 resistor
  211.      (side nearest the IC just removed).  Cut the leads to length as necessary.
  212.      Form the leads so that they don't short on anything else.  I formed mine
  213.      like this;
  214.  
  215.                 o  o  o  o  o  o  o  o
  216.                             |  |          where | is a surf. mnt. resistor
  217.               ________________            <---
  218.              |           |   |     |
  219.       470    \  o  o  o  o  o  o  o  o    <-- IC removed
  220.      Resistor/
  221.              \   o  o  o
  222.              /
  223.              |_______
  224.                     |    o  o  o  o  o    <-- CN1
  225.                   "182"
  226.                   surface mount resistor
  227.  
  228.        This just fixed the first problem.  The current limiting resistor for the
  229.      LED emitters was tied to +12 volts thru a 1.8K ("182") resistor.  Since we
  230.      don't have 12 volts, the 470 ohm resistor to +5 volts replaces it.
  231.  
  232.        Next, find the empty surface mount resistor pads just below pins 3 and 4
  233.      of the LM339 IC.  Solder the 10K surface mount resistor to these pads, like
  234.      this;
  235.                   |
  236.                o  o  o  o  o  o  o
  237.                |  |  _  _                where | is a surf. mnt. resistor
  238.                      Pads                <---
  239.                |
  240.                o  o  o  o  o  o  o       <-- LM339 IC
  241.  
  242.        This fixes the second problem.  The resistor divider was tied to +12
  243.      volts as well.  Adding this 10K resistor resets the divider to 1.0 volts
  244.      when dividing from +5 volts.
  245.  
  246.        Next, solder your new mouse cord to the pads of the removed IC according
  247.      to the following chart;
  248.  
  249.        DB9      IC pad        Function
  250.      --------------------------------------
  251.         1        12            Yb
  252.         2        10            Xa
  253.         3        11            Ya
  254.         4        9             Xb
  255.         5        No Connect    Not used
  256.         6        13            Left button
  257.         7        16            Vcc (+5V)
  258.         8        8             Signal Ground
  259.         9        14            Right Button
  260.       Shield wire  to CN1, pin 5
  261.  
  262.        The shield wire is required, since the LED emitters are grounded to it.
  263.  
  264.        Recheck your work.  Screw the circuit board back into the lower housing.
  265.      Route the mouse cord around the left of the ball assembly and out thru the
  266.      cutout.  Snap on the top cover.  Screw the top back on.
  267.  
  268.        Your new mouse should be operational.
  269.  
  270.        If it doesn't work, check the following;
  271.  
  272.      Pointer moves left when mouse is moved right.  The Xa and Xb lines are
  273.      swapped.  Reverse them.
  274.  
  275.      Pointer moves up when mouse is moved down.  The Ya and Yb lines are
  276.      swapped.  Reverse them.
  277.  
  278.      One or both buttons don't work.  Recheck your connections.  Is the cable
  279.      interfering with the switches near the top of the mouse?  Can you hear the
  280.      switches clicking?  Is the top cover snapped on correctly?
  281.  
  282.      Neither direction moves the pointer.  Make sure the shield wire is
  283.      connected to CN1, pin 5.  With the Mouse connected and the Amiga on, check
  284.      for +5 volts on the LM339;  Pin 3 is Vcc, pin 12 is ground.  Check for
  285.      around 1.0 volts on pins 4,6,8,10.  If its not close, recheck your 10K mod.
  286.      Check to see if there is a voltage drop across the LED's.  If not, check
  287.      your 470 ohm mod.
  288.  
  289.  
  290.      Conclusions
  291.  
  292.  
  293.        With the information here and some circuit tracing on your part, you
  294.      should be able to modify other mice in a similar manner.
  295.  
  296.        Enjoy your new mouse!
  297.  
  298.  
  299.        Jeff Easton
  300.        easton@andrews.edu
  301.