Xref: utzoo comp.sys.amiga:25069 comp.sys.amiga.tech:2382 Path: utzoo!attcan!uunet!ncrlnk!ncrcae!ece-csc!mcnc!ecsvax!dukeac!sgt From: sgt@dukeac.UUCP (Stephen G. Tell) Newsgroups: comp.sys.amiga,comp.sys.amiga.tech Subject: Re: Amiga Mouse info needed Summary: what the quadrature signals are and one hardware decoding scheme. Keywords: Amiga Mouse Info Pinouts Message-ID: <1093@dukeac.UUCP> Date: 8 Nov 88 20:39:16 GMT References: <7804@bloom-beacon.MIT.EDU> Reply-To: sgt@dukeac.ac.duke.edu (Stephen G. Tell) Organization: Academic Computing, Duke University, Durham, NC Lines: 77 I build somthing to deal with mouse signals once, and I think I remember it enough to explain how it works. I don't have a manual handy, so I don't know the pinouts, but if you have the simple introductory manual, its good enough with a bit of explaining: Power & ground are obvious The amiga supports 3-button mice on the 9-pin plug, The mouse that comes with it uses button 1 and 3 inputs, (I think) I've actually got a 3-button mouse on my machine, but haven't fooled around with software to use the new middle button. The horizontal (vertical) quadrature pins tell you speed and direction for the two axes. I'll speak in terms of horizontal, vertical is the same. The two horizontal signals are basicly the same signal; reversing them changes the apparent left/right direction. I forget what the manual's pinout calls them exactly, but it leads you to believe that they are somehow fundamentaly different. If you have a dual-trace scope, hook power to the mouse and look at the two horizontal quadrature signals as you move back and forth, then the following should become clear: Either signal alone gives you speed information as a certain number of pulses per unit distance the mouse is moved. The relative phase of the two signals tells you what direction you're moving. If we call the two signals A and B, they might look like this for leftward movement: ____ _____ _____ A |_____| |_____| |_____ __ _____ _____ __ B |_____| |_____| |_____| And like this for rightward movement: __ _____ _____ A |_____| |_____| |_____ _____ _____ _____ __ B |_____| |_____| |_____| At any transition of any line, look at the other line to tell you what direction you're going as follows: A B moving rising high left rising low right falling high right falling low left high rising right low rising left high falling left low falling right How to do this in hardware: One way that I've seen it done is to generate a short pulse with a one-shot on both transitions of both lines (4 one shots, give short high pulses on each of A rising, A falling, B rising, B falling) and then AND these each of these with the correct one of A, inverted-A, B or inverted-B as in the table. Then, Or together each of these 4 pulses for left and 4 for right and feed that to a counter. The pulses from the 1-shots have to be shorter than the pulse rate from the highest rate of movement you expect from the mouse. There are other ways to do the hardware; someone want to tell us how the Amiga does it? -- Steve Tell Student, Duke University; Employee, Duke Tel-Com (summer only) Former Chief Engineer, Cable 13 / Duke Union Community Television. sgt@dukeac.ac.duke.edu; {ihnp4, ulysses, et. al.}!mcnc!ecsgate!dukeac!sgt