Subject: Re: DRO on PC

From: [email-masked] (Steve Lindsay)
Date: 10 Jan 1995 09:34:38 -0700

>First, closed loop feedback from an encoder is how the commercial units
>work - that's right on.  Things like "Compumotors" use simple encoders
>and steppers.  Sophisticated systems for scope stages, etc. (like
>"Heidenhain" (?sp.)) use glass scales with phototransistors looking at
>multiple light images which are run into a phase locked loop for precision
>down to the 10 microinch level or better.

>Second, as far as losing data, you will probably have to create an
>interrupt routine to make sure you lose no pulses.  The parallel port
>has an input line which is tied to one of the system interrupt inputs.
>Most compiler packages such as Borland and uSoft allow you to create
>interrupt routines, arm them and pass the data from them through data
>blocks which are common to the interrupt code and your application.

>What happens is that when the wire which is tied to the interrupt line
>is taken low, the cpu stores the context in which it is working (probably
>updating your screen), puts that work aside and proceeds to service the
>interrupt by executing that code (in this case, inputting the data).  It
>then restores the context information needed to go back to whatever it
>used to be doing.  The whole switch time is in microseconds because the
>cpu hardware is optimized to get from one task to another rapidly for just
>your purposes.

>Mark McDade
>[email-masked]

This helps a lot.  I had read some and thought about trying an interrupt.
What about a com port.  I am using Visual C++ and Microsoft put in an
example
program using a modem.  I don't see in that code where they are using
an interrupt.  Is a com port somehow buffered or did they just do something
with their code I'm not following?  I don't understand why their program
does not loose data coming in from the com port.

---

From: [email-masked] (Wally Blackburn)
Date: Tue, 10 Jan 1995 19:17:21 GMT

In article <[email-masked]>,
Steve Lindsay <[email-masked]> wrote:
deleted
>does not loose data coming in from the com port. 

There is an interrupt, but that stuff is hidden from you.  In the case of
the serial (com) port, the UART generates an interrupt when it receives a
byte of data.  The library routine (I'm guessing) in Microsoft/Visual C++
takes care of getting the byte from the UART.

This stuff is pretty fast even under DOS.  It is even more resistant when a
buffered UART (i.e. 16550) *and* software or OS (OS/2) that uses it
properly is employed.  In that case, the UART will interrupt when its
buffer is filling up instead of generating an interrupt for every byte.

-- 
   Wally Blackburn		   Clinton-Gore - Socialist Leadership
   [email-masked]		          for the 90s!
   Amateur Radio Station AA8DX	   I'm the NRA.
   '91 FXR	DoD #1375