Re: Highly responsive serial port
- From: "Pavel A." <pavel_a@xxxxxxxxxxxxxxx>
- Date: Mon, 04 Aug 2008 21:42:25 +0300
In addition to other replies:
Note that read request to the serial driver can be completed
by reading specified number of bytes, or by timeout.
In it's turn, the resolution of these timeouts is same as the
system clock resolution.
So, you either don't want to rely on timeouts (design your protocol
so that request can be completed by reading exact number of bytes)
or set the minimum possible timer resolution (which may be ~ 2ms)
and use short timeouts.
Giving your process realtime priority is pointless
without this, because what holds your process is waiting for
i/o completion, not other processes.
Also, for real time serial protocols I'd warmly recommend
a cheap programmable microcontroller, connected to PC
over USB, ethernet or even serial port (not in real-time, of course).
Regards,
--PA
Arkej wrote:
Hello,.
before I dive into the world of kernel mode drivers I'd like to know:
My problem consists of reading from a serial COM port as fluent as possible(real-time like). It looks like it is not doable in user mode. If due to scheduling of threads my reader thread doesn't get enough time I have a delay of read on the input. Let's say I have to process data coming every 30ms and then reply in 20ms. If my reader only reads the input buffer after 50ms I'm too late to reply but I don't know it.
1. Would a driver(in kernel mode) have enough priority to process such requests in time?
2. Is there any other way in user mode to assure constant read of serial port?
Thanks
Robert
- Follow-Ups:
- Re: Highly responsive serial port
- From: Arkej
- Re: Highly responsive serial port
- References:
- Highly responsive serial port
- From: Arkej
- Highly responsive serial port
- Prev by Date: Re: Highly responsive serial port
- Next by Date: Re: STATUS_ILLEGAL_INSTRUCTION returned by ZwQueryDirectoryFile()
- Previous by thread: Re: Highly responsive serial port
- Next by thread: Re: Highly responsive serial port
- Index(es):
Relevant Pages
|