Use of timing loop???
From: Charles Sullivan (cwsulliv_at_triad.rr.com)
Date: 11/23/05
- Next message: Artie Gold: "Re: Request for Recomandation: Looking for a simple web based costumer relation software"
- Previous message: Sebastian Kloska: "Re: Request for Recomandation: Looking for a simple web based costumer relation software"
- Next in thread: Eric: "Re: Use of timing loop???"
- Reply: Eric: "Re: Use of timing loop???"
- Reply: Kasper Dupont: "Re: Use of timing loop???"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 23 Nov 2005 15:11:58 GMT
I have a user app which talks to an external device by toggling
the status lines on an RS232 serial port. To make a particular
feature of this app work, I have to toggle the lines 80 times
within a period of about 150 milliseconds with a minimum delay
between toggles of 500 microseconds. (Longer is OK provided the
total elapsed time is less than 150 milliseconds.)
However a delay of 500 microseconds is much shorter than the timer
resolution, typically 10 milliseconds, available to user apps.
I can make this feature work by using a timing loop, i.e.,
long loopcount = NNNN;
while(--loopcount);
I recognize that the value of NNNN would have to be "calibrated"
individually for each system, that the system is tied up while
in the loop, and that the scheme could fail on a system heavily
loaded with higher priority tasks.
But aside from these minor details :-), what are the downsides
to using such a timing loop? (Or should I just forget the whole
idea?)
Regards,
Charles Sullivan
- Next message: Artie Gold: "Re: Request for Recomandation: Looking for a simple web based costumer relation software"
- Previous message: Sebastian Kloska: "Re: Request for Recomandation: Looking for a simple web based costumer relation software"
- Next in thread: Eric: "Re: Use of timing loop???"
- Reply: Eric: "Re: Use of timing loop???"
- Reply: Kasper Dupont: "Re: Use of timing loop???"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|