Part Number 800-0402 Revision: A of 17th December 1982 User's Guide for the Sun Workstation Mouse Subsystem Sun Microsystems, Inc., 2550 Garcia Avenue Mountain View California 94043 (415) 960-1300 This User's Guide to the Sun Workstation Mouse Subsystem was produced by Henry McGilton, of Sun Microsystems. Some of the material in this guide derives from the Mouse Systems Corporation manual entitled Mouse Instructions — this material was donated by Steve Kirsch of Mouse Systems Corporation, and his help is gratefully acknowledged. Credits and trademarks Sun Workstation is a trademark of Sun Microsystems Incorporated. UNIX is a trademark of Bell Laboratories. Copyright ©1983 by Sun Microsystems. This publication is protected by Federal Copyright Law, with all rights reserved. No part of this publication may be reproduced, stored in a retrieval system, translated, transcribed, or transmitted, in any form, or by any means manual, electric, electronic, electro-magnetic, mechanical, chemical, optical, or otherwise, without prior explicit written permission from Sun Microsystems. Revision History Revision Date Comments A 17th December 1982 First release of this User's Guide. s Table of Contents 1. INTRODUCTION ........................................................................................................................................................................................1 2. UNPACKING AND INSTALLING THE MOUSE..............................................................................1 3. USING THE MOUSE............................................................................................................................................................................1 3.1. Calibrating the Mouse ....................................................................................................................................................................1 4. INTERFACING THE MOUSE..............................................................................................................................................2 4.1. Physical Interface ....................................................................................................................................................................................2 4.2. Software Interface ..................................................................................................................................................................................2 5. OPTIONS ....................................................................................................................................................................................................................3 6. POSSIBLE PROBLEMS WHILE USING MOUSE ..........................................................................3 6.1. Mouse Self Test ........................................................................................................................................................................................3 1. INTRODUCTION The mouse supplied with the Sun Workstation is an optical mouse which transmits motion information to a computer by sensing movement on a grid of colored lines. Optical techniques result in greatly improved reliability. This document describes the physical means of interconnection of the mouse to the Sun Workstation, and describes the lowest level of software interfacing to the mouse hardware. Note: that version 7 UNIX system supplied with the Sun Workstation has no support for the mouse. Mouse support will only be provided with the 4.1x and 4.2 BSD system. 2. UNPACKING AND INSTALLING THE MOUSE The mouse and its accessories are packed in foam rubber in the shipping carton. The shipping carton contains three items relevant to the mouse: 1. This guide. 2. The mouse with its interface cable attached. 3. The mouse pad. Connecting the mouse to the Sun Workstation is a simple process. Simply plug the mouse into the connector labelled "MOUSE" on the back of the Workstation. Power is provided for the mouse through one of the wires in the connector cable. 3. USING THE MOUSE The mouse sends motion information to the computer when it moves around on the mouse pad supplied with the equipment. The mouse pad is ruled with colored lines in both directions. One set of lines is blue, and the other set of lines is red — so faint that you hardly see them. The mouse pad must be oriented so that the blue lines are vertical as you look at the pad . The mouse is placed on the pad so that the mouse's "nose" points along the blue lines. Moving the mouse in the direction of the blue lines moves the cursor up and down the screen, while moving the mouse across the blue lines moves the cursor from side to side. The mouse is fairly insensitive to being rotated out of the correct orientation to about 90 ° in either direction. 3.1. Calibrating the Mouse When power is first applied, the mouse must be "calibrated" — that is, the mouse has to "learn" the characteristics of the mouse pad on which it moves. To calibrate the mouse, move it around in a circle about four inches diameter, in a clockwise direction. After about five revolutions, the mouse will "learn" the characteristics of The orientation of the pad cin be cbinged — aee the section on Optioni. - 2 - the mouse pad, and will transmit information to the computer. If you spend more than about 30 seconds trying to calibrate the mouse and it doesn't seem to calibrate, it may mean there is a problem. Refer to the section below entitled Possible Problems while Using Mouse. 4. INTERFACING THE MOUSE 4.1. Physical Interface The mouse is connected to the Sun Workstation via a 15-pin D type subminiature connector. Pins 1 through 8 of the mouse connector are connected to the parallel input port bits 0 through 7 respectively. Plug the subminiature connector into the plug marked "MOUSE" on the back panel of the Sun Workstation. 4.2. Software Interface The mouse data is read from the Sun Workstation parallel input port. The SUN Processor Board parallel input port is 16 bits wide, by convention numbered from 0 (least significant) to 15 (most significant). The parallel input port is accessible to software by reading location EOOOOO (hexadecimal) as a (16-bit) word. Bit 0 (+5V supply) is not particularly interesting to the software. Eevery 7.5 milliseconds, the mouse sends three bytes across the interface to the parallel port. The assignments of the bits in those bytes are as follows: Byte Number Bit Byte 1 Byte 2 Byte 8 DO Always 1 Always 1 Always 1 D1 SI • • D2 S2 • • D3 S3 • • D4 0 Ax Ay D5 0 • • D6 0 • • D7 1 • • Bit zero (the least significant bit) of all three bytes should be ignored, since it is the bit where the 5V power supply line is on the interface. The first byte (byte 1) is the so-called sync byte. The sync byte is recognizable by having bits 7 through 4 always set to the pattern 1000. Bits 1, 2, and 3 reflect the up/down state of mouse buttons 1, 2, and 3, respectively. A one bit means that the corresponding mouse button is up, while a zero bit means that the corresponding mouse button is down. The second byte is the x delta, and the third byte is the y delta. Both the x and y values are respresented in two's complement form. - 3- 5. OPTIONS The mouse may be configured to work in various ways by changing the settings of a DIP switch inside the mouse. The switch settings are as follows: i Switch Mouse Options Option ON OFF 1 Baud Rate 1200 baud 300 baud 2 Protocol Non-rotatable Rotatable 3 Operating Mode Normal Self-test 4 Orientation of Blue Lines Horizontal Blue Lines Vertical Blue Lines 5 Transmit when not moving Yes Noiseless 6 Signal Level RS-232 TIL 6. POSSIBLE PROBLEMS WHILE USING MOUSE When the mouse is powered on, pressing any mouse button should light both of the LED's. If the LED's don't light up, it probably indicates that the mouse is not properly plugged into the Workstation. If you have spent more than about 30 seconds trying to calibrate the mouse and it doesn't seem to calibrate, it may mean there is a problem. If the mouse does not calibrate, the problem might be some obstruction of the optical path — cracked lens, mispositioned light shield, mirror slippage — a bad mouse pad, or a weak LED. Before attempting to open the mouse and set it into the self test mode, try swapping the mouse or the mouse pad with one that is known to be working, and then try again. If that still fails, it may be time to refer to the next section on how to get the mouse in self test mode, and interpret the error codes. 6.1. Mouse Self Test The mouse has a self test mode where it can automatically detect certain kinds of malfunctions or bad adjustments. To put the mouse in self test mode, you must open it up by removing the two screws from the bottom — you need a small philips screwdriver for this purpose. - 4- Be careful not to drop the lenses out of the mouse when you open it up. To place the mouse in self test mode, set keyswitch 3 on the DIP switch to the OFF position, as indicated in the section entitled OPTIONS. Do not replace the cover on the mouse while it is in self test mode. Now you must plug in the mouse again. There are two pairs of LED's. One LED out of each pair shines red when it is on; the other two LED's do not show visible light. The LED's are identified as DSl, DS2, DS3, and DS4. DSl is not actually identified on the PC board, but it is evident which one it is by elimination. DSl and DS3 are the LED's which light up red when turned on. Pressing all three mouse buttons at the same time cycles the mouse out of an error sequence. This has a similar effect to power cycling the mouse. The red LED's blink rapidly while all three buttons are pressed. Are the LED's flashing in a regular sequence? No --> Refer to Check Switches and LED's below. Yes --> The mouse has a way of indicating errors when it is in self test mode. It flashes one or two of the LED's one or more times, with about three seconds between the group of flashes. Each sequence of on-off flashes with a pause after the sequence is called an error code. There are ten possible error codes which the mouse can flash. Error codes 1 through 8 indicate problems which the user can fix. Error codes 9 and 10 indicate an internal failure in the mouse itself, which the user cannot fix. Mouse Error Codes Error Code Meaning Fix 1 thru 4 LED 1, 2, 3, or 4 Adjust the LED away from the hole, is too bright. c n LED 1, 2, 3, or 4 Adjust the LED closer to the hole. o tnru o • , is too dim. Check Switches and LED's What is the state of the LED's? Both LED's are ON-> Here are possible reasons for this state: • The mouse is not in self test mode at all — check keyswitch 3 on the DIP switch and make sure it is in the ON position. All the other switches should be OFF. - 5 - • One of the microswitches is broken, which makes both LED's light up. Both LED's are OFF--> Press any one of the microswitches. How many LED's light up? Two --> All is well — there is no problem. One --> Which LED is lit? LEDl —>LED1 lighting up means that not all of the integrators got reset on power up. Possible sources of error are chips Ul, U2, or U3. LED3 —> LED3 lighting up means that the light detector is not getting enough light. If increasing the light level doesn't turn off LED3, the possible sources of error are either the light detector itself, or chips Ul, U2, or U3. Zero — > Here are the possible reasons for both LED's staying off when one of the microswitches is pressed: • The mouse does not have any power applied. Make sure that it is plugged in to a source of power. • TTie microswitch you pressed is broken. Try-another switch.