HRA

Ollie's Follies
Herní styl Platformer (Single Screen)
Multiplayer Bez multiplayeru
Rok vydání 1984
Programátor Frank Cohen
Grafik Frank Cohen

INTRO

PC mouse for c64

MODIFICATION OF A PC MOUSE FOR C64/C128
---------------------------------------


   As it is known, our commies does not have wide software and hardware
support. So we are alone with our dreams. This situation forced many of
us to hack our commodores by thyself.

   This document describes how to convert a cheap OEM PC mouse to be used
with the joystick ports of commodore 64 & 128. There are other solutions
of course, such as plugging a PC mouse to an ACIA (swiftlink) card, or
building a small interface. But this method has the advantage of simplicity
and viability. The modification costs about $2, and if you add the cost of
a PC mouse you can have a mouse for $6 only.

   Let me first explain the mouse type we need, and why this type. This
modification is actually modification of an Amiga mouse. Amiga mice have
the same port output as our commodores. They send two signals for each
axis. Then, the computer extracts the direction information from the phase
difference between the signals. These mice are "opto-mechanical" mouses.
The rolling ball rotates the two cogwheel, which are placed inbetween the
optic elements such that, they permit the light upon the positions of their
teeths. The photocells, used in these mice, have three pins, which two of
them supplies the signals which has the phase difference. The signals named
as 'phase' and 'quadrature' signals which are approximately 90 degrees out
of phase. This difference changes sign due to the direction. Observing the
signals gives something like this:


                             ------        ------        -- ....
                            I      I      I      I      I
phase  signal     :   ------I      I------I      I------I

                         ------        ------
                        I      I      I      I
quadrature signal :   --I      I------I      I---- ...



  If you move the mouse to the other direction, you observe:

                          ------        ------        ------
                         I      I      I      I      I      I
phase  signal     :   ---I      I------I      I------I      I-- ...


                             ------        ------
                            I      I      I      I
quadrature signal :   ------I      I------I      I---- ...



   As you see it's possible to find direction information using these signals.
If we think about their binary values we have this :

left or down :  11 - 01 - 00 - 10 - 11 - ... repeats

right or up  :  11 - 10 - 00 - 01 - 11 - ...


   Thus only thing to do by the software is searching for the above bit
patterns for direction information.



   As it might be understood we will tie the output pins of the photocells
to somewhere in the joystick port. But we need to know one more thing.
Because of the open collector nature of the CIA chip, we have to use pull-up
resistors, for making possible the '0' bit state.

   Many of the OEM PC mice have the similar chip. This chips read the
phase signals and convert them into three or five bytes of serial data.
The one I examined had 16 pin 83702BP chip. I will describe the wiring
schema with references to pinout of this chip. Do not worry if your mouse's
chip is different. If it is 16 pin, probabably they are same. If there are
18 pins on your chip, the 9th pin is GND. So, if you have a different chip,
simply follow the traces from the photocells and buttons. Then make the
connection by smart guesses.

   First, pin-to-pin connections inbetween joystick port and 83702BP chip.
Again note that this modification does not use this chip (you can desolder it
if you want), I'm just making references to its pinouts.

83702BP      JoyPort   notes
-------      -------   ------------------
  14 ---------- 1      VP ( vertical pulse )
  12 ---------- 2      HP ( horizantal pulse )
  15 ---------- 3      VQ ( vertical quadrature )
  13 ---------- 4      HQ ( horizantal quadrature )
  11 ---------- 6      LB ( left button )
  16 ---------- 7      Vcc ( +5 volts )
   8 ---------- 8      GND ( ground, connect it to the shield of the cable )

optional:

  10 ---------- 5      MB ( middle button )
   9 ---------- 9      RB ( right button )


  In another words, the pins 1 and 3 of the JoyPort will be connected to the
photocell which sends vertical information, probably it's located in the
right of the mouse PCB. The pins 2 and 4 are connected to the other photocell.
Note that the photocell I mentioned is the optical element with three legs,
not the infrared LED. Following the traces on the mouse board find the ground
and Vcc lines, and make sure not to connect the JoyPort pins 1-6 to these
lines. And don't bother confusing about the miswiring of phase and quadrature
lines. You will see whether they are correct or not, with the mice-test
program. If the pointer moves to wrong direction, this is the indication of
mis-wiring. For the buttons, again follow the trace from button to the chip,
hich is the line we need.

  Now, we have to solder the pull-up resistances, without them we cannot detect
the zero volt level.


 JoyPort
 -------
    1 ----/\/\/----+   2.2Kohm
                   I
    2 ----/\/\/----I   2.2K
                   I
    3 ----/\/\/----I   2.2K
                   I
    4 ----/\/\/----I   2.2K
                   I
                   /
               -/\/\/-+  1K variable
                      I
    6 ----/\/\/-------I   2.0K (button)
                      I
                    ----- GND (pin 8)
                     ---
                      -

optionally you can connect the pins 5 and 9 for middle and right buttons:

    5 ----/\/\/----I   2.0K
                   I
    9 ----/\/\/----I   2.0K
                   I
                 ----- GND
                  ---
                   -


   Of course you will solder these resistors inside the PC mouse, not in the
computer.
   By the way, here is the same connection schema with respect to the chip:

  83702BP
  -------
    15 ----/\/\/----I   2.2K
                    I
    14 ----/\/\/----I   2.2K
                    I
    13 ----/\/\/----I   2.2K
                    I
    12 ----/\/\/----I   2.2K
                    I
                    /
                -/\/\/-+ 1K variable resistance
                       I
    11 ----/\/\/-------I   2.0K
                       I
                     ----- GND (pin 8)
                      ---
                       -

  Optional pins are 9 and 10, connect them with 2.0K to the GND if you want.


   The values of the resistances may cause problems with your mouse. We supply
only +5V to the infrared LEDs which are supposed to be something 9-10 volts.
Thus, the output of the photocells cannot be enough to drive the Port with
these resistances. If this is the case try different values by adjusting the
variable resistor. You may desolder some of the components in the mouse
board also, such as the chip and the crystal, but not the capacitors.

   In conclusion, simply solder the cable to the female DB-9 connector, close
its cover, unplug the mouse's original cable (if it's soldered to the PCB,
desolder the wires), locate the signal lines, solder the wires of your cable
to them, locate the button outputs, solder the pin6 of your cable to the
left button's output, locate the ground and +5V lines of your mouse PCB (board),
note that pin8 (or pin9 for 18pin chips) is ground and pin16 (or 18) is +5V,
solder the matching wires (pin 8 and 7 from the port) of your cable to these
lines, solder the resistances inbetween signal pins and variable resistor,
solder other pin of the variable to the ground. That's it.

  After all, you can execute the port testing program by:

load"porttest",8
run

  You will see, the bits of the Joystick Port 1 ($dc00) on the top-left of
the screen. If the rightmost four bits are off, or moving the mice does not
make them change, then re-adjust the variable resistor. You have to see
flashing bits while the mouse is moving. And pressing left button, sets the
fifth bit.
  Try this test with all your C64 and C128 computers. And try to find an
optimal adjustment.
  By the way, Port 1 is the joystick port which is close to the power switch.

 Then, run the mouse testing program:

load"pcmice0",8
run

  If the pointer on the screen moves erratic, for instance you moved the
mouse to the right but the pointer moved to the left..., then open the cover
of the DB-9 connector and resolder the necassary wires. For the above
example exchange the wires on pins 2 and 4 (counting from 1). For vertical
errors exchange pins 1 and 3.
  If you cannot move the pointer recheck everything, and if you have a
voltmeter observe the signals, if they are changing with the movement then
it is inferred that everything is allright but the resistors, try different
resistances ( run the porttest program again, and make more adjustments ).
You should be able to make it work.


Parts List:
----------
2mt.  6 lines shielded cable  ( 8 lines if you want to use optional buttons)
1 DB-9 female connector and its cover
4 2.2Kohm resistor
1 2.0Kohm resistor ( 3 for the optional buttons )
1 1Kohm variable resistor.
and one PC mouse of course :-)

note: resistance values are important for compatibility.


Interpretation of the Signals:

direction  :   left    right     down      up
              ------   ------   ------   ------
first four :   1x1x     1x1x     x1x1     x1x1
bits of    :   0x1x     1x0x     x0x1     x1x0
$dc00      :   0x0x     0x0x     x0x0     x0x0
           :   1x0x     0x1x     x1x0     x0x1

the left button  :    xxx1xxxx  (fourth bit of $dc00)
the middle button:    1xxxxxxx  (seventh bit of $d41a)
the right button :    1xxxxxxx  (seventh bit of $d419)



  That's all for this modification, interpreting the signals is another
story.



Ilker Ficicilar

filker@newton.physics.metu.edu.tr
c068214@orca.cc.metu.edu.tr
http://www.physics.metu.edu.tr/~filker/cbm.html
Nový příspěvek k článku

podpis :
První znak podpisu musí být vykřičník, jinak se příspěvek neodešle (ochrana proti spamu)

Advert

Hardcode and datamining by PCH of UNREAL, Hardware guru by RAY of UNREAL, Bugs report by SILLICON of UNREAL
UNREAL 2014-2021 Czech republic