Cipriano Patrik wrote:
How can I increase it to 500usec?
This would be enough accurate for me.
I don’t think you’re hearing what is being said.
The problem is a function of the PC hardware and has nothing
to do with the operating system. In order to get precise 1ms
timing you must use a different interrupt source (on the PC
this usually means using the RTC interrupt).
There is no way that any OS can provide “precise” 1ms timing
on the PC without using the RTC interrupt, or some sort of
external timer interrupt. Often the PC value is close enough
for many applications (e.g. if you require 2x oversampling of
a 500hz signal, then the fact that your sampling is a tiny bit
faster than 1Khz usually isn’t a problem).
Remember that Venturcoms’ solution is not Posix compliant hence
the semantics of the synthetic timer are up to Venturecom;
perhaps they decided that it was OK if you got called before
the time expired (i.e. they decided on your behalf that the PC
timer was “close enough” to 1Khz ?) This might be OK for an OS
that only runs on PC’s (and where 1ms is actually considered to
be a short period), but QNX (where 1ms is a long time) and Posix
are intended to be a architecture neutral solution (isn’t that a
requirement for portability ?).
Since you don’t seem to be adverse to tying yourself to the PC
architecture, I have attached source for using the RTC on a PC