Micromys V3

From IndividualComputers
Jump to: navigation, search
(thumbnail)
Micromys V3

Micromys V3 lets you use a PS/2 mouse on the C64, Amiga or Atari ST. USB mice can also be used, if they are shipped with a PS/2-USB adapter. Not all USB mice can use these adapters! Micromys V3 is not limited to specific mouse models. You can use any 2-button, 3-button or 3-button wheelmouse (Microsoft Intellimouse) with Micromys V3.


Contents

Connecting

Please switch off the computer before connecting anything in order to avoid damage to your precious equipment! Connect the PS/2 mouse to the 6-pin mini DIN connector of Micromys V3. The 9-pin Sub-D connector goes to the mouse port of your Amiga/Atari ST, or to one of the joystick ports of your C64. Note that most C64 programs consider control port 1 to be the "mouse port".

DIP switch settings

The two DIP switches set one of four modes of operation. After changing the DIP switch settings, you need to power-cycle the machine. Changing the DIP switches during operation may cause undesired operation, but won't break anything.


Micromys Dip on on.jpg
Put both DIP switches to the ON position for the 1351 emulation mode. This will let Micromys V3 emulate the Commodore 1351 mouse that was popular for the C64. Programs like GEOS, Pagefox, GoDot and Mr.Mouse will work. This is the setting that Prophet64 and MSSIAH users should choose.
Micromys Dip on off.jpg
Set DIP1 to ON and DIP2 to OFF for operation on an Amiga computer without any drivers. This mode will also let you use the (rather rare) middle mouse button that a few programs like DOpus can use. Wheel movements are ignored in this mode, but pressing the wheel will be reported like pressing the middle mouse button.
Micromys Dip off on.jpg
Set DIP1 to OFF and DIP2 to ON for operation on an Amiga with drivers for the wheel. The mouse will work just like any other Amiga mouse if the drivers are not yet started, so using the mouse in the early startup menu is possible. Wheel movements and pressing on the wheel does not have any effect until the drivers are started. Click here for a closer description and developer info.
Micromys Dip off off.jpg
Put both switches to the OFF position for the Atari mode. Please note that Atari never had any standard for a third mouse button, let alone a wheel, so any wheel movement or middle mouse button is ignored in this mode of operation. In this mode, Micromys V3 can be used on any Atari ST or Falcon model.

1351 Mode

Micromys Dip on on.jpg

Put both DIP switches to the ON position for the 1351 emulation mode. This will let Micromys V3 emulate the Commodore 1351 mouse that was popular for the C64. Programs like GEOS, Pagefox, GoDot and Mr.Mouse will work. This is the setting that Prophet64 and MSSIAH users should choose.

Joystick emulation mode

Just like on the original Commodore 1351 mouse, Micromys V3 can emulate a joystick if it's set to C64/1351 mode (both DIP switches ON). To enter this mode, hold down the right mouse button during power-on. Any mouse movement is now translated into joystick signals, so any software that can be controlled with a joystick can now be controlled with a mouse. The left mouse button will be translated to the firebutton of the emulated joystick. Wheel movements, middle and right mouse buttons will be ignored in this mode.

note: Today's optical mice are doing a self-test on power-up and do not pass on a mouse button that is pressed during power-on. This will probably prevent many mouse types from being used as a joystick with Micromys V3. Since a mouse is not a good joystick replacement anyway, we don't think that this is a major drawback. For the best gaming feeling, we recommend a Competition Pro Retro joystick.

Amiga Mode

Micromys Dip off on.jpg

Set DIP1 to OFF and DIP2 to ON for operation on an Amiga with drivers for the wheel. The mouse will work just like any other Amiga mouse if the drivers are not yet started, so using the mouse in the early startup menu is possible. Wheel movements and pressing on the wheel does not have any effect until the drivers are started. note: Today's optical mice are doing a self-test on power-up and do not pass on a mouse button that is pressed during power-on (let alone two mouse buttons at the same time). This will probably prevent many mouse types from letting you enter the early startup menu on a cold start of the Amiga. You might have to give Micromys V3 a few seconds after power-up to establish proper communication with your mouse, then reset the computer and hold down both mouse buttons to enter the the early startup menu.


Installing the driver

Download the driver here. The archive contains the driver, an installer-script and instructions in AmigaGuide format. The instructions are available in English and in German. These drivers can be used with AmigaOS V2.0 and higher. Wheel movements are passed into the system according to the "Newmouse" standard. MUI programs will recognize this without any further software. All other programs require an additional program like Freewheel, which is available on Aminet.

Developer Information

C64

The current mouse position can be taken from the SID registers $D419 (X-value) and $D41A (y-value). However, these values are not absolute, but relative movements of the mouse. You need to store the current state of the register, delay a certain amount of time and re-read the register. This is preferrably done in an IRQ routine. The difference between the two values gives an indication of the mouse movement during the delay interval. We won't go into detail about this here, as there's other literature available about 1351 mouse programming that applies 100% to Micromys V3 as well.

additional signals in 1351 mode

Micromys V3 will not only translate the left and right mouse buttons, but also wheel movements and the middle mouse button to the C64. This is done using the joystick direction lines that are normally not used by the original 1351 mouse. If the wheel is not moved or pressed, the nomally-unused signals remain untouched, so full compatibility to the original 1351 mouse is still given. The following description gives some idea from a programmer's point of view.

Bit 7 6 5 4 3 2 1 0
Function -- -- -- LMB DN UP MMB RMB

This bit layout is valid for both control ports. Port 1 is located at CIA address $DC01, and port 2 is located at CIA address $DC00. Bits 7, 6 and 5 are unused and should be masked out. All five signals are active-low:

LMB stands for left mouse button

RMB stands for right mouse button

MMB stands for middle mouse button

UP is the scrollwheel-flag for up-movements

DN is the scrollwheel-flag for down-movments

If a button is pressed, it will be represented as a 0 in the corresponding bit. If it is released, the corresponding bit will be 1.

If the wheel is moved up or down, a sequence of pulses appears on the UP or DN bits of the above port registers. The number of pulses is exactly the number of increments that the wheel has been moved. The following picture illustrates two pulses for a wheel movement of two clicks:

Micromys Wheel pulses.png

The idle state of the UP and DN bits is 1, and the pulses bring the bit to zero for a period of 50ms. The time between two pulses is also about 50ms. The time may vary by about 4%, mainly caused by different timings between PAL and NTSC machines (Micromys V3 takes a timebase from the potentiometer conversion rate, which is affected by the different clock speeds of the different C64 video norms). This also means that you don't need to tweak your code to run on NTSC and PAL - with changing C64 timing, the Micromys V3 timing will automatically adapt. The number of CPU cycles between low-pulses is the same on PAL and NTSC machines.

Sampling the UP and DN bits should be done at a rate of at least 45ms in order not to miss a pulse. You should count the number of high-to-low changes, but not the static signal in the UP and DN bits. If you link your wheel-routine with the system timer interrupt (Jiffy IRQ), the sampling rate will be high enough, as the interrupt occurs every 17ms (60Hz). Other interrupt sources like a raster-IRQ are also possible, as even a PAL raster IRQ comes at a rate of 50Hz (20ms).

This part of the manual also applies to the old Micromys, originally developed by Marko Herold, who sold the design to us. The difference to the older hardware is the absence of DIP switches and therefore the absence of Amiga- and Atari modes. The C64 / 1351 emulation mode is identical to Micromys V1, so any software that you write for the C64 will also work with the existing customer base. We're happy to answer any support questions, including code review and cross-testing with the old Micromys model and the original 1351 mouse. Let us know if we should update the list of programs on this site with a link to your software!

Amiga

Wheel and middle mouse button data is transferred through the potentiomenter input (PotX). Although this is an analog input, it's two digital units talking to each other, and the protocol nulls any error in transmission. The protocol for transporting the data into the Amiga aims at the least possible CPU usage, and it's making smart use of the Amiga's hardware.

First of all, set the PotX line into potentiometer mode and make sure that the operating system does not change this setting back to "digital input" in the VBlank IRQ. Note that the Amiga requires the software to start each and every measurement. The fact that every measurement is a discrete process is used by Micromys, as two values are transferred to the Amiga for a single set of wheel data: One calibration value and a data value that includes four valid bits of data. The calibration value is required, because values change with different screenmodes.

Read two consecutive values from the PotX register, doing two measurements. It does not matter in what order you actually read the two values, as the calibration value is always the same. The calibration value is always bigger than the data value, so the two are easily distinguished. The following assumes that you have put the calibration value (the larger one) into variable A, and the data value into variable B. Variable C is a working-variable.

C=(B*127/A) - 9 

Reduce variable C to an unsigned byte by cutting off any fractions. This really means cutting off fractions, not mathematical rounding! The data word C now contains the middle mouse button in bit 6. In other words: If C is larger or equal to 64, then the middle mouse button (or wheel) is pressed. If the MMB is pressed, subtract 64 from C and continue:

C=2*C/3 

This time, do not just cut off fractions, but round mathematically correct. Bits 4,3 and 2 now contain the lower three bits of the scroll-counter, where bit 4 is the LSB:

Bit 7 6 5 4 3 2 1 0
Function 0 0 0 SCRL0 SCRL1 SCRL2 0 0

Should bit 0 and 1 of C not be 0, they can be used to identify and correct any measurement errors. In addition to that, the order of the bits allows you to reduce the number of valid bits to two, in case an extremely low HSync frequency introduces more error than the protocol can balance.

Links


Resellers

Please shop locally. Our partners are listed in alphabetical order.

Personal tools