Re: 8ms Timer for serial port access

From: Grant Edwards (grante_at_visi.com)
Date: 10/29/03


Date: 29 Oct 2003 21:37:24 GMT

In article <BBC59AAC.1D12%jens.schumache@gmx.net>, Jens Schumacher wrote:

> But however, it seems that read() also returns directly. But maybe I'm
> wrong...have to check this.

Unless you've set non-blocking mode on the file descriptor, it will not
return immediately unless there is data available in the receie queue.

>> If you really have to proces the data exactly every 8ms, then you'll have
>> to use a real-time operating system (RTOS). A plain Linux kernel will not
>> work for you.
>>
>> I still don't understand why you think you need to process the data at
>> exact 8ms intervals. What are you doing with the processed data that is so
>> time critical?
>
> I'm analyzing eye-movements and in particular saccadic eye-movements. I
> need to detect them online to be able to execute some experiments.

So you're controlling some sort of output device based on the input data
stream?

> Since small saccadic eye-movements last only around 90ms I need to detect
> them really fast and have to avoid delay where I can.

The data has already been captured by the serial driver. You're not going
to loose data unless you stop reading it. If you really can't afford a few
milliseconds of latency in processing the data, you're going to have to
switch to an RTOS (real time OS). Linux (or Windows) will not work.

-- 
Grant Edwards                   grante             Yow!  Where's th' DAFFY
                                  at               DUCK EXHIBIT??
                               visi.com