VIRTUAL REALITY GLOVE SYSTEM WITH FABRIC CONDUCTORS

Abstract: A data input glove (1, 2) for use with a computer system (1001), virtual reality system or the like, with numerous electrodes (21-29) placed on the glove (1, 2) and interconnected with electronic controls (41, 43) enabling sensing of contact between any combination of the electrodes (21-29), with electrodes (21-29) made of flexible electrically conductive fabric, silk-screened electrically conductive paint or the like.

Description: Virtual Reality Glove System with Fabric Conductors Field of the Invention This invention relates to devices for translating body movements into electrical or electronic signals, and to data glove input devices. Background of the Invention Computer systems now use a variety of input devices, including keyboards, mice, graphics tablets, light pens, touch sensitive screens. Recently, computer systems used in virtual reality systems and other complex systems ( such as remote control robotics and weapons systems) have adopted additional input devices, including head-mounted sensors, infrared eye-lens sensors, and data gloves. These devices sense movement of the body through a variety of sensors, and send signals to the computer system to indicate the position of the body. Data gloves have been proposed for use as input devices for computer systems. For example, the data glove developed by VPL Research, Inc., and illustrated in, Interfaces for Advanced Computing, Scientific American (Oct. 1987) (And also the subject Zimmerman, Computer Data Entry and Manipulation Apparatus and Method, U.S. Patent 4,988,981 {Jan. 29, 1991)) used fiber-optic flexion sensors to determine how much each finger on the glove is bent. The glove also used an ultrasonic position sensor and a mercury switch orientation sensor mounted on the back-hand surface of the glove to determine the location of the glove and send this information to the computer used with the glove. Grimes, Digital Data Entry Glove Interface De\ e, U.S. Patent 4,414,537 (Nov. 8, 1983) proposed a data glove designed to replace a computer keyboard. This glove used flex sensors and electrical contacts on the fingertips to determine static positions representing the characters of the alphabet. Kramer, Force Feedback and textures Simulating Interface Device, U.S. Patent 5,184,319 (Feb. 2, 1993) shows a data glove using strain gauges attached to the fingers of the to sense the bend of fingers, and to transmit this information to a computer. Robinson, Video Control Gloves, U.S. Patent 4,613,139 (Sep. 23, 1986) proposes use of a glove with contacts on the fingertips to be used as an input device for a video game . The data gloves can be used in virtual reality environments or "worlds" with varying degrees of complexity. The are potentially useful for selection of virtual object in a virtual environment. By correlating the position of the hand and the shape of the hand as sensed by the sensors on the glove to the position, shape and assigned function of a virtual object within the virtual environment, the host computer can interpret hand positions as instructions to manipulate the objects. More simply, by sensing the shape of the hand, the host computer can interpret the input as commands to the host system. For example, the Zimmerman device was designed to correlate contact between the thumb and other fingers to letters of the alphabet, and gestures are interpreted as commands to enter letters into a computer word processing file. In the Robinson device, contact between the thumb and the fingers were to be interpreted by the host computer as instructions in a video game program. In flex sensing gloves, the glove can sense whether the glove is bent or not, but cannot accurately sense the degree of bend. In general, glove flexion of the fingers has not been used for rate control because the sensing is too difficult and the feedback to the user is not sufficiently accurate for efficient control. Virtual environment parameters such as the speed of flying have not generally been tied to the degree of the bend of a finger, and the firmness of grasp is not tied to how tightly a fist is made. The electronics required for use of the touch sensing gloves is relatively straightforward when compared with the electronics required for measurement and calibration of a number of strain gauges attached to the back of the hand or measuring the angles in an mechanical or fiberoptic exoskeleton attached to the hand. One shortcoming of flexion gloves is the absence of easily understood feedback to the operator of the glove. The degree of bend, in systems that are sensitive enough to use that information, may be misinterpreted by the system, or the system may be or become miscalibrated, so that the bend interpreted by the computer is significantly different than the actual bend accomplished by the operator. Deviation between the actual bend and the interpretation by the computer can be difficult to detect. Contact gloves overcome this shortcoming, in that they provide positive feedback to the operator because the operator can feel the contact between the thumb and fingers. After operating the system for a while, the operator will expect the host computer to react in known ways to the contact which the operator can feel. Any deviation should be easy to perceive. The disadvantage of prior art contact gloves, however, is that they cannot interpret multiple simultaneous gestures, or gestures that involve fingers other than a chosen signal finger (usually the thumb) , and they do not account for cross hand contact. Summary of the Invention The data gloves described below use flexible conductive electrical contacts on the fingertips, the back of the fingers, the palms and other surfaces of the hand. The contacts are electrically connected to the host computer system via an electronic control box which energizes each finger in turn while monitoring all other contacts for electrical signal that indicates contact between the energized finger and the other fingers and contacts. The electrical contacts are isolated from the system through surge suppresser diodes to protect the system from static discharge. A multiplexor chip on the glove itself limits the number of electrical connections that must be provided to energize the glove and send signals back to the control box or host computer. Many of the actions that users wish to perform with gloves such as flying m a particular direction, picking up an object, selecting an item on a menu, or some other type of "choosing" task, can be represented by the contact between two or more digits. The gloves and control system enable the operator to provide input to a computer system with any combination of contacts between the numerous electrodes on the glove. The gloves and control system allow the operator to interact with a computer program, to interact with a virtual world, and to manipluate objects m a virtual environment. The gloves also enable an operator to manipulate remote systems through computer interfaces. The gloves may also be used merely to monitor the movements of the wearer. It will be appreciated from the description of the data input gloves and control system that they may be used in many environments and made in many embodiments. In fact, the glove is but one embodiment, and the inventive concepts, methods and devices described below may be employed on any article of clothing, any part of the body, or upon any machine or object in order to detect motion and interaction of the thing. For example, the inventions could be embodied in a pair of sleeves worn by robotic arms, and the data derived therefrom can be used as feedback to ensure that the robotic arms are (or are not) coming into contact with themselves, other parts or the robot, parts of its environment, as intended by the robotic control system. Brief Description of The Drawings Figure 1 shows a pair of data gloves with flexible conductive fabric electrodes. Figure 2 is a schematic of the wiring of the data gloves. Figures 3 and 4 illustrate the continuous strobing operation of the glove system. Figure 5 is a schematic of the glove control electronics. Figure 6 is a schematic diagram of the glove system. Detailed Description of the Invention 1. Glove Construction Figure 1 shows a pair of gloves, the right hand glove 1 and the left hand glove 2. The gloves, including electrical touch sensing contacts, are made of fabric, including several different fabrics chosen for functionality. The back of the right glove 17, shown on the right hand glove 1, is made of lycra, and may be made in several pattern sections sewn together to form the entire back hand side of the glove. The palm of the glove 20, visible on the left glove, is made of siree, a fabric which is preferred for it comfort and ruggedness . Electrical connections on the back of the glove are protected by cloth cover 39, which is preferably made of Velcro® so that a tracker may be releasably mounted on the back of the hand. The tip of each finger is provided with protective covers 40, preferably of ultrasuede. Visible in Figure 1 are the electrodes for the right hand fingers, thumb electrode 21 on the radial surface of the right thumb 3, index finger electrode 23 on index finger 5, middle finger electrode 25 on middle finger 7, ring finger electrode 27 on ring finger 9, and pinkie finger electrode 29 on the pinkie 11. Visible on the left hand shown in Figure 1 are the fingertip portion of the electrodes, including the thumb electrode 22 on the radial surface of the left thumb 4 and also on the tip of the left thumb, the index finger electrode 24 on the left forefinger 6, and so on. On the palm of the left hand, heel electrode 32 is seen on the heel 20 of the left palm, and distal crease electrode 34 is seen on the palm near the distal crease 16. The electrical contacts on each finger are made of metallic fabrics which provide strength, stretchability, and a high- degree of ruggedness. The metalized fabric conductors run along the backs of the fingers, looping over the tops of the fingers and covering the pad of the fingertips to form the fingertip electrodes. The fabric electrode pads on the fingertips are sewn around the edges and, in some cases, a strip of material around the edges helps prevent the conductive fabric from lifting up or peeling away from the base fabric in the corners. A number of different metallic fabrics may be used for the conductive fabrics. Metallic fabrics that are created through electroless copper deposition, and also stainless steel, mesh- type fabrics work well . The stainless steel mesh-type fabric is preferred for its ruggedness. The conductive fabric has the feel of a medium weight fabric, and the strips may be sewn onto the glove using standard applique techniques, or they may be applied with adhesives or any other suitable method of glove fabrication. Suitable wire mesh and other materials are commercially available from McMaster-Carr in Los Angeles, CA, Howard Wire Cloth Co. Of Hayward, CA and various other manufacturers . The conductive paths may also be created with a silk screen process or other deposition process such as electrochemical deposition. Silk screening was accomplished with a commercial silk screening assembly and metallized and conductive silver based paint which is commercially available from Mavidon Corporation (product number K652) . The conductive path down the back of the finger stretches with the lycra to accommodate different hand sizes. The conductive fabric goes along the outside of the glove across the fingertip and thus cannot be bent, fully creased, as it were, across the fingertip as the glove is removed because it passes over the seam of the lycra and siree material for the palm underneath. This prevents the metallic fabric from being broken at the fingertips due to excessive fatigue cycles caused by repeated removal of the gloves by the customary pinching of the fingertips . In an alternative embodiment, the back hand panel of the gloves may be constructed with a double layer of lycra, with the additional layer being placed under the operative layer. In this embodiment, the metallic strips are attached to the outer lycra layer and the lycra layers are then sewn together at the edges . This construction ensures that holes sewn that penetrate the stainless steel fabric and the lycra base, and potentially stray threads or fibers from the conductive fabric that may be pushed through the lycra during sewing cannot come into direct contact with the skin. The conductors which run down the back of the hand to the dorsal area 41 where contact with the electronic control box is accomplished. In its simplest form, conductive fabric strips are potted to corresponding wires in cable 42 which then connects to the electronics box through connectors 43 on the right glove and 44 on the left glove. Alternately, the wires and conductive fabric strips may be crimped together, or soldered onto a PC board to complete the circuit. The dorsal area of the glove is potted with an adhesive so that that area of the glove does not stretch so that the contacts cannot be broken. This potting also serves to provide a rigid, flat area above which Velcro® patch 39 may be placed. The tracker mount is removable Velcro and, by virtue of a number of different hole patterns, is compatible with a number of different trackers. This feature is especially important because the hole pattern for trackers is not standardized at the present time and compatibility between different trackers is important to many users. Tracker of various construction are available, for example electromagnetic trackers are available from Polhemus Corp. Ultrasound trackers and systems are also available. Figure 6 shows the glove system, including gloves 1 and 2, electronic control box 1001, and the host computer system 1008. The gloves connect to the electronics at connectors 1002 and 1005. The condition of each glove is indicated by indicators 1010 and 1011. The glove electronics can be turned on and off by switch 1006 and are powered by input 1007. The glove electronics communicate with the host computer 1008 through serial interface 1009. Configuration information associated with the glove, and useful to the electronic control box and host computer is stored within the glove or its associated connector. This information is stored in serial EEPROM's 45 and 46 in the connector 43 and 44 of the glove, as shown in Figure 2 Computer connectors such as male or female DB9 connectors may be used to connect the gloves to the electronic control box. (In gloves which have a connector at the wrist, the serial EEPROM is located on the hand, under the Velcro® pad 39, rather than in the connector which connects to the glove electronics box) . This configuration information contains information regarding the size of the glove, its serial number, and other data associated with it such as the number of contacts which have been performed with the glove. Multiplexing chips 47 and 48 may be used before the connectors, and would serve to multiplex the power and sensing operations of the system to the various contacts of the hands. This would permit a connector with a minimum number of wires, and facilitate wireless communication the electronics box or host system. Multiplexing will become increasingly important as the number of sensing contacts on the gloves are increased. Contact gloves require very little power for operation. They may be powered through the serial port or by batteries carried in the glove itself. Thus, the glove could derive power either from the serial port itself or from battery power. Gloves powered with glove mounted batteries can be advantageously combined with wireless tracking systems to allow for free movement within the virtual environment, unconstrained by wires attaching the gloves to the electronic control box or the host computer. The connector at the wrist may be combined with the tracker-mounting hardware, thus allowing use an interchangeable glove or a disposable glove which one could put on and then when one attached the tracker-mount, the contacts for getting the gesture information back to the host computer would also be made at that time. 2. Sensing Operation The data gloves are capable of sensing contact between any combination of sensors. By continuous and high speed switching of power and sensing between the various contacts, the system can determine any combination of contacts between all the contacts on the glove, regardless of the number of contacts. The system energizes each contact in turn, and surveys all other contacts for energization through the energized contact, thus determining which, if any, fingers are in contact with the energized electrode. After energizing one electrode and surveying all others, the system switches to the next electrode, energizes that electrode, and surveys all other electrodes for energization through the energized electrode. Continuing in this manner, all electrodes are energized in turn while system surveys the other electrodes. This operation is referred to as sequential polling or sequential strobing, and the term "poll" or "query" shall be used to refer to the operation of checking an electrode (i.e., measuring the electrical potential of the electrode) to determine if it is energized. The operation of applying an electrical potential to an electrode shall be referred to as energizing the electrode or "strobing." Referring to Figure 3, the sequential polling operation is described in relationship to the glove. Starting, for example, with the right thumb, the right thumb electrode is energized with a small voltage at time Tl . All other electrodes are polled to determine if the electrical potential at the electrode matches the potential applied to the thumb electrode. In Figure 3, no fingers are touching, so no electrode will show an electrical signal indicating contact with the thumb. At time T2, the system switches to the forefinger and energizes the electrode on the forefinger while polling all the other electrodes. Again, since no fingers are touching, the no electrode will show an electrical signal indicating contact with the forefinger. The system continues to poll each electrode in turn, an drapidly determines which, if any, electrodes are in contact with the strobed electrode. In Figure 3, there are shown ten finger electrodes, so at time T10, all the electrodes have been polled. The polling sequence occurs so rapidly that all contacts will be polled in a split second, and the sequence repeats continuously, so that any movement will be detected. Figure 4 illustrates what happens in the system when the operator makes a gesture with the hand causing contact between any two electrodes. In Figure 4, the operator has chosen to touch the thumb to the middle finger. At time Tl, the system will energize the thumb electrode with voltage V : and poll all the other electrodes. All the electrodes will show zero voltage, except the middle finger electrode, which will show a voltage of V out , which will be approximatley the same as V.. At this point, the system knows that the thumb of the right hand is touching the middle finger of the right hand. At time T2, the system will energize the electrode of the index finger, and poll all other fingers. The index finger is not in contact with any other electrode, so no other electrode will be at voltage v., and the system now knows that the index finger is not in contact with any other finger. Next the middle finger is energized, and all other electrodes are polled, and the system will sense electrical voltage at the thumb electrode, but no voltage will be sensed at any other electrode. The system will continue this sequential polling operation for all other fingers and electrodes, and when done will repeat the entire sequence The gloves perform a multiplexing function across fingers and hands. Thus, gestures are not limited to single digits touching a particular digit. For example, valid gestures include: touching between the index finger and thumb; touches between any combination of fingers; touching the index fingers, thumbs, middle fingers, ring fingers, and pinkies of right and left hands together (this gesture includes five separate independent contacts and is reported to the host computer in a single record) ; touching the index and middle finger of one hand to the back of the index finger on the other hand; touching the thumb of the left hand to the thumb of the right hand. The other gesture which is maximal is to touch all fingers of both hands together at one time. This can be done by kind of scrunching up the fingers as if trying to get the hand through a small bracelet and then touching the two hands together while doing this.. This gesture has all fingers touching each other and is reported to the host computer as a single record. Figure 5 illustrates the circuitry in the interface electronics box. The power supply for the unit is shown as block 601, which is composed of a bridge diode and voltage regulator to provide clean 5-volt power for the system. Block 603 is the interface from the processor to the host computer and implements the RS 232 level shifting. Block 604 is the microcontroller which contains the firmware for communicating the state of the gloves back through RS232 interface 603 to the host computer. Block 605 is a set of DIP switches which are used to control specific features such as BAUD rate and minimum time between contacts. The controller, 604, controls the condition indicators 606 and 607. The interface between 604 and the gloves is implemented by the resistors 610 and connectors 608 and 609. The diodes, 611 and similar, provide the static protection which is necessary as there are exposed contacts on the glove. 2 . Self Calibration The touch sensing capability of the data gloves described above may be combined with a flex-sensing glove to create an auto-calibrating glove. For example, the flex-sensing glove is calibrated by making a fist and correlating the flex sensing glove output to the fist gesture. This is typically accomplished at system startup, and at intervals during use, but the calibrating operation must interrupt normal use of the glove. When combined with the touch sensing glove, the combination would allow self-calibration during use. Whenever a fist is made by the operator, the touch sensing gloves would report this to the host computer. The host computer would also have input from the flex sensors which must necessarily correspond to a closed fist. Thus, whenever the fist gesture is made, the computer system will store the data from the flex sensors in memory as the standard flex signals for the fist gesture. Thus this calibration may be entered. Also, when the hand are laid flat against each other, as in a prayer gesture, the fingers tips each touch the corresponding fingertips on the other hand, the heel contacts touch, and the distal crease contacts touch, and this necessarily corresponds to hands in the flat position. The host computer would have input from the flex sensors which must necessarily correspond to a flat hand gesture. Thus, whenever the flat hand gesture is made, the computer system will store the data from the flex sensors in memory as the standard flex signals for the flat hand gesture. This calibration may also be entered. Subsequent interpretations of intermediate gestures, such as a cupped had gesture, will be determined by the computer as a cupped hand based upon an interpolation between the flat hand and fist gestures. As the user continues using the glove, the glove may slip or stretch so that the computer system no longer accurately determines the actual flex of the hand based upon the old calibration, however, during operation, the user will return to those gestures in the natural course of operation, and the computer system will take advantage of each incidence of these gestures to recalibrate the flex sensing interpolations. Tracker calibration can be accomplished in a similar manner. For example, if the two hands come into contact, that event will be reported if the gloves include a touch-type glove. When the touch occurs, it will be possible for the glove interface computer to calculate where the touch is occurring and to calibrate either the hand-trackers on the back of the hand, or elsewhere, relative to the flexion in the hand and the contact that is known to be occurring. The flat hand prayer gesture will provide information as to the relative locations between the trackers, and their relative orientations (in the prayer gesture, both trackers must be oriented along the same plane, and the system may use this information and the information obtained from the trackers themselves to recalibrate the trackers. To facilitate self calibration, the operation of the system may include required calibration gestures, or it may merely opportunistically use spontaneous gestures to calibrate the system. For example, the flat hand prayer gesture (or any other gesture) may be used as a control signal, such as to start operation or reset the system, so that the calibration gesture is guaranteed to occur during normal operation. 3. Safety features Several safety features are included in the design of the glove. The current available to each electrode is limited by power supplies with low current capabilities. Static protection circuitry including transient suppression diodes 49 are provided on the connection to the individual contacts. As these gloves have exposed contacts on the fingertips and on the back of the hand, it is reasonable to expect that there will be static events which will occur in a normal operating environment. As the gloves have the capability to report multiple contacts as a single event, it is also important to be able to have the threshold time between the contacts to be larger than zero and ideally programmable or selectable. Detection of gestures such as pinching both the right and left hand index and thumb fingers together is enabled. For example, in order to manipulate a virtual object placed in front of the operator in the virtual environment and wish to stretch it in a particular direction, the operator can reach out and place one hand at one end of the object, place another hand at the other end of the object (position of the hands being determined in the virtual environment through the trackers) , close the index and thumb finger on both hands, and then move the two hands apart. This is accomplished by having the software in the microcontroller in the glove electronics box look at the time between two events and to combine them if the time between the events is less than some programmable threshold. This provides the flexibility to have the multiple contact gestures dealt with at the microcontroller in the electronics box rather than on the host computer so that the interface is relatively straightforward on the host computer. 4. Software and Data Control The contacts are measured in the following way: the microcontroller in the glove unit strobes through each digit making it an output while making all the other digits inputs and it then looks for those coming in while the digit is turned on. For instance, in a fraction of a second, each finger will be strobed to a high logic state while the other fingers are in the input configuration. As each finger is strobed, the microcontroller can determine which other digits are being touched at the same time. In this way, all possible combinations of touches may be recorded. They are recorded in a format which encodes contacts of the left and right hands in a pair of bites of which there can be several pairs to indicate the independent touches . In the case of two index fingers touching and the two thumbs touching that would be a total of two bites for the touch between the index fingers and two bites for the touch between the thumbs . The computer can determine that there are two independent touches occurring between those two pairs of digits. If one were to touch all four of those digits together at once, you would get back a single pair of bites with ones marked in the appropriate locations to reflect the fact that those touches were occurring. In addition to contact information, time is also important. For example, most computer users are accustomed to the "double- clicking" function of a mouse. The data gloves described above may also be double clicked. In order to accomplish this in the smoothest fashion, the glove also reports the amount of time elapsed between the current gesture and the previous gesture transition. A gesture transition occurs either when a gesture is made or a gesture is released. For example, the operator accomplished a gesture by touching the index finger to the thumb. When the operator releases the two fingers, this also constitutes a gesture, and the time elapsed between making the gesture and releasing it is tracked and recorded by the microcontroller in the glove or by electronics in the control box. The gesture may be reported to the host computer as a double click, without having the host computer recording the time interval between the arrival of the two data packets and determine the double click. This is important because in a number of systems, particularly UNIX work stations, the time of arrival of a particular serial packet is rather difficult to determine accurately. When using things like gloves, the time periods can be quite small for rapid interaction. Thus calculation and timing within the glove system, rather than relying upon the host computer, will enhance compatibility with a wide variety of computer operating systems. There are two kinds of data transmitted by the glove system: the contact information coming back from the glove, and status or control information. Control information includes any desired information about the gloves, such as the hand, the size the number an location of contacts, and any other information that the system can use to assist in interpretation of signals from the gloves. Contact information includes the information as to when contact is made between two (or more) fingers, and this is the data is sent to the host computer. When contact is made between fingers or electrical contacts, data reporting the contact is sent to the host computer system. All data packets are constructed as follows: STARTBYTE [VARIABLE NUMBER OF DATA BYTES] ENDBYTE The STARTBYTE varies depending on the type of record being sent: STARTBYTE (in HEX) 0x80 Start of a message - hand data only 0x81 Start of a message - hand data & Time stamp data 0x82 Start of a message - text or configuration information There is only one type of ENDBYTE ENDBYTE(in HEX) 0x8F End of a message DATA Bytes are always 7 bits. The upper bit of control bytes is a 1 and on data bytes it is 0. Packets with touch data are sent following a contact between fingers. They are sent to the host automatically and without hand shaking. Each data record is of one of the following two types: records with a time stamp (the default) start with 0x81 and records without time stamps start with 0x80. The following abbreviations are used: S = Start Byte (0x80 or 0x81 depending on packet type) L = Data byte for Left hand Bit 7=0 6=0 5=0 4=L. Thumb 3=L. Index 2=L. Middle 1=L. Ring 0=L. Pinkie R = data byte for Right hand Bit 7=0 6=0 5=0 4=R. Thumb 3=R. Index 2=R. Middle 1=R. Ring 0=R. Pinkie Tl = High 7 bits of time stamp, Bit 7=0 6..0=data saturates at 0x7F TO = Low 7 bits of time stamp, Bit 7=0 6..0=data saturates at 0x7F E = End byte (0x8F) The packet formats are as follows: With time stamp S [LR] ... [LR] TO Tl E Without time stamp S [LR] ... [LR] E In both cases the [LR] ... [LR] part of the record indicates one, or more, touches. There may be no [LR] entries in which case there is no touching going on. In other cases one might have several independent touches going on. Example Data Packets with no time stamps: 0x80 0x10 0x10 0x8F Right thumb touching left thumb 0x80 0x8F no contacts 0x80 0x00 0x18 0x8F Right thumb touching right index finger 0x80 0x08 0x10 0x8F Right thumb touching left index finger 0x80 0x00 0x18 0x18 0x00 0x8F Right thumb touching right index and independently left thumb touching left index 0x80 0x10 0x10 0x08 0x08 0x04 0x04 0x02 0x02 0x01 0x01 0x8F This last data packet is the longest packet for a system with fingertip electrodes only and represents the "a spider on a mirror doing pushups" gesture where each digit on the left hand touches only the corresponding digit on the right hand. Where the glove is provided with heels electrodes, distal crease electrodes, and other electrodes, the data packets may be correspondingly longer. Same packets as above with t me stamps (1 tick = 833us) : 0x81 0x10 0x10 0x7F 0x7F 0x8F Time stamp shows > 16382 ticks elapsed since the last gesture 0x81 0x45 0x67 0x8F Time stamp = (0x67«7) | 0x45 = 13253 ticks 0x81 0x00 0x18 0x00 0x10 0x8F Time stamp = (0xl0«7) | 0x00 = 2048 ticks 0x81 0x08 0x10 0x20 0x00 0x8F Time stamp = (0x00«7) I 0x20 = 32 ticks 0x81 0x00 0x18 0x18 0x00 0x18 0x18 0x8F Time stamp = (0xl8«7) I 0x18 = 3096 ticks 0x80 0x10 0x10 0x08 0x08 0x04 0x04 0x02 0x02 0x01 0x01 0x7F 0x7F 0x8F In this longest packet, time stamp indicates the previous gesture was a "long time ago" or > 16382 ticks. Note that time stamps tell you the elapsed time since the last gesture sent, m ticks. When the count reaches 0x7F 0x7F this saturates and does not roll over. There are also a number of informational or control type commands which can be communicated to the host system . All commands are 2 bytes sent from the host to the glove. The system then responds some time later (within approximately 20 msec) with a packet of data. Un-recognized commands generate a reply with a body of ?. Note that as commands are 2 bytes, sending a single character will cause the system to wait and accept the first byte of any subsequent command as the completion of the present command. The system will send a ? packet if the command is not a valid one. While the system is sending data back m response to a command, contact events may occur. In this case the packet being sent is completed and then the contact data is sent as a new packet . Replying to a command request may take some time. Reading strings and sending them back to the host is an atomic operation and will not be interrupted once the 2 byte command has been received. Syntax: T [1 or 0] - Time stamp the data ON / OFF V [0..255] - Compatibility with previous versions CR - Right hand ASCII configuration record CL - Left hand ASCII configuration record CP - Processor ASCII configuration record CT - Tick time definition Host sends Glove replies 0x54 0x31 (Tl) 0x82 0x31 0x8F Note that 0x31 is ASCII for "1" and time stamps are turned on. 0x54 0x30 (TO) 0x82 0x30 0x8F Note that 0x30 is ASCII for "0" and time stamps are turned off. 0x56 0x31 (VI) 0x82 0x31 0x8F To support different backwardly compatible interfaces, this command sets the version of the data format to be sent by the system to the host . 0x43 0x4C (CL) 0x82 L MED GL-9999 VI.2X 999111 0x8F The glove is Left hand, MED sized, part number GL-9999, version 1.2X, serial number 999111. 0x43 0x52 (CR) 0x82 R MED GL-6001 VI .0A 566701 0x8F The glove is Right hand, MED sized, part number GL-6001, version 1.0A, serial number 566701. 0x43 0x50 (CP) 0x82 0x8F VX.XX The processor code is version X.X, informs system what software is required to use the glove presently connected 0x43 0x54 (CT) 0x82 833.3 us 0x8F Each tick is 833.3 us in length so a time stamp of 1200 ticks is really an actual elapsed time of 1200*833.3us = 1.0 seconds. This is the command to use if you want to convert the tick based time stamps to seconds. Since the value of the scaling constant may change in future versions, this command should be used to get the scale value for conversion from ticks to seconds. The software for controlling the flow of data to and from the gloves is set forth in detail in Appendix A. While the preferred embodiments of the devices and methods have been described, they are merely illustrative of the principles of the invention. While the preferred embodiments have been described m the environment of a glove used ma virtual reality environment, it should be apparent from the discussion above that the application of a plurality of sensors to a moving mechanism, and the operation of sequential strobing, may be employed to many machines other than the human hand, and with many devices other than gloves . In the context of the human hand, the glove serves merely as a convenient mounting surface for the electrodes, and in other contexts other mounting surfaces, or non at all, may be employed. Other embodiments and configurations may be devised without departing from the spirit of the inventions and the scope of the appended claims. It is specifically contemplated that numerous embodiments with additional numbers and placements of electrical contacts be constructed, and also that other analogous applications of the inventions, such as the application of touch sensing contacts to any other object in a virtual environment or remote space, are enabled by the description set forth above and covered by the claims presented below. SYSTEM.ASM - Fakespace Pinch Glove System ORG SD00O ;12K Bytes EPROM VERSION EQU FCC • V3.0B PINCH by Fakespace Inc. 1995 (C) All Rights ReservedX ' TICKSTREQU FCC '833.3 usV NOG OVEEQU FCC 'NO CLOVEN' MTOUCH EQU 10 touch count to inc the EEPROM STOUCH EQU 5 touch count to subtract initally * Packet Structure: * * Packets are variable in length (2 to 12 bytes) * Sent on change in state * Packet format: * START [RDATA LDATA] [TIME DELTA] END Start Byte (0x80) Hand data only Start Byte (0x81) Hand data and time delta info Start Byte (0x82) Info / ACK packet start (text) End Byte (OxβF) Any data packet Error Byte (OxFF) Does not need an end byte discard record Data bytes for contact 16 bits of data: Byte (hand) 7 6 5 4 3 2 1 0 X+l Left 0 0 0 Thumb Index Middle Ring Pinkie A3 C3 C2 Cl CO Byte (hand) 7 6 5 4 3 2 1 0 X+2 Right 0 0 0 Thumb Index Middle Ring Pinkie A7 C7 C6 C5 C4 Time data - time since last record sent in TICKS (will be 7F 7F on overflow) Time Delta 7 6 5 4 3 2 1 0 0 T13 T12 Til T10 T09 T08 T07 0 T06 T05 T04 T03 T01 T01 TOO Read the DIP SWITCHES for the baud rate * SW1 is for long threshold if UP (ON) * SW3 is to DISABLE detection / counts if UP (ON) * Equates * Glove RAM memory locations OLDC EQU $00 1 byte old value of PORTC NEWC EQU $01 1 byte new value of PORTC BITMASK EQU $02 1 byte mask used when reading portc byte temporary εtorage byte of bits used when reading portc byte - rthumb -> fingers byte - 1 humb -> fingers byte - thumb - thumb Bytes of timer overflow byte for EEPROM status Bit 0=1R/0W Bit 1=0L/1R bytes, serial receive len, data, data byte of status - see below for bit definitions NEW EQU $10 11 bytes = 1 for record len then 10 data LAST EQU $20 11 bytes = 1 for record len then 10 data OLD EQU $30 11 bytes = 1 for record len then 10 data NEWTS EQU $40 4 bytes Time stamp LASTTS EQU $44 4 bytes time stamp OLDTS EQU $48 4 bytes time stamp THRESH EQU $4C 4 bytes t me stamp R_32 EQU $50 4 bytes t me stamp RTICNT EQU $54 2 bytes - real time timer counter NTOUCHL EQU $56 1 byte left touches NTOUCHR EQU $57 1 byte right touches LEEACT EQU $58 2 bytes left saved LEEVALID EQU S5A 1 bytes left valid 0=A, •0=B LEETHR1 EQU $5B 2 bytes left yellow LEETHR2 EQU $5D 2 bytes left red REEACT EQU $5F 2 bytes right saved REEVALID EQU $61 1 bytes right valid 0=A, >0=B REETHR1 EQU $62 2 bytes right yellow REETHR2 EQU $64 2 bytes right red VMASK EQU $70 1 byte of mask for fingers ZEROTO EQU $lff the location up to which to set to 0 on startup defines for special words n communications protocol Start of a message - hand data only Start of a message - hand data f. Time stamps Start of a message - text or ACR End of a message Error - restarts after an error The bit used for thumbs above The max. number of finger data words in a packet * defines for EEPROM interface EERW EQU $01 Bit 0=> 0=Read l=Wrιte (EESTAT) EELR EQU $02 BIT 1=> 0=Left l=Rιght (EESTAT) EEWLEFTEQU $04 Bit 2-> if set then write in process on left (EESTAT) EEWRIGHT EQU $08 Bit 3=> if set then write in process on right (EESTAT) REEWR EQU $10 l=>Rιght glove write in process in RTI LEEWR EQU $20 l=>Left glove write in process in RTI EEWRCT EQU $A0 Write header byte EERDCT EQU $A1 Read header byte CONFIG_START EQU 0 Start of config in eeprom of gloves * Address locations in the glove EEPROM CONFIGJLEN EQU 27 Length of config string for gloves (27 decimal) EECNT_ACTA EQU $30 start of counter 2 bytes (save 2 lines) EECNT_ACTB EQU $40 start of counter 2 bytes (save 2 lines) EECNT_VALID EQU $50 Which count is valid (save 2 lines) EECNT_THR1 EQU $60 LED goes yellow EECNT_THR2 EQU $70 LED goes red * defines for overall STATUS byte GTSTAMP EQU $01 l=>Time stamps ON, 0=>Time Stamps OFF LVALID EQU $02 l=>Left glove OK, 0=>Not OK RVALID EQU $04 l=>Rιght glove OK, 0=>Not OK LEXPIRE EQU $08 l=>Left glove OK, 0=>Not OK (expired) REXPIRE EQU $10 l=>Rιght glove OK, 0=>Not OK (expired) RNEEDWREQU $20 l=>Rιght glove need a write in RTI LNEEDWRBQU $40 l=>Left glove need a write n RTI NOCNTS EQU $80 l=>No counting disable thing Misc * PORTD defines - EEPROM EEDATA EQU $10 Port D Bit 4 * PORTC defines - bidirectional fingers (4 per hand) RIGHTF EQU $F0 Right hand is high four bits LEFTF EQU $0F Left hand is low four bits * Bufalo memory locations USTACK EQU $1FF Top of user stack area (0100-Olff) Buffalo 3.2 * I/O and register locations . ** • * « ********** * **** * * * ********* * ** **** **** * *** GLOVE - Glove interface logic GLOVE EQU * LDS #USTACK Init stack ptr LDAA #$93 Initialize processor options LDAA #$00 Initialize processor options (no A/D conv ) STAA OPTION Mam timer divisor is low two bits of TMSK2 Assuming 9.8304Mhz xtal PR01 scale One tick Overflow (βbit) Overflow (16bit) 0 1 406.9ns 104.17US 26.67mε 1 4 1.6276us 416.67uε 106.67ms 2 8 3.2552US 833.33us 213.33ms «= Curent 3 16 6.5104us 1.6667ms 426.67ms LDAA #$C2 Timer OV, RTII, PR1=1 PR0=0 (timer prescale div 8) STAA TMSK2 save in timer 2 (overlow -100msec) SEI Disable interrupts init sci LDAA #$30 Initialize SCI for 9600 bps 8MHz LDAA #$22 Initialize SCI for 9600 bps 9.8304MHz LDAA #$02 Initialize SCI for 38400 bps 9.8304MHz Read the DIP SWITCHES for the baud rate BAUD RATE SW6 SW7 SW8 153 6K 0 0 0 76.8K 1 0 0 38. K 0 1 0 19 2K 1 1 0 9.6K 0 0 1 4.8K 1 0 1 2.4K 0 1 1 1.2K 1 1 1 LDAA PORTE Load A with PORTE data LSRA Low bit is SW2 LSRA Low bit is SW3 LSRA Low bit is SW4 LSRA Low bit is SW5 LSRA Low bit is SW6 STAA BAUD CLR SCCR1 LDAA #$0C Initialize sending/receiving (polled) LDAA #$2C Init send/receive and enable RCV nt'ε STAA SCCR2 RTI reg values ECLK = XTLAL/4 RTI time (ms) at 9.8304MHz 0 = /2 Λ 13 1 = 3.33ms 1 = /2 Λ 14 2 = 6.66mε 2 = /2 Λ 15 4 = 13.33ms «= Current value 3 = /2 Λ 16 8 = 26.66ms LDAA #$2 Div XTAL by 4 then 2*13 then by 4 for RTI STAA PACTL save * Clear the byte counts on the records LDX tZEROTO How far to set to zero LOOPZ CLR $0,X Save 0 to this location DEX Decrement BNE LOOPZ * EEPROM port initializations * Port D EΞDATA starts out as an input so pull down needed in HW * Port B LEECLK and REECLK are outputs and power up LOW * To power up raise the clock line (STOP condition to EEPROM) and raise data hi LDX #$1000 register base address (beet etc have to be ind addr) BCLR PORTB.X #LEECLK+REECLK low clock lines BSET DDRD.X tEEDATA port D is output BCLR PORTD, tEEDATA data is LOW Initialize the time thresh hold for contacts LDD #$0 STD THRESH Upper word is 0 LDAA PORTE Read DIP SWITCHES ANDA #$01 SW1 BNE LONGTHRLong threshold LDD #$1F00 THIS IS ARBITRARY AT THIS POINT - SHORT THRESHOLD * () () 0 () <) () () () () BRA THROK LONGTHREQU * LDD #$6400 THIS IS ARBITRARY AT THIS POINT - LONG THRESHOLD * I I I I O I I I I O I K I I ! THROK EQU * Note that the lower byte should be 0 Note 3400 would mean that t me stamps would never be less than 0035 this is 'cause the threshold is really 00 00 34 00 and it's the middle 2 bytes which are used for the time stamp and the low and hi bytes are lost Note that one tick de 0100 above) is about 833.33uε STD THRESH+2 Lower word * Initialize the overall STATUS word CLR STATUS Set all bits to 0 so no options enabled BSET STATUS #GTSTAMP Set the GTSTAMP bit in the global STATUS byte BSET STATUS #REXPIRE BSET STATUS #LEXPIRE * Initialize left and right contact counts to be close to Max LDAA MTOUCH max touches SUBA #STOUCH the threshold * STAA NTOUCHL store so we trip soon * STAA NTOUCHR store so we trip soon * Switch to disable the counts and such LDAA PORTE Load A with PORTE data ANDA #$4 SW3 BEQ CNT_ENABLED BSET STATUS #NOCNTS Disable the counting stuff CNT_ENABLED EQU * * At first lets check that EEPROM location 0 has an R or L See if the RIGHT glove is OK LDX #$1000 bset etc have to be nd addr BSET PORTB, #RRED-I_RED LEDs = RED BSET EESTAT #EELR set LR to indicate right BCLR EESTAT #EERW clr RW to indicate read LDAB #$0 Address 0x00 * A = data, B = ADDRESS JSR EEREAD It's a read (data comes back in A) CMPA • • R BNE TLEFT It's NOT OK * Masks in fingers which are valid LDAA VMASK ORA #RIGHTF OR in the bits associated with right hand STAA VMASK BSET STATUS #RVALID RT is valid BCLR STATUS #REXPIRE LDX #$1000 bset etc have to be ind. addr BSET PORTB,X #RGRN Right LED = GREEN BCLR PORTB,X #RRED Right LED = GREEN * Read the threshold stuff into RAM * A = data, B = ADDRESS LDAB #EECNT_VALID JSR EEREAD It's a read (data comes back in A) STAA REEVALID LDAA REEVALID BNE REELOADB0 If !0 then load address for B LDAB #EECNT_ACTA Load address for A JSR EEREAD It's a read (data comes back in A) STAA REEACT LDAB #EECNT_ J ACTA+1 Load address for A JSR EEREAD It's a read (data comes back in A) STAA REEACT+1 BRA REERDDONE Done REELOADB0 EQU * LDAB #EECNT__ftCTB JSR EEREAD It's a read (data comes back in A) STAA REEACT LDAB #EECNT_ACTB+1 Load address for B JSR EEREAD It's a read (data comes back in A) STAA REEACT+1 REERDDONE EQU * LDAB #EECNT_THR1 JSR EEREAD It's a read (data comeε back in A) STAA REETHR1 LDAB #EECNT_THR2 JSR EEREAD It's a read (data comeε back in A) STAA REETHR2 (data comes back in A) TLEFT EQU * * See if the LEFT glove is OK BCLR EESTAT #EELR clear LR to indicate left BCLR EESTAT #EERW clr RW to indicate read LDAB #$0 Address 0x00 * A = data, B = ADDRESS JSR EEREAD It's a read (data comes back in A) CMPA # ' BNE TDONE * Masks in fingers which are valid LDAA VMASK ORA #LEFTF OR in the bits associated with LEFT hand STAA VMASK BSET STATUS #LVALID LF is valid BCLR STATUS #LEXPIRE LDX #$1000 bset etc have to be ind. addr BSET PORTB,X #LGRN Left LED = GREEN BCLR PORTB,X #LRED Left LED = GREEN * Read the threshold stuff into RAM * A = data, B = ADDRESS LDAB #EECNT_VALID JSR EEREAD It's a read (data comes back in A) STAA LEEVALID LDAA LEEVALID BNE LEELOADB0 If !0 then load address for B LDAB #EECNT_ACTA Load address for A JSR EEREAD It's a read (data comeε back in A) STAA LEEACT LDAB #EECNT_ACTA+1 Load address for A JSR EEREAD It's a read (data comes back in A) STAA LEEACT+1 BRA LEERDDONE Done LEELOADB0 EQU * LDAB ♦EECNT_ACTB JSR EEREAD It's a read (data comes back in A) STAA LEEACT LDAB #EECNT_ACTB+1 Load address for B JSR EEREAD It's a read (data comes back in A) STAA LEEACT+1 LEERDDONE EQU * LDAB #EECNT_THR1 JSR EEREAD It's a read (data comes back in A) STAA LEETHR1 LDAB #EECNT_THR1+1 Low byte JSR EEREAD It's a read (data comes back in A) STAA LEETHR1+1 Low byte LDAB #EECNT_THR2 JSR EEREAD It ■ ε a read (data comes back in A) STAA LEETHR2 LDAB #EECNT_THR2+1 Low byte JSR EEREAD It's a read (data comes back in A) STAA LEETHR2+1 Low byte TDONE EQU CLI Enable interrupts * main loop MAINLOOP LDX #$1000 register base address (bset etc have to be ind. addr) BSET PORTB,X #$80 BCLR PORTB, #$80 Set/clear B7 to trig scope See if any commands arrived LDAA RCVBUF Receive byte count See if the right or left gloves have expired BRCLR STATUS #LEXPIRE LEXOK Branch over if left is invalid BCLR STATUS #LVALID LF is expired -> invalid BCLR STATUS #LEXPIRE Clear the invalid flag LDAB #$10*3 Number of bytes to clear LDX •NEW starting location LOOPZA CLR $0,X Save 0 to this location INX DECB BNE LOOPZA CLR RFING CLR LFING CLR THUMB Masks off fingers which are invalid LDAA VMASK ANDA #$F0 AND off the bits associated with left hand STAA VMASK LEXOK EQU * BRCLR STATUS tREXPIRE REXOK Branch over if right is invalid BCLR STATUS #RVALID RT is expired -> invalid BCLR STATUS #REXPIRE Clear the invalid flag * Masks off fingers which are invalid LDAA VMASK AND off the bits associated with right hand Number of bytes to clear starting location Save 0 to this location REXOK EQU * * See if a read of the hand gives any new data to send JSR FULLREAD JMP MAINLOOP FULLREAD EQU * * Initialize the data struct for doing a read by clearing the new record * length count and initializing X to point to the first byte of the record * NOTE - X is trashed m thumb stuff JSR READNEWRead data into NEW LDX ♦NEW Address of NEW LDY ♦OLD Address of OLD JSR DELTA Is NEW==OLD? BNE NEWDIFF Dif er - may have a new record to send RTS Return early to mam loop NEWDIFF EQU * NEW '= OLD LDX #LAST Address of LAST LDY #NEW Address of NEW JSR COPYREC LAST=NEW ( Y = SOURCE and X = DESTINATION ) LDX #LASTTS Address of time stamp for LAST JSR COPYTIME time stamp LAST N0CHG2 EQU JSR READNEWRead data into NEW LDX ♦NEW Address of NEW LDY ♦LAST Address of LAST JSR DELTA Is NEW==LAST? BEQ NEWSAME It'ε the same so that ' ε good RTS Return early to main loop NEWSAME EQU * * NEW == LAST see if delta time new vs last is > threshold LDX tNEWTS Address of time stamp for NEW JSR COPYTIME time stamp NEW LDX tNEWTS Address of NEWTS LDY #LASTTS Address of LASTTS JSR SUB32 Subtract NEWTS - LASTTS LDX #R_32 Points to the result LDY #THRESH JSR CMP32 Compare (New - Last) to threshold time CMPA #$0 Compare A to 0 BLT N0CHG2 Less than compare * NEW is valid - the data hasn't changed in THRESH time units and is stable * Calculate delta time stamp LDX #NEWTS Address of NEWTS LDY #0LDTS Address of OLDTS JSR SUB32 Subtract NEWTS - OLDTS LDAA R_32 Load the hi byte (bits 31.. 4) BNE ROLLOVR There are hi bits set so we should send 7F 7F LDAA R_32+l Load Hi middle bits 23..16 BITA #$C0 Are the hi bits set lie 23 22) BNE ROLLOVR There are hi bits set so we should send 7F 7F BRA CALCTS Calculate the time stamp data to send ROLLOVREQU * LDAA #$FF STAA R_32+l Force middle bytes to FF to indicate overflow STAA R_32+2 CALCTS EQU * LDD R_32+l LSLD LSRB ANDA #$7F SEI Disable interrupts JSR SENDDA Send data record CLI Enable interrupts and DESTINATION ) SUB32 EQU 32 bit subtract R = A - B X points to A - H at X+0 L at X+2 * Y points to B - H at X+0 L at X+2 LDD 2,X D = AL SUBD 2,Y D = AL - BL STD R_32+2 RL = AL-BL LDD 0,X D = AH BCC NOCARRY * there is a carry needed SUBD •$1 carry NOCARRYEQU SUBD 0.Y D = AH - BH (-1 if carry) STD R_32 RH = hi RTS CMP32 EQU 32 bit compare X points to A - H at X+0 L at X+2 Y points to B - H at X*0 L at X+2 rtn in A -1=B larger, 0=Equal, 1=A larger B? decision is m the high words decision is in the low words LDB #$2 to skip pointers over the high bytes ABX X now points at the low bytes ABY Y now points at the low bytes CMPH EQU * * decision is in the high or the low bytes - which X and Y point to. LDAA «$0 RTS * ** * * * ****** * ** *** ***** * ******* * *** * *** * * * * * * * * .******« ****** * * *• * < COPYTIME EQU copy current time to 32 bits pointed at by X Disable intε Read upper bits we maintain Store upper bits Load the low bits Store low bits read the TOF bit is the TOF bit set Bit is 0 - no overflow Enable ints Int will happen on the next instruction DE Try again NOTOF Enable ints EADNEWEQU Disable interrupts Clear the count for the new record Read thumbs (trashes X) Get finger data (uses X) Check record is self consistent Enable interrupts No - try again RDTHUMBS EQU * * Read thumbs and add the results to NEW data structure NOTE X gets distroyed and is restored with NEW at the end of the thmb stuff * Local Vars * THUMB indicates r-1 thumb contact occured * RFING indicates r -> fingers de portc from R thumb) * LFING indicates 1 -> fingers de portc from L thumb) LDX #$1000 register base address (bset etc have to be ind addr) * SEI Disable interrupts CLRB B is thumb - thumb BRCLR STATUS #RVALID NRTHUMB Branch over if right is invalid * right thumb > left thumb and fingers JSR SETTOZERO Set output bits to 0 before a read BSET PACTL.X #RTHUMB Set right thumb as an output pin BSET PORTA,X #RTHUMB Right thumb = 1 JSR FINGERDELAY Walt for things to settle LDAA PORTC R humb -> fingers * Masks Off fingers which are invalid ANDA VMASK AND off the bits associated with invalid hands STAA RFING Save rthumb-> ingers BRCLR PORTA, *LTHUMB NRTHUMB If left thumb not in contac BRCLR STATUS *LVALID NRTHUMB Branch over - left not valid INCB Add to indicate a touch T-T NRTHUMB EQU * No thumb to thumb contact or fell thru inc BCLR PORTA,X •RTHUMB Right thumb = 0 * CLR RFING Clear r humb->fingers * CLI Enable interrupts * BCLR PACTL.X •RTHUMB Set right thumb as an input pin left thumb - > right thumb and fingers BRCLR STATUS #LVALID NLTHUMB Branch over if left is invalid JSR SETTOZERO Set output bits to 0 before a read BSET PACTL.X #LTHUMB Set left thumb as an output pin BSET PORTA,X •LTHUMB Left thumb = 1 JSR FINGERDELAY Wait for things to settle LDAA PORTC Lthu b -> fingers Masks of f fingers which are invalid ANDA VMASK AND off the bits associated with an invalid hand STAA LF NG Save Lthumb->fingers BRCLR PORTA,X *RTHUMB NLTHUMB If right thumb not in contac INCB Note we are touching NLTHUMBEQU * No thumb to thumb contact or fell thru inc BCLR PORTA,X #LTHUMB Left thumb = 0 * CLR LFING Clear Lthumb->fingers * BCLR PACTL.X ILTHUMB Set left thumb as an input pin JSR SETTOZERO Set output bits to 0 before a read RESTORE X NOW THAT THUMB STUFF IS DONE CLI Enable interrupts LDX #NEW X is the address of the start of the new record Now check for bounce conditions (B is THUMB) -> Thumb-thumb bounce the THUMB is one not two or zero -> If THUMB is 2 then RFING should be == to LFING STAB THUMB 2 or 0 CMPB *$01 Is thumb == 1 BEQ RDTHUMBS Redo the thumb reads BLT NOTHUMB No thumb - thumb touch Valid thumb - thumb touch check that RFING == LFING - Note A still has LFING in it CMPA RFING is LFING == RFING BNE RDTHUMBS Redo the thumb reads (thumbs touch l/rfing'=) Start to assemble the data structure - if we're here then the thumbs are in contact and there may also be fingers touching the thumbs Add one byte pair to the data structure at X+l and X+2 and inc reel split LFING into X+l and X+2 Set the bit for Rthumb Set the bit for Lthumb There's no independent thumb action - skip it NOTHUMBEQU * * May have to add to data structure if thumb touches fingers but not * the other thumb LDAA RFING A is right fingers BEQ NORFING Rthumb has no touch JSR ATOXSPLIT Split RFING into X+l and X+2 BSET $2,X «THUMBIT Set the bit for Rthumb JSR INCREMENTX NORFINGLDAA LFING A is Lfingers BEQ NOLFING Lthumb has no touch JSR ATOXSPLIT Split LFING into X+l and X+2 BSET $1,X •THUMBIT Set the bit for Lthumb JSR INCREMENTX NOLFINGEQU NOFING EQU RTS RDFINGERS EQU * * SUBROUTINE * Finger to finger contact test Local Varε: USED used as a bit accumulator to see what's done TEMP temporary storage * Globalε: * NEW the record we are assembling on this read of the band • LDAB RFING B is the bits seen by the right thumb ORAB LFING B also has bits found by the left thumb STAB USED Save into the byte which gets used bits LDAB •$80 B is 0x80 STAB BITMASKSave B xn the mask COM BITMASKMask is now all bits except for bit B BITLOOPFSHB save B on the stack TBA A is = to B ANDA USED Has this bit already been used? BNE NEXTBΓT This bit is used and can't be repeated JSR SETTOZERO Set output bits to 0 before a read SEI Disable interrupts STAB DDRC Bit B is an output STAB PORTC Bit B on Portc is now hi - the other bits are inputs JSR FINGERDELAY Wait for things to settle EORB PORTC B now has the bits set which do not include bit B CLR PORTC Clear the on bits in port C CLI Enable interrupts ANDB BITMASK B does not have duplicates from high bits BEQ NEXTBITBit B is not touching any other fingers STAB TEMP Save B ORAB USED B is now contact bits and the other bits STAB USED Update the used bit list PULB Load the bit that's the test bit PSHB Save B back on the stack ORAB TEMP or back in the other bits which are in contact Masks off hands which are invalid ANDB VMASK * check we have valid data (ie there's more than one bit set) LDY ♦LDTVALID top of LUT ABY Add B to Y LDAA 0,Y Load A with what's at Y+DATA BEQ NOFINGERS What if for some reason there's no valid data? * ok so we have B and need to add it to the current data record TEA A is = to B JSR ATOXSPLIT Split fingers into X+l and X+2 JSR INCREMENTX NOFINGERS EQU * NEXTBIT PULB get the save B from stack USEDBIT LSRB Logical right shift of B to the next bit position BEQ DONE Go unitl we roll off the end - then we're done LSR BITMASK Logical right shift of mask to the next bit position TBA A is = to B ANDA USED Has this bit already been used'' BNE USEDBITYes, used bit shift again BRA BITLOOP No, uniqe bit so see if it's touching anyone DONE EQU CLR DDRC Port C input RTS SENDDA EQU SUBROUTINE Send NEW packet data (D has time delta in it) Trashes: A B X PSHA Save the hi byte of the time delta PSHB Save the low byte of the time delta LDAA •STARTBYTE Generic start byte BRCLR STATUS *GTSTAMP SENDNOTIME the GTSTAMP is clear LDAA •STARTTBYTE Start which indicates time included SENDNOTIME EQU JSR OUTBYTE Send start of message run through the record and increment the 1 and r touch counts Left then right load count (in words) count is 0 so no data x = start of new record load a with data byte Left byte is 0 Inc left counter (risk of 255->0) We inced on this packet so bail Left count did not roll from 255->0 Dec left counter 0->255 left byte right byte DECB decrement count BNE LOOPLCOUNT DONELLOOP EQU * LDAB NEW load count (in words) LDX •NEW x = start of new record LOOPRCOUNT EQU * LDAA $2,X load a with data byte BEQ NORIGHT9 right byte is 0 INC NTOUCHR Inc right counter (risk of 255->0) BRA DONERLOOP We inced on this packet so bail * BNE NORIGHT9 right count did not roll from 255->0 * DEC NTOUCHR Dec right counter 0->255 NORIGHT9 EQU * INX left byte INX right byte DECB decrement count BNE LOOPRCOUNT DONERLOOP EQU * LDAB NEW load count BEQ NODA count is 0 so no data LDX •NEW x = start of new record LSLB Count is in words not bytes MOREDA LDAA $1,X load a with data byte INX inc pointer JSR OUTBYTE Send message DECB decrement count BNE MOREDA NODA EQU There'ε no actual data * for debug only * LDAA NTOUCHL * JSR OUTBYTE Send end of message * LDAA NTOUCHR * JSR OUTBYTE Send end of message * for debug only * LDAA LEEACTA Store hi byte * JSR OUTBYTE Send end of message * LDAA LEEACTA+1 Store hi byte * JSR OUTBYTE Send end of message * LDAA REEACTA Store hi byte * JSR OUTBYTE Send end of message * LDAA REEACTA+1 Store hi byte * JSR OUTBYTE Send end of message BRCLR STATUS •GTSTAMP NOTIME the GTSTAMP is clear PULA Hi byte of time delta JSR OUTBYTE PULA Lo byte of time delta JSR OUTBYTE BRA DONETSEND NOTIME EQU PULA Hi byte of time delta PULA Lo byte of time delta DONETSEND EQU * LDAA •ENDBYTE JSR OUTBYTE Send end of message RTS CONSISTEQU * SUBROUTINE * Returns so a BNE for NO good or BEQ for oκ * Check for self consistancy hand by hand LDX #NEW Right hand data 1 3 5 7 ... JSR CHECKREC Go and check BEQ CONSISL OK record - check left hand RTS Bad record - return CONSISL EQU LDX «NEW+1 Left hand data 2 4 6 8 ... JSR CHECKREC Go and check RTS Return and the caller does a BNE BAD or BEQ OK FINGERDELAY EQU * SUBROUTINE * Waits for a little while for fingers to settle down PSHX LDX #$1000 register base address (bset etc have to be ind. addr) * BSET PORTB,X #RRED * BCLR PORTB,X #RRED LDX #$42 * TESTING (waε $12) DECXDLY DEX BNE DECXDLY PULX RTS COPYREC EQU SUBROUTINE Copies a record from where Y points to where X points Y = SOURCE and X = DESTINATION Note: Trashes A B X Y LDAB $0,Y load count of record Y LSLB count in bytes not words INCB Need to copy the length byte also COPYLP LDAA $0,Y Load A with a byte STAA $0,X Store A to where X points INX Inc destination pointer INY Inc source pointer DECB Decrement B (the byte counter) BNE COPYLP Next byte RTS Return DELTA EQU SUBROUTINE see if two records are the same Note: Trashes X Y A B Pass in the adreεε of the records in X and Y On return a BNE will jump if the records were not equal LDAB $0,X load count of record X LDAA $0,Y load count of record Y CBA BNE DONECMP not equal in len so exit TSTA is the length zero and equal? BEQ DONECMPyes, count is 0 and counts are - LSLB count is words not byteε MORE LDAA $1,X load A with first byte of record X CMPA $1.Y compare to record Y BNE DONECMPnot equal in data so send INX next byte of X INY next byte of Y DECB byte counter BNE MORE not done yet CLRA OK - . the same need a BEQ to pass DONECMP RTS CHECKREC EQU * SUBROUTINE * On entry X is to point to the first byte to compare (record NEW) * NOTE - A B Y X are all trashed * * On return a BNE which is taken idicateε a bad record * For RIGHT hand X should be Record address * For LEFT hand X should be Record address+1 * * check the NEW data record is self conεistant (ie that if you OR * all the record bytes for each hand then * you should and compare that to EXORing them all then you should get the same thing - ie there were no data changes while the glove was being read This now filters the case where a bit gets set three times, this is done by comparing A abd B after every byte is added and if any bit getε set twice then we bail at that point, ie record 03 10 01 10 11 00 01 a = 0, b = rec no data - skip Y = reel [as a byte) A = cumulative OR B = cumulative EXOR is A the same as B? No so bail out of here Do one hand which is every other byte Count off the words More data is A the same as B? Done checking - on return a BEQ for OK SETTOZERO EQU SUBROUTINE Sets PortA 3-.7 and Port C to outputs and writes a 0 out there then makes all of them inputs DLY00 **************************** INCREMENTX EQU Increment the pointer twice rec 1 is number or WORDS not bytes. Save A Load rec 1 - number of WORDS Compare to max in a packet MAJOR PROBLEM eh Restore A Return set length to 0 and hope Load the fact that we have an internal error Send error Start from the top () () 0 () () () () () ()() I) () () <) ()() () I) () () () O <)(( ) ( >(< WHAT TO DO HERE???? () () () () () () () () () () () 0 (II) () () I) () ( ) (Ml III ) ( () () l ( RTS ATOXSPLIT EQU SUBROUTINE Acc A has an 8 bit word from the C port and we want it split up into X+l and X+2 as per our data structure. Other bits are set to 0. Data Structure: Byte (hand) 7 6 5 4 3 2 1 0 * X+l Left 0 0 0 Thumb Index Middle Ring Pinkie * A3 C3 C2 Cl CO * Byte (hand) 7 6 5 4 3 2 1 0 * X+2 Right 0 0 0 Thumb Index Middle Ring Pinkie A7 C7 C6 C5 C4 A has the C? parts for the above data structure. This routine puts them there. X is NOT incremented. The count is NOT incremented, save A shift right by 4 bits upper 4 are 0 save C7 C6 C5 C4 in X+2 restore A mask off the upper 4 bits save C3 C2 Cl CO in X+l CMD_INTERP EQU * SUBROUTINE * Command interpreter * A command is 2 bytes and is one of the following: * » Public * T [01] - Time stamp on data ON / OFF * V [0..255] - Co patability with previous versions * CR - Right hand aβcii configuration record * CL - Left hand aβcii configuration record * CP - Processor ascii configuration record * CT - tick time definition * >> Private: * P+ - Enter EEPROM program mode (P+)P ([LR][RWJ)P (AD)D - * * Note all commands are acked by a start DATA end sequence as an ACK * Un recognized commands return ? as the data in the ack * NOTE: Int's are turned off up top so if you want chars to arrive you * need to unmask them LDAA RCVBUF+1 A is the first byte which arrived LDAB RCVBUF+2 B is the second CLR RCVBUF Clear count εo we can get more data in CMD00 CMPA #'T Is it a T for time stamp BNE CMD10 Not a T CMPB #'0 Is it turned off? BNE CMD01 * Time stamps turned off BCLR STATUS #GTSTAMP Clear the GTSTAMP bit in the global STATUS byte LDAA •'0 Ack is true CMD03 JMP CMDDONE Done CMD01 CMPB ♦ ' 1 Is it turned ON ? BEQ CMD02 ON JMP ERRCMD Was a T but not 0/1 CMD02 EQU * * Time stamps turned ON BSET STATUS *GTSTAMP Set the GTSTAMP bit in the global STATUS byte LDAA #'1 Ack is true BRA CMD03 • CMDIO CMPA #'V Version Compatability mode BNE CMD20 Not a V CMPB *'1 We're version 1 BNE CMD11 Uh oh CMD11 LDAA *'l We always return a 1 here JMP CMDDONE * ——-.-— * Return Timer tick string Configuration CMD20T EQU * LDAA •STARTXBYTE send a start byte JSR OUTBYTE Send start of message Start of string Load char Is it the end char? Yeε, branch out Send start of message Next char Branch for next char Send end of message * Return configuration for RIGHT hand glove CMD20R EQU * BRSET STATUS #RVALID CMD20ROK Right is valid send a start byte Send start of message Send start of message Send start of message Start of string Load char Is it the end char? Yeε, branch out Send start of message INY Next char BRA CMD20R1 Branch for next char CMD20RX LDAA •ENDBYTE JSR OUTBYTE Send end of message RTS CMD20ROK EQU * JSR DELAY10MS Just in case a write just took place BCLR EESTAT tEERW clear RW to indicate read BSET EESTAT #EELR set LR to indicate right CMD21 LDAA •STARTXBYTE send a start byte JSR OUTBYTE Send start of mesεage LDAB *CONFIG_START b = starting adresε CMD22RD EQU PSHB JSR EEREAD Read (data comes back in A) JSR OUTBYTE Send start of message PULB INCB b++ CMPB «CONFIG_LEN are we done BNE CMD22RD LDAA •ENDBYTE JSR OUTBYTE Send end of message RTS Skip out (multi char reply) * Return configuration for LEFT hand glove CMD20L EQU * BRSET STATUS «LVALID CMD20LOK Left is valid send a start byte Send start of message Send start of message Send start of message Start of εtring Load char Is it the end char? Yeε, branch out Send start of message Next char Branch for next char Send end of message Just in case a write just took place clear RW to indicate read clear LR to indicate left CMD30 Program Mode CMD300 CMPB # ' ♦ BEQ CMD301 JMP ERRCMD Program mode Protocol: Host εendε 68hCll Replies P+ start P end [LR] [RW] start P end Addr Data when done start data end CMD301 EQU JSR DELAY10MS Just in case a write just took place LDX #$1000 BRCLR EESTAT #EERW CMD37 if clear RW to indicate read PSHA A = data, B = ADDRESS JSR EEWRITE It' s a write JSR DELAY10MS a write just took place no more writes (delay for at least 10msec) PULA BRA CMDDONE CMD37 JSR EEREAD It'ε a read (data comes back in A) BRA CMDDONE CMD40 EQU ERRCMD LDAA • '? CMDDONE PSHA LDAA •STARTXBYTE send a start byte end byte to ACK JSR OUTBYTE Send start of message PULA JSR OUTBYTE Send message LDAA •ENDBYTE JSR OUTBYTE Send end of message RTS * DELAY10MS - Software lOmβec delay at 9.8304MHz DELAY10MS EQU * PSHY LDY *3510 3510*7 cycles at E elk of 407nε DELAY10MSA EQU * DEY BNE DELAY10MSA PULY RTS * OUTBYTE - Output byte in A over SCI OUTBYTE PSHB INBYTE - Wait for SCI data, read SCI and return byte in A CHKSER LDAA SCSR ANDA #$20 RTS *** EEPROM INTERFACE STARTS * EEWRITE - Write to EEPROM * A = data, B = ADDRESS * EESTAT has L/R and R/W bits ******* EEWRITE EQU * * A = data, B = ADDR PSHX LDX *$1000 PSHA JSR EEADDR set up the address (in B) PULA pull old A from stack which is data JSR EESEND data BCLR PORTD,X *EEDATA force data low JSR EECLKLH Raise CLK line - ready for STOP condition BSET PORTD,X tEEDATA force data high - STOP NOW PULX RTS * EEREAD - Read data from EEPROM * Used EESTAT to indicate L/R * B = ADDR * returns A = DATA EEREAD EQU * PSHX LDX •SIOOO JSR EEADDR send (as if a WR) the control byte and address * Clock will end low BSET PORTD,X tEEDATA data hi JSR EECLKLH clock is now HI BCLR PORTD,X tEEDATA data was hi and is now LOW - START condition JSR EECLKHL clock is now low •EERDCTL EESEND send the READ control byte DDRD.X »EEDATA port D is input •$8 Number of bits to read EECLKLH first edge elk lo->hi shift a 0 into BO PORTD, #EEDATA NOBIT read in the bit * JSR EECLKHL Clock low for next bit * for speed we replicate the code here BRSET EESTAT *EELR REECLKLHO Right BCLR PORTB,X #LEECLK Drop LEFT clock line BRA DODEC REECLKLHO BCLR PORTB,X *REECLK Drop RIGHT clock line DODEC EQU * DECB BNE RDBIT Loop for 8 bits BSET DDRD.X tEEDATA port D is output BCLR PORTD,X •EEDATA force to 0 JSR EECLKLH Raise clock line BSET PORTD,X •EEDATA force to 0 JSR EECLKHL Clock low PULX RTS ******** EEADDR - sets the address of the EEPROM to the value in B * B = address EEADDR EQU * * clock and data are low now PSHB BSET PORTD,X tEEDATA data was low and is now hi - START condition JSR EECLKLH Raise the clock line BCLR PORTD, tEEDATA data was hi and is now low - START condition JSR EECLKHL Lower the clock line LDAA •EEWRCTL JSR EESEND send the WRITE control byte PULA pull old B from stack which is addr JSR EESEND address RTS EESEND EQU * * Uses B of AB acc's * Clock line starts out LOW and dat has to change while elk iε low LDAB t$8 Number of bits to send BITLP ASLA Left shift A BCC ZBIT BSET PORTD,X •EEDATA bit is HI Bet BRA SD1 bit is ok ZBIT BCLR PORTD,X tEEDATA bit iε LOW clear * BRA SD1 bit is ok (make time per bit always =) SD1 EQU * * JSR EECLKLH Raise CLK line * Raise elk for the RIGHT or LEFT as required BRSET EESTAT •EELR SEECLKLHl Right BSET PORTB,X •LEECLK Raise LEFT clock line BRA LOWRSDA SEECLKLHl BSET PORTB,X #REECLK Raise RIGHT clock line LOWRSDAEQU * * JSR EECLKHL Lower CLK line * Drop elk for the RIGHT or LEFT as required BRSET EESTAT •EELR SEΞCLKLHO Right BCLR PORTB,X •LEECLK Drop LEFT clock line PORTB, *REECLK Drop RIGHT clock line DECB BNE BITLP Loop for 8 bits BCLR DDRD.X tEEDATA port D iε input JSR EECLKLH Raise clock line to get the ACK BRCLR PORTD,X »EEDATA ACKOK data iε low * ack is not OK - data floated HI ACKOK EQU * JSR EECLKHL Clock low - done BSET DDRD.X tEEDATA port D iε output * note we leave CLK low and data iε whatever RTS EECLKHLEQU * * Drop elk for the RIGHT or LEFT as required BRSET EESTAT tEELR EECLKHLO Right BCLR PORTB,X tLEECLK Drop LEFT clock line RTS EECLKHLO EQU * BCLR PORTB,X *REECLK Drop RIGHT clock line RTS ******** EECLKLH EQU * * Raise elk for the RIGHT or LEFT as required BRSET EESTAT «EELR EECLKLH1 Right BSET PORTB,X #LEECLK Raise LEFT clock line RTS EECLKLHl EQU * BSET PORTB,X tREECLK Raise RIGHT clock line RTS EEPROM INTERFACE ENDS ORG SEC00 » »* LUT (1 if more than one bit is set) * INTERRUPT STUFF ORG SFOOO ******************************** * SCI interrupt routine VSCI_INT EQU * ******************************** Called for serial data stuff Recieve interrupt iε the only thing which should cause an interrupt LDAA SCSR Read SCI status Is there a byte in the receiver? branch if there is stuff otherwise read to clear the flags (OF etc) Out'a here Get data Get data count count is non 0 this must be the second byte Store in first spot in buffer Inc count from 0 to 1 Done int How does B compare to 1? Greater - over run so bail Store in second spot in buffer Inc count from 1 to 2 * TIMER OVERFLOW INTERRUPT VTOF_INT EQU Interrrupt Service Routine Called when the 16 bit timer rolls over Assuming 9.8304Mhz xtal PR01 scale One tick Overflow (8bit) Overflow (16bit) 1 406.9ns 104.17uε 26.67ms 4 1.6276us 416.67US 106.67ms 8 3.2552us 833.33uε 213.33ms <<= Curent 16 6.5104uε 1.6667ms 426.67ms * We maintain the 2 upper bytes of time * LDX TIME Load the upper bits of time INX Increment STX TIME Store back LDAA •$80 The TOF bit iε set (this will CLEAR the bit on WR) STAA TFLG2 Clear the TOP bit by writing a 1 to that bit RTI VRTI_INT EQU * * INTERRRUPT Service Routine * Periodic timer interrupt * * This iε where we do the interface to the serial EEPROM touch counters * ECLK = XTLAL/4 * RTI time (ms) at 9.8304MHz 0 = /2"13 1 3.33ms 1 = /2 Λ 14 2 6.66ms 2 = /2 Λ 15 4 13.33ms «= Current value 3 = /2 Λ 16 8 26.66ms B is lower accumulator 0x40 (64) = 851ms LDD RTICNT ADDD *$1 STD RTICNT Dispatcher on time values TBA A iε = to B ANDA *$0F And off the lower bits left BEQ CNT_ON if 0 then do check JMP ENDRTI else end CNT_ON EQU * BRCLR STATUS «NOCNTS DIS_0 Ok to do this? JMP ENDRTI else end DIS_0 CMPB #$00 BNE DIS_1 JMP HANDLELEFT DIS_1 CMPB *$10 BNE DIS_2 JMP HANDLERIGHT DIS_2 CMPB «$20 BNE DIS_3 JMP CHECKLEFT DIS_3 CMPB #$30 BNE DIS_4 JMP CHECKRIGHT DIS_4 CMPB «$40 BNE DIS_5 JMP WL_L DIS_5 CMPB «$50 BNE DIS_6 JMP WH_L DIS_6 CMPB »$60 BNE DIS_7 JMP CL_L DIS_7 CMPB «$70 BNE DIS_8 JMP CH_L DIS_8 CMPB #$80 BNE DIS_9 JMP VW_L DIS_9 CMPB «$90 BNE DIS_A JMP VC_L DIS ^ A CMPB «$A0 BNE DIS_B JMP WL_R DIS_B CMPB #$B0 BNE DIS_C JMP WH_R DIS_C CMPB «$C0 BNE DIS_D JMP CL_R DIS_D CMPB «$D0 BNE DIS_E JMP CH_R DIS_E CMPB *$E0 BNE DIS_F JMP VW_R DIS_F CMPB »$F0 BNE DIS_G JMP VC_R DIS_G * debug - do very often * BITB «1 * BEQ HANDLERIGHT * BRA HANDLELEFT * JMP ENDRTI * Now handle the left and right touch counts **************** * Left hand touch count maintenance HANDLELEFT EQU * BRCLR STATUS »LVALID DONEHLEFT umber of touches ore than the threshold? o - wait longer eε - clear the count = actual dd one need to write to left glove soon ompare with THR1 one less than THR1 ellow ompare with THR2 one less than THR2 ed is left Left is not valid * Right hand touch count maintenance HANDLERIGHT EQU * the count BSET STATUS •RNEEDWR Need to do a write to right glove soon CMPD REETHR1 compare with THR1 BLO DONEHRIGHT Done less than TOR1 LDX •$1000 BSET PORTB,X #RRED Yellow CMPD REETHR2 compare with THR2 BLO DONEHRIGHT Done less than THR2 BCLR PORTB,X ♦RGRN Red iε left on BSET STATUS tREXPIRE right is not valid DONEHRIGHT EQU JMP ENDRTI ************* ' WL_L EQU BRCLR STATUS tLNEEDWR WL_LEND LDAA LEEVALID BNE WL_L0 If !0 then load address for B LDAB ♦EECNT_ACTB+1 ADDRESS IS OTHER (TO GO FROM A->B / B->A) BRA WL_L1 WL_L0 LDAB ♦EECNT_ACTA+1 ADDRESS IS OTHER (TO GO FROM A->B / B->A) WL_L1 BCLR EESTAT tEELR set LR to indicate left BSET EESTAT tEERW set RW to indicate write LDAA LEEACT+1 A = low byte of data to write JSR EEWRITE It's a write (A=data, B=ADDR) WL_LENDJMP ENDRTI WHJJSND f !0 then load address or B DDRESS IS OTHER (TO GO FROM A->B / B->A) DDRESS IS OTHER (TO GO FROM A->B / B->A) et LR to indicate left et RW to indicate write = low byte of data to write t's a write (A=data, B=ADDR) CL_L EQU oad address for B THER (TO GO FROM A->B / B->A) THER (TO GO FROM A->B / B->A) dicate left dicate read (A=data, B=ADDR) of data to write address for B R (TO GO FROM A->B / B->A) R (TO GO FROM A->B / B->A) ate left ate read data, B=ADDR) data to write VW_L EQU BRCLR STATUS tLNEEDWR VW_LEND LDAB *EECNT_VALID Address LDAA LEEVALID BNE VW L0 If !0 then load address for B NCA A was 0 iε 1 now BRA VW_L1 VW_L0 CLRA A waε 1 is 0 now VW 1 BCLR EESTAT #EELR εet LR to indicate left BSET EESTAT #EERW set RW to indicate write JSR EEWRITE It's a write (A=data, B=ADDR) VW_LEND JMP ENDRTI . *********** VC_L EQU BRCLR STATUS •LNEEDWR VC_LEND LDAB «EECNT_VALID Address BCLR EESTAT #EELR set LR to indicate left BCLR EESTAT •EERW clr RW to indicate read JSR EEREAD It's a read (A=data, B=ADDR) CMPA LEEVALID Should not be equal BNE VC_L0 not equal (this is good) * NOT OK TURN LED RED BUT WORK LDX •$1000 BCLR PORTB,X #LGRN Red is left BCLR STATUS #LNEEDWR BRA VC LEND VC_L0 EQU LDAA LEEVALID BNE VC_L1 If ! 0 then load address for B INC LEEVALID was 0 iε 1 now BRA VC_L2 VC Ll CLR LEEVALID was 1 is 0 now VC_L2 BCLR STATUS #LNEEDWR VC_LENDJMP ENDRTI WL_R EQU BRCLR STATUS •RNEEDWR WL_RBND LDAA REEVALID BNE WL_R0 If !0 then load address for B LDAB •EECNT_ACTB+1 ADDRESS IS OTHER (TO GO FROM A->B / B->A) BRA WL_R1 WL_R0 LDAB •EECNT_ACTA+1 ADDRESS IS OTHER (TO GO FROM A->B / B->A) WL_R1 BSET EESTAT «EELR set LR to indicate right BSET EESTAT «EERW set RW to indicate write LDAA REEACT+1 A = low byte of data to write JSR EEWRITE It's a write (A=data, B=ADDR) WL_RENDJMP ENDRTI WH_R EQU BRCLR STATUS •RNEEDWR WH_REND LDAA REEVALID BNE WH_R0 If !0 then load address for B LDAB ♦EECNT_ACTB ADDRESS IS OTHER (TO GO FROM A->B / B->A) BRA WH_R1 WH_R0 LDAB tEECNT__ACTA ADDRESS IS OTHER (TO GO FROM A->B / B->A) WH_R1 BSET EESTAT «EELR set LR to indicate right BSET EESTAT tEERW set RW to indicate write LDAA REEACT A = low byte of data to write JSR EEWRITE It's a write (A=data, B=ADDR) WH_RENDJMP ENDRTI CL_R EQU BRCLR STATUS #RNEEDWR CL_REND LDAA REEVALID BNE CL_ 0 If 10 then load address for B LDAB *EECNT_ACTB+1 ADDRESS IS OTHER (TO GO FROM A->B / B->A) BRA CL_R1 CL_R0 LDAB «EECNT_ACTA+1 ADDRESS IS OTHER (TO GO FROM A->B / B->A) CL_R1 BSET EESTAT •EELR set LR to indicate right BCLR EESTAT •EERW clr RW to indicate read JSR EEREAD It's a read (A=data, B=ADDR) CMPA REEACT+1 A = low byte of data to write BEQ CL_REND Done - OK * NOT OK TURN LED RED BUT WORK LDX •$1000 BCLR PORTB,X *RGRN Red is left BCLR STATUS tRNEEDWR CL_RENDJMP ENDRTI CH_R EQU BRCLR STATUS •RNEEDWR CHJREND LDAA REEVALID BNE CH_R0 If !0 then load address for B LDAB *EECNT_ACTB ADDRESS IS OTHER (TO GO FROM A->B / B->A) BRA CH_R1 CH_R0 LDAB *EECNT_ACTA ADDRESS IS OTHER (TO GO FROM A->B / B->A) CH_R1 BSET EESTAT *EELR set LR to indicate right BCLR EESTAT #EERW clr RW to indicate read JSR EEREAD It's a read (A=data, B=ADDR) CMPA REEACT A = low byte of data to write BEQ CH_REND Done - OK * NOT OK TURN LED RED BUT WORK LDX #$1000 BCLR PORTB,X tRGRN Red is left BCLR STATUS #RNEEDWR CH.RENDJMP ENDRTI VW_R EQU BRCLR STATUS #RNEEDWR VW_REND LDAB •EECNT VALID Address LDAA REEVALID BNE VW_R0 If !0 then load address for B INCA A was 0 iε 1 now BRA VW_R1 VW_R0 CLRA A was 1 iε 0 now VW_R1 BSET EESTAT »EELR set LR to indicate right BSET EESTAT tEERW set RW to indicate write JSR EEWRITE It's a write (A=data, B=ADDR) VW_RENDJMP ENDRTI VC_R EQU BRCLR STATUS *RNEEDWR VC_REND LDAB «EECNT_VALID Address BSET EESTAT #EELR set LR to indicate right BCLR EESTAT tEERW clr RW to indicate read JSR EEREAD It's a read (A=data, B=ADDR) CMPA REEVALID Should not be equal BNE VC_R0 not equal (this is good) NOT OK TURN LED RED BUT WORK LDX *$1000 BCLR PORTB,X *RGRN Red iε left BCLR STATUS *RNEEDWR BRA VC_REND If ! 0 then load address for B was 0 iε 1 now was 1 iε 0 now VC_R2 BCLR STATUS •RNEEDWR VC REND JMP ENDRTI CHECKLEFT EQU * * See if the LEFT glove is OK BRCLR STATUS #LVALID CHKLOK Left is not valid so don't check LDX *$1000 bset etc have to be ind. addr set LR to indicate left clr RW to indicate read Address 0x00 => A = data, B = ADDRESS It's a read (data comes back in A) It 'ε OK and that's fine BSET PORTB,X «LRED Yellow BCLR PORTB,X *LGRN Red is left BSET STATUS #LEXPIRE Left is not valid CHKLOK EQU * JMP ENDRTI **************** CHECKRIGHT EQU * * See if the RIGHT glove is OK BRCLR STATUS tRVALID CHKROK Right is not valid so don' check LDX #$1000 bset etc have to be ind. addr BSET EESTAT *EELR set LR to indicate right BCLR EESTAT »EERW clr RW to indicate read LDAB •$0 Address 0x00 => A = data, B = ADDRESS JSR EEREAD It's a read (data comeε back in A) CMPA »'R BEQ ENDRTI It ' s OK and that'ε ine BSET PORTB,X •RRED Yellow BCLR PORTB,X *RGRN Red iε left BSET STATUS *R£XPIRE Left iε not valid CHKROK EQU * JMP ENDRTI ENDRTI EQU LDAA •$40 The RTIF bit set - write back to TFLG2 STAA TFLG2 Clear the TOF bit by writing a 1 to that bit RTI Interrupt vectors and jump aroundε for mods to OTP parts Patch to BRA ($20) to skip next BRA Skip over patch JMP Patch to indicate start of new code TRAP - output that an error occured and halt TRAP LDAA • ' ? ' JSR OUTBYTE LDAA #'?' JSR OUTBYTE RTI

Claims: Claims We claim: 1. A data input glove comprising: a glove having a thumb and four fingers, each of said thumb and four fingers with five corresponding fingertips, with at least one flexible fabric electrode disposed on each fingertip; 2. A data input glove system comprising: a glove having a thumb and four fingers, each of said thumb and four fingers with five corresponding fingertips, with at least one flexible fabric electrode disposed on each fingertip; an electronic control means for supplying electrical signals to at least one of flexible fabric electrodes and for detecting electrical signals from the remaining flexible fabric electrodes. 3. A data input glove system comprising: a glove having a plurality flexible fabric electrode disposed thereon; an electronic control means for supplying electrical signals to any one of the flexible fabric electrodes and for detecting electrical signals from the remaining flexible fabric electrodes, and thereafter supplying electrical signal to any other of the flexible fabric electrodes and detecting electrical signals from the remaining flexible fabric electrodes, and continuing to supplying electrical signals to the plurality of electrodes in turn while detecting electrical signals from all other electrodes.

Inventors: BOLAS MARK T, GREUEL CHRISTIAN, MCDOWALL IAN E, MEAD RUSSELL C JR, BOLAS, MARK, T., GREUEL, CHRISTIAN, MCDOWALL, IAN, E., MEAD, RUSSELL, C., JR.
Applicants: FAKESPACE INC, FAKESPACE, INC.
Application year: 1997
Main classification: G09G5
IPC codes: G06F3