home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magazyn Exec 5
/
CD_Magazyn_EXEC_nr_5.iso
/
Recent
/
hard
/
hack
/
ps2m.lha
/
ps2m_manual
< prev
next >
Wrap
Text File
|
2001-06-03
|
15KB
|
410 lines
Amiga PS/2 Wheel Mouse Controller v1.4
Advantages of this controller:
- full open source under GPL
(General Public License, text of license included)
- linear movement interpolation: mouse movements will be
ideal smooth on any screen frame rates
- MMB (Middle Mouse Button) support
- System-friendly fourth mouse button support
- Fifth mouse button support - now on Amiga too!
- detection of Amiga mouse counters overrun
(127 pixels per frame for DblPAL 48Hz)
- full Plug'n'Play support:
hotswap - you can change mouse «on the fly»
- mouse hangs detection: controller checks mouse every
2 seconds and will reset it if mouse doesn't reply
- support of popular Microsoft Intellimouse wheel protocol
(for example, Genius NetScroll)
- support of Microsoft Intellimouse Explorer protocol
(for example, A4Tech WOP-35 - all 5 buttons work)
- fully compatible with Amiga NewMouse wheel standard
- fully compatible with WheelBusMouse software
- you can simultaneously use mouse & 2 joysticks
- no «calibration» requirements
- wheel works in any screen mode
- horizontal scrolling even on one-wheel mouse
- very low CPU load in wheel mode
- most advanced Amiga PS/2 mouse controller :-)
More detailed info:
- detection of Amiga mouse counters overrun:
Amiga has only one-byte signed counters for mouse, and AmigaOS
checks them only one time per vblank. This means that mouse may
move only 127*VBlankFreq pixels per second (6096 pixels per
second for default DblPAL). If this value was overran, AmigaOS
can't detect true movement of mouse and pointer will disorderly
jump. For correct this, my PS/2 controller limits movement to
maximum 6000 pixels per second. If mouse moves faster, movement
will be remembered and executed at 6000 pixels per second.
Slower movements will be always executed at real speed.
- linear movement interpolation:
As we know, RS-232C (aka «COM») mice at PeeCee are extremely
poor quality - mouse pointer with them doesn't move, it jumps.
It is because generic 3-button RS-232C mouse reports about
movement only 25 times per second. PS/2 mice work better - all
of them can report about state 80 times per second, and most of
them (excluding 5-button mice) can report 200 times per second.
But it is not an ideal because refresh rate of mouse (for
example, 80fps of Genius NetScroll Optical) interferes with
similar refresh rate (for example, 72Hz of Super72). For correct
this, my controller moves «virtual Amiga mouse» smoothly. If
user moves PS/2 mouse at 500 pixels per second, Amiga will get
from my PS/2 controller true 500 counts per second, with true
2-milliseconds intervals - you can get oscilliscope and check it.
Most another PeeCee-mouse-controllers don't have similar feature,
and move «virtual Amiga mouse» by «count packets» after every
byte packet from PeeCee-mouse. For example, if user moves
RS-232C mouse at 500 pixels per second, and mouse sends 25
reports per second, Amiga will get 25 packets of 20 fast (some
microsecond between counts) counts per second, with approx.40
milliseconds interval between packets. If user has 75Hz screen
refresh rate, mouse pointer will update only every three vblank,
and jumps of pointer (in comparison with ideally smooth Amiga
mouse) will only incline user to suicide using mouse cord :-)
My PS/2 controller is free from this bug. Theoretically I can do
even smooth RS-232C mouse controller, but is it nonsense because
of RS-232C mice death. Modern optical mice already don't have
RS-232C versions, but there is no modern mice without PS/2 version.
- mouse hangs detection:
Some Chinese mice are very cheap and very unstable. Integrated
to mouse controller can hang and even don't response to reset
command. These mice on PeeCee require reconnect (and sometimes
reboot because of not-PnP initial nature of PeeCee). My
controller in case of 2-seconds silence (user doesn't touch
mouse) asks mouse about state. If mouse doesn't respond,
controller will automatically take away power souce for some
time.
Take care: hardware reset does not work in 5-button version because
of lack of PIC pins - you can select between 5-buttons version with
quality mice, and 4-buttons version with bad mice. But anyway, you
can reset mouse by reconnect it «on the fly». It is not a PeeCee :)
- full Plug'n'Play support:
Because of previous feature, controller will detect mouse
replacement. Unlike PeeCee, wheel function (or it's absence)
will be detected automatically. You don't need to replace
drivers if you change mouse «on the fly» :)
- support of popular Microsoft Intellimouse wheel protocol
Microsoft (for this paragraph it is a company name, not an abuse)
instead of it's normal practice to hide all details, published
protocol of wheel mouse. It has two «layers»: protocol of wheel
mouse, and protocol of 5-button wheel mouse. There are many
Microsoft Intellimouse compatible devices (for example, Genius
NetScroll Optical), and all of them will work with wheel at my
controller.
Some other mice are Intellimouse Explorer (5 buttons) compatible.
For example, it is A4Tech WOP-35. That mice will work with all 5
buttons. If you use 4-buttons version of controller, both
additional buttons will work as one.
Another mice, like of Genius NetScroll Optical, can be compatible
with Intellimouse, but incompatible with Intellimouse Explorer -
them will work as 3-button wheeled mice. Some mice may be even
incompatible with Intellimouse and them will work only as 2/3 button
mice without wheel.
Current version doesn't support any other protocols than
Intellimouse/Explorer. But now I have a protocol analyzer and can
add support of ANY mice. Genius NetScroll Optical will be first.
If you have unsupported mice - you can send me it (or money, enough
for buy it here) by mail, and I will do support for it. If you are
interested - welcome to my e-mail-box ;)
- Fifth mouse button support - now on Amiga too!
Up to this time there was only maximum 4-button mice support on
Amiga. My controller breaks this barrier - let's be more buttons,
good and different! :)
- horizontal scrolling even on one-wheel mouse
You can switch vertical scrolling to horizontal by qualifier
pressing - like MMB in Mroocheck, but you can select any
qualifier key or joystick/mouse button. For example - I use
left ALT. Additional 4th and 5th mouse buttons may be used
for this too.
- fully compatible with Amiga NewMouse wheel standard
Amiga NewMouse standard describes an internal AmigaOS protocol
for wheel mice. There are some NewMouse-compatible sofware,
MUIWheel and Directory Opus Magellan for example. All this
software will work with my PS/2 controller.
Unfortunately, Amiga NewMouse standard describes only four buttons.
But anyway, any of two additional buttons may be used as generic
fourth button, and another - as qualifier for X-Y scroll temporary
switching.
- fully compatible with WheelBusMouse software
WheelBusMouse is a software driver early released by me, that
allows to use any wheel mouse without controller (but you must
alter the mouse). My PS/2 controller is fully electrically
compatible with WBM package. This means that you can install
WBM driver and use altered wheel mouse instead of soldering
PS/2 controller. Or you even can simply plug second mouse and use
it as a scroller :-)
- you can simultaneously use mouse & 2 joysticks
You can use joystick(s) in parallel with mouse: pressing «Fire»
of any joystick will disable mouse function on this port.
If you press «Fire» on Joy1 (wheel function) - wheel will be
reseted to initial phase (don't touch wheel during game).
If you press «Fire» on Joy2 (mouse port) - mouse will be disabled
at all. For protect against probable mouse movement, mouse will
be enabled only after any mouse button pressing.
- no «calibration» requirements
My controller doesn't use analog inputs and doesn't require
calibration (like Mroocheck interface from Elbox).
- wheel works in any screen mode
Wheel works in any screen mode - you can simultaneously use
wheeled applications on PAL, DblPAL, Super72 or any other
screens (unlike Mroocheck with horizontal rate setting).
- very low CPU load in wheel mode
This controller doesn't use any software emulated serial protocols
like CD32 joypad and analog-to-digital conversions like Mroocheck.
It reduces slow chipset reading/writing cycles number to absolute
minimum, and this wheel solution is the fastest ever made for Amiga.
- most advanced Amiga PS/2 mouse controller.
Do you doubt in this yet? :) ;) =)
How to do it:
Download aminet:dev/cross/devpic.lha and use it for PIC16F84:
picprog ps2m.hex force=16382 cw=16382
You can use any third party programmers - select options:
OSC = HS
WDT = ON
After programming you can solder scheme from ps2m.png.
RESISTOR AND CAPACITORS ARE RECOMMENDED, BUT NOT MANDATORY.
You can solder scheme only with PIC and crystal resonator,
and it will work. If it is unstable or does not work at
all, you can try capacitors with crystal, and then - capacitor
and resistor near mouse.
I recommend you to use socket for PIC - it will simplify firmware
upgrades.
If scheme does not work - try another mouse. It may be
incompatibility with some mice. If several different mice
don't work - check connections: scheme is already tested and
doesn't contain bugs.
If you had problems with PIC programming - try new devpic
release 1.6 with v3 hardware, it is more stable than v2.
Two versions of hardware
From version 1.4, there is two versions of hardware and firmware:
- 4-button version with hardware reset feature
- 5-button version without hardware reset feature
4-button version (ps2m_mousepower.#?) is intended for use with
non-optical mice with potentially poor quality. It has hardware reset
feature like previous versions. It can't be used with modern optical
mice because of low-current output of PIC, and it is useless for
high-quality mice that don't hang. If you use 5-button mouse in this
mode, additional buttons will act like one.
5-button version (ps2m_5button.#?) is intended for use with
high-quality, rich-featured, optical mice. It can't reset mouse by
power switching. Anyway, even if this mouse hang, you can reset it
by reconnect «on the fly». This version can be used with any mice.
Why it is? It is because of lack of PIC pins :-)
Don't forget to select correct firmware for selected hardware :)
If you don't know, what version to do - build 5-button version.
(if you mouse hangs - it is a good reason to buy some better :)
WARNING! That two versions has DIFFERENT connection to joystick
port! This is because of pull-up needed for joystick fire-1, used for
5th mouse button - RA lines of PIC don't have it, and it was connected
to RB5 line. RA4 was reconnected to joystick fire-0.
For 5-button version:
connect 3-11-12-13 PIC pins with joystick port 6-9-3-1 pins.
For 4-button version:
connect 11-12-13 PIC pins with joystick port 6-3-1 pins.
There is reference PCB design by Marc SAVART <sil51@ifrance.com> in
this package. It was made for A4000T. You can see this device photos
in hard/hack/ps2m_example.lha. I can't give any warranty for this -
personally my ps2m was soldered by wires :-)
Warning: this design was made for 4-button version with hardware
reset feature. If you want to use 5-button version without hardware
reset feature, you must reconnect some wires.
Recommended mouse:
Genius NetScroll Optical (PS/2 version).
It have very good ergonomical design and good quality.
Installation:
Simply plug controller in mouse port :)
For wheel mice: insert WBM utility in your startup:
c:wbm
If you want to remove copyright message:
c:wbm quiet
If you want to reverse wheel action:
c:wbm reverse
If you want to reverse only horizontal scrolling:
c:wbm rx
If you want any Shift for horizontal scrolling:
c:wbm lshift rshift
If you want that 4th/5th buttons work as system-wide 4th mouse button:
c:wbm lfb rfb
Additional parameter - priority (0 by default):
c:wbm priority=10
Priority will be important in cases when you have continuous working
program (for example, archiver) with priority higher than WBM. WBM
priority is recommended to be higher than priority of any continuous
task.
Of course, you can mix options in any way. See "wbm ?"
and history for full list of options in current version.
Driver may be terminated by break signal on WheelBusMouse process.
How to use wheel(s) in AmigaOS:
Download FreeWheel and MUIWheel from Aminet, and see docs.
History:
1.4
- my email was changed - now it is rdc@cyberlan.mtu-net.ru
- added 5-button Intellimouse Explorer protocol support
- added support of 4th button event into WBM
CLI options: LFOURTHBUTTON=LFB/S,RFOURTHBUTTON=RFB/S
- two versions of hardware:
- 4-button version with hardware reset feature
- 5-button version without hardware reset feature
1.3
- corrected bug in PCB
1.2pcb
- added reference PCB design by Marc SAVART <sil51@ifrance.com>
1.2
- more compatible firmware, for example it supports Dexxa mice
- more advanced WBM utility:
- added reverse of concrete wheel direction: RX and RY
- added qualifiers for scrolling direction change as
CLI options: LMB/S,MMB/S,RMB/S,JOYFIRE0=JF0/S,JOYFIRE1=JF1/S,
JOYFIRE2=JF2/S,CTRL/S,LSHIFT=LSH/S,RSHIFT=RSH/S,
LALT/S,RALT/S,LCOMMAND=LCMD/S,RCOMMAND=RCMD/S
1.1
- more detailed manual
- more advanced WBM utility:
- you don't need c:run for wbm startup anymore
- driver eats less CPU time (WaitTOF() instead of Delay())
- added CLI arguments: REVERSE/S,PRIORITY/N,QUIET/S
1.0
- first Aminet release
Near (really!) future:
- Genius NetScroll Optical 5-buttons support
- Support of any your mouce, if you send it me
- Advanced system-wide wheels and additional buttons support
(will be more useful than FreeWheel and any PeeCee wheel soft)
- MUI configuration
- two wheels support (A4Tech WOP-35). PIC16F627 will be needed
for this - but not required if you don't use second wheel.
License:
All source code (including both mouse controller code and wheel
driver) and all ideas of this controller are distributed under GPL
(GNU General Public License). About ideas: it means that all
product contained my ideas must be released under GPL too :)
Sponsors of this project:
AmiS
Presizen Oleg Michaylovich
Eugene Ananyeff
Vitaly Chepeleff
Jedi
Eugene Semenkov
Useless
iERiS
ROY
Alexey Klochkoff
Vinnny (Vlad Vinogradoff)
Thanks to:
3BEPb <ldk@channel4.ru> for beta-testing
Marc SAVART <sil51@ifrance.com> for PCB design
Enjoy!
rdc@cyberlan.mtu-net.ru