
AN-681| Application Note
PC MOUSE Implementation Using COP800
PC MOUSE Implementation Using COP800
ABSTRACT The mouse is a very convenient and popular device used in data entry in desktop computers and workstations For desktop publishing CAD paint or drawing programs using the mouse is inevitable This application note will describe how to use the COP822C microcontroller to implement a mouse controller INTRODUCTION Mouse Systems was the first company to introduce a mouse for PCs Together with Microsoft and Logitech they are the most popular vendors in the PC mouse market Most mainstream PC programs that use pointing devices are able to support the communication protocols laid down by Mouse Systems and Microsoft A typical mouse consists of a microcontroller and its associated circuitry which are a few capacitors resistors and transistors Accompanying the electronics are the mechanical parts consisting of buttons roller ball and two disks with slots Together they perform several major functions motion detection host communication power supply and button status detection MOTION DETECTION Motion detection with
a mouse consists of four commonly known mechanisms They are the mechanical mouse the opto-mechanical mouse the optical mouse and the wheel mouse The optical mouse differs from the rest as it requires no mechanical parts It uses a special pad with a reflective surface and grid lines Light emitted from the LEDs at the bottom of the mouse is reflected by the surface and movement is detected with photo-transistors The mechanical and the opto-mechanical mouse use a roller ball The ball presses against two rollers which are connected to two disks for the encoding of horizontal and vertical motion The mechanical mouse has contact points on the disks As the disks move they touch the contact bars
National Semiconductor Application Note 681 Alvin Chan June 1990
which in turn generates signals to the microcontroller The opto-mechanical mouse uses disks that contain evenly spaced slots Each disk has a pair of LEDs on one side and a pair of photo-transistors on the other side The wheel mouse has the same operation as the mechanical mouse except that the ball is eliminated and the rollers are rotated against the outside surface on which the mouse is placed HOST COMMUNICATION Besides having different operating mechanisms the mouse also has different modes of communication with the host It can be done through the system bus the serial port or a special connector The bus mouse takes up an expansion slot in the PC The serial mouse uses one of the COM ports Although the rest of this report will be based on the optomechanical mouse using the serial port connection the same principle applies to the mechanical and the wheel mouse MOTION DETECTION FOR THE OPTO-MECHANICAL MOUSE The mechanical parts of the opto-mechanical mouse actually consist of one roller ball two rollers conn
ected to the disks and two pieces of plastic with two slots on each one for LED light to pass through The two slots are cut so that they form a 90 degree phase difference The LEDs and the photo-transistors are separated by the disks and the plastic As the disks move light pulses are received by the phototransistors The microcontroller can then use these quadrature signals to decode the movement of the mouse
Figure 1a shows the arrangement of the LEDs disks plastic and photo-transistors The shaft connecting the disk and the ball is shown separately on Figure 1b Figure 2 shows the signals obtained from the photo-transistors when the mouse moves The signals will not be exactly square waves because of unstable hand movements
AN-681
PC is a registered trademark of International Business Machines Corporation C1995 National Semiconductor Corporation
TL DD10799
RRD-B30M75 Printed in U S A
AN-681 Application Note national Download PDF
Add this permalink to your bookmarks for future download of AN-681 ApplicationNote
Permalink: http://application.emcelettronica.com/national/AN-681