Hard Group - Kempston mouse.

ZX Club #09
                                          
(C) SERGIUS PUZZLER / PROXIMA             
 special for ZX-Club magazine          
                                          
 - KEMPSTON MOUSE -            
                                          
   Or just a mouse. It's very convenient to
using the control device
cursor, unlike joysticks and simply
keys  Maybe in the future someone inquisitive
mind and come up with a more perfect one
manipulator, but now let's
be content with what you have.            
   This product allows you to easily
move the hand holding the mouse
cursor across the screen as soon as this
the situation demands, simultaneously clicking
two or three buttons (who has how many
yes).                                    
   A little so-called theory. Available
three ports. These are:                           
 64223 (#FADF) - button state;    
 64479 (#FBDF) - X coordinate;        
 65503 (#FFDF) - Y coordinate.        
 The buttons have the followinglayout and
purpose: left - FIRE, main button -
the 0th bit is responsible for its state; right
button - CANCEL, SELECT or MARK, 1st bit
button ports;   average - for others
additional functions,respectively 3rd
bit.                                      
 Coordinate values are in the range from
0 to 255.At the same time, moving the mouse to the right
increases the X coordinate, and forward (from
yourself or up, whichever is more familiar to you) -
coordinate Y. Naturally inverse
movements lead to a decrease in values
coordinates                                
   There is an option for another connection of the left and
the right buttons are the opposite. Lleft - 1st bit,
and the right one is 0.  Personally, for my left
the button responds with the 0th bit, because logically he
first, and therefore more important (although
the youngest). But most programs with
which I dealt with support
option where for the main left button
The 1st bit responds (second in order,
therefore it simply cannot bemain).                                 
   For example, Vyacheslav Mednonogov in
their latest programs UFO-2 and BLACK
RAVEN supports option with main 0
bit,  which I think is more correct
decision.  More modern drivers
kemston mice have auto-configuration.
The first button pressed after starting work
of this program becomes the main one. If
You need this driver, then you
you will find at the end of this article.              
   Now let's move on to the control circuit itself.
Lera. Here is a list of required parts: 
 DD1-DD2 - K 561 IE 11 (4 pcs.);       
     DDZ - K 555 AP 5 (2 pcs.);       
     DDCh,DD7 - K 155 LP 8 (1 pc.);       
     DDS - K 555 ID 7 (1 piece);       
     DDb - K 561 TL 1 (1 piece);       
 R1-R3 - 1 kOhm, 0.125 W (3 pcs.);   
     R4* - 150 Ohm, 0.125 W (1 piece);   
     R5-R8 - 6 kOhm, 0.125 W (4 pcs.).   
 Here we have two main nodes.
The first one is triggers, located in the housing
mouse, and the second and more important one is himself
directly the controller, consisting of
two coordinate counters and a decoder
the above ports.For those who have the desire and even
a little experience without difficulty according to the above
diagram will assemble this device. Otherwise you'll have to
ask someone about it.                  
   A few comments on the diagram and assembly.
Microcircuits of the 155, 555 and 1355 series
are interchangeable,they differ mainly
only speed and maybe more
power consumption.    More
1355 series is preferred.All resistors
0.125 W,  but more can be supplied
powerful, although they are several in size
larger.                                  
Module A is manufactured in two
copies.  Signals "Xa", "Xb" and "/XCS"
on the second copy they are called “Ua”, “Ub”
and "/YCS"  and they all connect to
corresponding to module B. Remaining
signals are connected to the system bus.
The power supply for the microcircuits is supplied as follows: to the leg
with the highest number is a plus, and with the number
half as much - minus (“ground”). All this
placed on one board.               
   Now do the following. From BASIC
Poll in a loop, for example, port 64223.
If you get a stable value of 255,
then everything is fine, you can skip it
a few paragraphs. Otherwise, youwill be required
block internal ports
your computer.    For owners
For SCORPIONs it is simply a must.       
   To do this you need to assemble module D, that's all
on the same board. And connect the same names
signals of modules D and B. Namely "/BCS",
"/XCS" and "/YCS". Set the signal "/IORQGE" with
with the same name on the computer board (on
SCORP has it).   If there isn't one
found, then it needs to be organized.
We take a resistor with a resistance of 560 Ohms,
connect it with one side to the signal
"/IORQGE" from module D and the other to "/IORQ"
from module B or from the computer board. Here
and that's all.                                    
                                          
Of course, not quite everything. More is needed adapt the mouse itself. Let's open it. Let's see what we can get out of it, and what to leave. You will need a different cord nine-wire, but put this one aside, maybe Afterwards it will do well on the farm. We take it out mouse handkerchief. Let's dismantle it cord block, microcircuit, resistors, capacitor and, if available, a diode (may not one). But for now, leave those of the resistors that fit LEDs, maybe with it will work, we'll check later. Now according to the designation on the handkerchief (emphasis on first syllable) plus electrolytic capacitor, which we have removed, we determine the plus of the LEDs. Or, if you can, define it using testora. This is necessary for correct power supply to the LEDs. Solder in DDb chip according to module C diagram. Let's analyze the layout of the tracks on the handkerchief. We leave the useful ones, cut off the unnecessary ones or delete it altogether so as not to embarrass you. Add missing connections using thin wires, hang resistors R5-8 directly to the m/scheme. We start them on "ground". Solder itmiddle contacts μ/switches to signals B1-3 modules B. B1 - left, B2 - right, B3 - middle. We place normally open contacts on "ground". Let's check it properly again correct connections. And not only on mouse handkerchief. Because the scheme will be work immediately if the installation is correct. Will refuse only in two cases. First - incorrect assembly. The second one is wrong selected LED power resistor. But we didn’t pick him up. Therefore, first Check it out, maybe everything is already working for you - et. To do this, run, for example, ZX-FORMAT, one of the latest. If everything ok, then I'm just happy for you. Otherwise, you need to select the resistor R4 of the module C. We put a 5 kOhm variable instead. And by moving the mouse, we reduce its resistance nie, seizing the moment of confident movement cursor. Then we measure the current variable resistance, preliminarily by unsoldering it. And put R4 of the corresponding meanings. It may turn out that the cursor does not move in that direction, but in the opposite direction. Just take and swap the signals "Ha" and "Xb" for horizontal movement or "Ua" and "Ub" for vertical. If the cursor jumps chaotically across the screen, then perhaps will helpcapacitors with a capacity of 10 nF, soldered in parallel with micro power supply IE11 module A circuits. That's probably all. Maybe I'm something- I forgot to write, now I can’t I remember everything I encountered in the manufacturing process of this device. So if you have difficulties with anything, don’t be lazy, write to me, and I will I won't be too lazy to answer you. 601909, Vladimirskaya district, Kovrov, st. Kuibysheva, 4/1, apt. 43, Gorelkin Sergey. See you in the intersectoral space. SP 09.15.98 ;MOUSE DRIVER WITH FIRE*BUTTON AUTOCONFIG ;(C) Andrey Rachkin'95 ORG 30000 JR MDRV DIRECTZ DEFB 0 ;FIRE DEFB 0 ;UP DEFB 0 ;DOWN DEFB 0 ;RIGHTDEFB 0 ;LEFT DEFB 0 ;CANCEL MCOORD DEFW 0 ;LAST CURSOR COORDS ;IN PIXELZ MPORTS DEFW 0 ;LAST READED MAUSY COORDS NONDEF AND 3 ;HERE COMEZ BUTTONZ ;CONTROL IF FIRE BUTON ;NOT DEFINED JR Z,MDRVЧ ;IF NONE BUTTON ;PUSHED СР 1 JR Z,NONDEF_ XOR A LD (MDRVЗ+2),A LD A,5 LD (MDRV2+2),A NONDEF_ LD HL,0 LD (MDRV1),HL POP IX ; *****MAIN PROC OF MOUSEDRIVER ***** MDRV PUSH IX LD HL,DIRECTZ PUSH HLPOP IX XOR A LD (HL),A ;CLEARING INC HL ;OF LD (HL),A ;DIRECTZ INC HL ;BUFER LD (HL),A INC HL LD (HL),A INC HL LD (HL),A INC HL LD (HL),A INC HL LD ВС,#FADF ;BUTTONZ CONTROL IN A,(С) ;READING FROM PORT ;OF BUTTONS CPL MDRV1 JR NONDEF ;JR UNTIL FIRE ;BUTTON NOT DEFINED RRA MDRV2 RL (IX+0) ;FIRE RRA MDRVЗ RL (IX+5) ;CANCEL ; *****COORDS CONTROL ***** MDRVЧ LD HL,(MCOORD) ;FORM LAST ;CURSOR COORDS LDDE,(MPORTS) ;FROM LAST ;READED MOUSE ;COORDS LD ВС,#FBDF IN A,(С) ;READING FROM ;PORT X-COORD (0-#FF) LD (MPORTS),A SUB E JR Z,MDRV9 JP Р,MDRVб LD (IX+4),1 ;MOVE LEFT ADD A,L JR С,MDRVS XOR A ;MIN X-COORD MDRVS LD L,A JR MDRV9 MDRVб ADD A,L LD (IX+3),1 ;MOVE RIGHT JR С,MDRV7 СР #FE ;MAX X-COORD JR С,MDRV8 MDRV7 LD A,#FE ;MAX X-COORD MDRV8 LD L,A MDRV9 LD В,#FF IN A,(С) ;READING FROM ;PORT У-COORD (0-#FF) LD (MPORTS+1),A SUB D JR Z,MDRV14 NEG JP Р,MDRV11 LD (IX+1),1 ;MOVE UPADD A,Н JR С,MDRV10 XOR A ;MIN У-COORD MDRV10 LD Н,A JR MDRV14 MDRV11 ADD A,Н LD (IX+2),1 ;MOVE DOWN JR С,MDRV12 СР #BF ;MAX У-COORD JR С,MDRV13 MDRV12 LD A,#BF ;MAX У-COORD MDRV13 LD Н,A MDRV14 LD (MCOORD),HL ;NEW CURSOR ;POSITION ;IN PIXELZ POP IX RET ; *****DRIVER END *****

Share your thoughts about the article