ClockPeriod

Hi,

The kernel call ClockPeriod() allow you to get or set the clock period
of the clockfunction. 500 micro seconds is the smallest clock period
that I can set on our PC. I need smaller clock periods. How can I set
smaller clock periods? Exists systems with smaller clock periods?

Stefan

Depending on you processor this may not be advisable.

with 500us that mean their will be 2000 interrupts per seconds.
if you go 100us, you will get 10000 interrupts per seconds…

“Stefan Lankes” <stefan@lfbs.rwth-aachen.de> wrote in message
news:39E5E066.B16F0D05@lfbs.rwth-aachen.de

Hi,

The kernel call ClockPeriod() allow you to get or set the clock period
of the clockfunction. 500 micro seconds is the smallest clock period
that I can set on our PC. I need smaller clock periods. How can I set
smaller clock periods? Exists systems with smaller clock periods?

Stefan

Mario Charest wrote:

Depending on you processor this may not be advisable.

with 500us that mean their will be 2000 interrupts per seconds.
if you go 100us, you will get 10000 interrupts per seconds…

On a Linux system you can reach with the rtc device 8192 interrupts per
second. Why can I not reach 8192 interrupte per second on a QNX system.

Stefan

Stefan Lankes wrote:

Mario Charest wrote:

Depending on you processor this may not be advisable.

with 500us that mean their will be 2000 interrupts per seconds.
if you go 100us, you will get 10000 interrupts per seconds…


On a Linux system you can reach with the rtc device 8192 interrupts per
second. Why can I not reach 8192 interrupte per second on a QNX system.

You are misunderstanding the semantic of clockPeriod(). ClockPeriod()
defines the
time resolution of timer services. The period of the clock is by default
10ms … that
means a delay(1) call produces a delay of 1 to 10ms.
A delay(1) with a clock period with 500us will take 1ms to 1.5ms … so
only the
time resolution is just ‘better’.

If you will need an interrupt source with 10000 ticks/s or more … use
the Real-Time-Clock (IRQ8).

Armin

http://www.steinhoff.de

Stefan Lankes <stefan@lfbs.rwth-aachen.de> wrote:

The kernel call ClockPeriod() allow you to get or set the clock period
of the clockfunction. 500 micro seconds is the smallest clock period
that I can set on our PC. I need smaller clock periods. How can I set
smaller clock periods? Exists systems with smaller clock periods?

As Armin pointed out, this is the resolution of timer services (though
the default is different from what he said - 1ms if the CPU frequency
is greater than 40MHz, 10ms otherwise (what he said was correct for
Neutrino 2.0, but we changed it for this version)). The kernel arbitrarily
limits the low end to 500us. Can you tell us why you need it faster?


Brian Stecher (bstecher@qnx.com) QNX Software Systems, Ltd.
phone: +1 (613) 591-0931 (voice) 175 Terence Matthews Cr.
+1 (613) 591-3579 (fax) Kanata, Ontario, Canada K2M 1W8