Received: from watserv1.uwaterloo.ca (watserv1.waterloo.edu) by karazm.math.UH.EDU with SMTP id AA28759 (5.65c/IDA-1.4.4 for ); Fri, 18 Oct 1991 13:54:04 -0500 Received: by watserv1.uwaterloo.ca id ; Fri, 18 Oct 91 14:49:30 -0400 Date: Fri, 18 Oct 91 14:49:30 -0400 From: Dave Stampe-Psy+Eng Message-Id: <9110181849.AA27819@watserv1.uwaterloo.ca> To: dstamp@watserv1.uwaterloo.ca, galt@dsd.es.com, glove-list@karazm.math.uh.edu Subject: Re: noise-free glove software > From galt@dsd.es.com Fri Oct 18 13:01:46 1991 > From: galt@dsd.es.com (Greg Alt - Perp) > To: dstamp@watserv1, glove-list@karazm.math.uh.edu > Subject: noise-free glove software > > Hey, that looks great. I'm glad someone went to the trouble of > rolling up the init routine into a loop... I'll try out it out > this weekend. That noise-reduction part sounds pretty impressive. > Here's my plan for what we need to do to make the whole package > (close to) perfect: > > 1) convert the function names to some standard > 2) separate the glove driver in its own .c file > 3) use compiler directives to allow use of the same code on several machines > e.g. #define PC_PRINTER would make it compile for a > PC using the printer port. > This shouldn't be too difficult since the code is basically the > same with only a few minor differences for each machine. > > > This is all pretty amazing... before we got our first hi-res code, > nobody was very interested in the glove, now people everywhere are > getting excited about it. I've already gotten mail from people from > Korea to the U.K. > Greg > THe first step in developing the standard will have to be the development of functioning code for each machine. The IBM PC's can be made self- calibrating pretty easily, and the use of defines for I/O port is a good idea. I would like to define the minimum functionality as: - initialize with one call, which enters hi-res mode, sets up a timer interrupt every 4 mS, and initializes the code. - an interrupt handler which: - polls the glove for $A0 start code, exits if not ready - if the glove was not ready after 500 tries, resets the glove mode - reads the 6-byte data packet, and 2 more throwaway bytes - deglitches and denoises the X and Y data (deglitches Z???) - stores the data int the glove_int_data buffer - sets the glove_int_data.new flag - a glove_read routine which: - disables interrupts - copies the glove_int_data (including .new flag) to buffer - clears the glove_int_data.new flag - enables interrupts - a reset routine (onexit(?)) which resets the timer interrupt It is probably worthwhile to have a LORES and HIRES mode set on initialization, which means that only the .keys data field is valid. The timer interupt would happen less often, to reduce CPU interrupt load. Total CPU load on a 386 looks to be about 3%. Proposed names for routines: int init_glove(int mode) #define LORES 0 #define HIRES 1 void reset_glove() int glove_read(glove_data *) /* returns 0 if old, 1 if new data */ If we try to keep some interface stuff the same, everyone can develop code for their machine that meets the specs. Then they can either be combined or distibuted seperatly. Any comments? - Dave Stampe