Small modification to the mouse controller circuit for AT89C2051 (MSC-51)
ZXNet echo conference «hardware.zx»
From Eugene Stahov → To All 21 August 2000
Hello All.
=== Cut ===
=================== kmsps2.t =================================
PS/2 -> Kempston Mouse Adapter v1.03
(c) 1999-2000 Studio STALL
Version for microcontrollers AT89C1051/AT89C2051 (MSC-51)
(+) The reset circuit has been changed - RC has been replaced by DD1D - now the circuit is
reset by general reset (previously only when turned on)
===============================================================================
DD1A DD1B DD1C DD2A
1┌───┐ 4┌───┐ 9┌───┐ 1┌───┐
A7 ──────┤& 0───┬──┤& 0──────┤& 0──────┤1 ├──┐
A6 ──────┤ │3 └──┤ │6 ┌──┤ │8 ┌──┤ │3 │
2└───┘ 5└───┘ │10└───┘ │ 2└───┘ │
A4 ─────────────────────────┘ │ │
A5 DD2C │
┌─────────────────────────────┘
DD2D │ 4┌───┐ DD2B 9┌───┐
12┌───┐ └──┤1 ├────────┬──────┤1 ├───|<|── /WAIT
/RD ─────┤1 ├────────┤ │6 │ ┌───┤ │8
/IORQ ───┤ │11 5└───┘ │ │ 10└───┘
13└───┘ │ │ DD2C
/CS │ │
┌──/RES ┌───────────────────────┴──│─┐
│ DD1D │ ┌───────────────────────┘ │
│13┌───┐ │ │ C1 10uF + │ +5V
├──┤& 0──┐│ │ ┌────│────────────────┤
└──┤ │11││ │ 1┌───┬─────┬───┐20│ │1┌───┬────┬───┐2012└───┘ └│──│───┤RES│ A │VCC├──┘ └─0 OC│ RG │VCC├─┘
MDAT───────│──│───┤P30│ T │P17├─────────┤ I7│ │O7 ├─────D7
│ └───┤P31│ 8 │P16├─────────┤ I6│ │O6 ├─────D6
│ ─┤X2 │ 9 │P15├─────────┤ I5│ │O5 ├─────D5
14MHZ ─────│──────┤X1 │ C │P14├─────────┤ I4│ │O4 ├─────D4
└──────┤P32│ 2 │P13├─────────┤ I3│ │O3 ├─────D3
MCLK──────────────┤P33│ 0 │P12├─────────┤ I2│ │O2 ├─────D2
A10───────────────┤P34│ 5 │P11├───┬─────┤ I1│ │O1 ├─────D1
A8────────────────┤P35│ 1 │P10├───│┬────┤ I0│ │O0 ├─────D0
┌────┤GND│ │P37├─ ││ ┌──┤GND│IR33│ C ├── +5V
│ 10└───┴─────┴───┘11 ││ │10└───┴────┴───┘11
─┴─ DD3 ││─┴─ DD4
┌─┘└─┐
┌┴┐ ┌┴┐
R1,2 │ │ │ │
1K └┬┘ └┬┘
└────┴──+5V
Расположение контактов в PS/2
┌──┐ ┌──┐
N/C 6 ──── ┌┘* └─┘ *└┐ ─── 5 MCLK
+5V 4 ──── │* *│ ─── 3 GND
N/C 2 ──── └─┐* *┌─┘ ─── 1 MDAT
└─────┘
Вид на розетку со стороны контактов (не со стороны пайки)
Микросхемы:
DD1 1533ЛА3
DD2 1533ЛЛ1
DD3 AT89C2051
DD4 1533ИР33 (АHАЛОГ ИР22, HО БОЛЕЕ УДОБHАЯ ЦОКОЛЕВКА), можно и АП6, только с
учётом цоколёвкиThe circuit is designed for connection to a computer that does not have port conflicts
#DF. If there is still a conflict, or there is a #FF port, then you need to assemble the circuit
management /IORQGE
How is the interface with the computer implemented?
In the idle state, line P31=0, so when the processor accesses the DF port
/WAIT will be issued. After the desired coordinate is issued, /WAIT
released by transferring P31->1. After completion of the Z80 cycle IOR P31->0.
About the purpose of resistors R1,2: Lines P10 and P11 do not have internal pull-up
resistors.
Decoding is quite tough: A7, A6, A5, A4, A10, A8 are involved
This scheme only supports 2-button mice (I only had
such), for 3-button models the middle button is not used.
When turned on, if there was no mouse movement, and also if the mouse did not
connected to the connector, the following will be read from the ports:
#fadf (64223) = 255 - buttons
#fbdf (64479) = 40 - x
#ffdf (65503) = 41
Warning: This firmware version does not allow mouse connection when
computer turned on.
Firmware version 2.0 will allow:
1. Connecting the mouse in a "hot" state
In this version, the controller will “see” the mouse upon reset
2. Ability to switch left and right buttons, both from the program and
buttons of the mouse itself.
3. Ability to identify this circuit (#FEDF port)
4. Support for three-button (or more) mice.================== PS2DRV.HEX =====================
:1000000002002630B51730B40B85059000D2B1C27E
:10001000B1D2213285049000D2B1C2B13285239091
:1000200000D2B1C2B13275A80175880175B80174EA
:1000300028F50404F505E4F520F521F522C2B17593
:1000400023FFC221D2AF3021FDD2B374F475F00882
:10005000C2B020B3FD1392B030B3FDD5F0F413A2BB
:10006000D0B320B3FD92B030B3FD20B3FDD2B03099
:10007000B3FD20B3FD30B3FDD2AF1200800200A665
:10008000D2B0D2B320B3FD30B3FD75F00820B3FD7C
:10009000A2B01330B3FDD5F0F420B3FD30B3FD2092
:1000A000B3FD30B3FD227820D2AF1180F608B8231B
:1000B000F9E5022521F502F504E5032522F503F50E
:1000C00005A200B39219A201B3921880D9A2E1331C
:0E00D00092E2A2E33392E4A2E53392E6C42268
:00000001FF
======== [ Saw, Shura, saw ... ] =========================
The transition to the AT90C1200 microcontroller (AVR) is planned.
- duration /wait is shortened 12 times
the microcontroller coincides with the AT89S2051, to exclude
чением сигнала RESET - v AT90C1200 on /RESET, t.e. hopefully it will be
turn off DD1D
Eugene Stakhov
Mon Aug 21 2000 18:42:29
=== Cut ===
Eugene