strict time in ISP ?

Hi

How i can get a strict time in ISP (Interrupt Service Routine) ?

I can do that by proxy, but there are a little delay (10 - 30 ms) from
interrupt event to timestamp.
Of cource i can control that by priority of process, but that is not enough
(i have 9 processes in the system).

And in ISP it is not possible to use normal function calls
(for example qnx_get_clock()).

Is in QNX-kernel some counter or register, which can tell that ?


Esa

“Esa Heikkinen” <esa.heikkinen@insta.fi> wrote in message
news:96bdgi$d7e$1@tron.sci.fi

Hi

How i can get a strict time in ISP (Interrupt Service Routine) ?

I can do that by proxy, but there are a little delay (10 - 30 ms) from
interrupt event to timestamp.
Of cource i can control that by priority of process, but that is not
enough
(i have 9 processes in the system).

Can you ellaborate about all the processes in the system, including
priorities?
10-30ms is way too much - you can do that in the usec range. The process
that has the ISP should be set to highest priority. You need to set it to 31
(to be higher than the process manager) or change the process manager
priority for best results.


And in ISP it is not possible to use normal function calls
(for example qnx_get_clock()).
Is in QNX-kernel some counter or register, which can tell that ?

You should leave the ISP as soon as possible and does the rest in the
function that processes the proxy. This is by design.

Regards
Markus

Markus Loffler wrote in message <96bhvd$bs3$1@inn.qnx.com>…

“Esa Heikkinen” <> esa.heikkinen@insta.fi> > wrote in message
news:96bdgi$d7e$> 1@tron.sci.fi> …
Hi

How i can get a strict time in ISP (Interrupt Service Routine) ?

I can do that by proxy, but there are a little delay (10 - 30 ms) from
interrupt event to timestamp.
Of cource i can control that by priority of process, but that is not
enough
(i have 9 processes in the system).

Can you ellaborate about all the processes in the system, including
priorities?
10-30ms is way too much - you can do that in the usec range. The process
that has the ISP should be set to highest priority. You need to set it to
31
(to be higher than the process manager) or change the process manager
priority for best results.

I did set higher priority (24) and now it seems to work much better.
The delay is only 5 ms (max). That is maybe accetable in my system.

I use 1 milliseconds ticksize.



And in ISP it is not possible to use normal function calls
(for example qnx_get_clock()).
Is in QNX-kernel some counter or register, which can tell that ?

You should leave the ISP as soon as possible and does the rest in the
function that processes the proxy. This is by design.

Regards
Markus
\

Esa Heikkinen <esa.heikkinen@insta.fi> wrote:

Hi

How i can get a strict time in ISP (Interrupt Service Routine) ?

Usually called an ISR.

I can do that by proxy, but there are a little delay (10 - 30 ms) from
interrupt event to timestamp.
Of cource i can control that by priority of process, but that is not enough
(i have 9 processes in the system).

And in ISP it is not possible to use normal function calls
(for example qnx_get_clock()).

Is in QNX-kernel some counter or register, which can tell that ?

Yes, actually there is. You might want to grab

ftp.qnx.com:/usr/free/qnx4/os/utils/examples/Micro_time.tgz

This shows two ways of getting a timestamp – one from getting a far
pointer to the kernel’s time source, the other from accessing the
Pentium free-running counter using the rtdsc op-code.

But, as other people mention – doing as much as you can at process
time is a good idea, but even so… for accurate time stamps, you may
not want to use the qnx_get_clock() or related functions – they involve
a Send() to Proc for time, but instead you may want to directly access
the time.

(BTW, the usual abbreviation for code run at interrupt time is ISR…
ISP sounds too close to someone who provides an internet connection.)

-David


QNX Training Services
dagibbs@qnx.com

You should get better results than 5 ms. I’m running timers with up to
10KHz, hence, in 100usec the interrupt service routine is completed, the
proxy is send, the proxy is processed.
How do you measure the latency?
Are you saying that 9 processes are getting interrupts that way the same
time? How fast is your PC?
Markus


“Esa Heikkinen” <esa.heikkinen@insta.fi> wrote in message
news:96bj9b$j1o$1@tron.sci.fi

Markus Loffler wrote in message <96bhvd$bs3$> 1@inn.qnx.com> >…
“Esa Heikkinen” <> esa.heikkinen@insta.fi> > wrote in message
news:96bdgi$d7e$> 1@tron.sci.fi> …
Hi

How i can get a strict time in ISP (Interrupt Service Routine) ?

I can do that by proxy, but there are a little delay (10 - 30 ms) from
interrupt event to timestamp.
Of cource i can control that by priority of process, but that is not
enough
(i have 9 processes in the system).

Can you ellaborate about all the processes in the system, including
priorities?
10-30ms is way too much - you can do that in the usec range. The process
that has the ISP should be set to highest priority. You need to set it to
31
(to be higher than the process manager) or change the process manager
priority for best results.


I did set higher priority (24) and now it seems to work much better.
The delay is only 5 ms (max). That is maybe accetable in my system.

I use 1 milliseconds ticksize.




And in ISP it is not possible to use normal function calls
(for example qnx_get_clock()).
Is in QNX-kernel some counter or register, which can tell that ?

You should leave the ISP as soon as possible and does the rest in the
function that processes the proxy. This is by design.

Regards
Markus


\

Markus Loffler wrote in message <96bo3d$feu$1@inn.qnx.com>…

You should get better results than 5 ms. I’m running timers with up to
10KHz, hence, in 100usec the interrupt service routine is completed, the
proxy is send, the proxy is processed.
How do you measure the latency?

How much is ticksize in your system ?

Actually latency is about 2-4 ms.

By oscilloscope by two channel.
I have digital output -card and one bit sets
after receiving proxy (from ISR).


Are you saying that 9 processes are getting interrupts that way the same
time? How fast is your PC?

No all processes are needing interupts. Only 4 processes needs
interrupts
and not same time.

486/133MHz


Markus


“Esa Heikkinen” <> esa.heikkinen@insta.fi> > wrote in message
news:96bj9b$j1o$> 1@tron.sci.fi> …

Markus Loffler wrote in message <96bhvd$bs3$> 1@inn.qnx.com> >…
“Esa Heikkinen” <> esa.heikkinen@insta.fi> > wrote in message
news:96bdgi$d7e$> 1@tron.sci.fi> …
Hi

How i can get a strict time in ISP (Interrupt Service Routine) ?

I can do that by proxy, but there are a little delay (10 - 30 ms) from
interrupt event to timestamp.
Of cource i can control that by priority of process, but that is not
enough
(i have 9 processes in the system).

Can you ellaborate about all the processes in the system, including
priorities?
10-30ms is way too much - you can do that in the usec range. The process
that has the ISP should be set to highest priority. You need to set it
to
31
(to be higher than the process manager) or change the process manager
priority for best results.


I did set higher priority (24) and now it seems to work much better.
The delay is only 5 ms (max). That is maybe accetable in my system.

I use 1 milliseconds ticksize.




And in ISP it is not possible to use normal function calls
(for example qnx_get_clock()).
Is in QNX-kernel some counter or register, which can tell that ?

You should leave the ISP as soon as possible and does the rest in the
function that processes the proxy. This is by design.

Regards
Markus




\

Previously, Esa Heikkinen wrote in comp.os.qnx:

Markus Loffler wrote in message <96bo3d$feu$> 1@inn.qnx.com> >…
You should get better results than 5 ms. I’m running timers with up to
10KHz, hence, in 100usec the interrupt service routine is completed, the
proxy is send, the proxy is processed.
How do you measure the latency?

How much is ticksize in your system ?

Actually latency is about 2-4 ms.

By oscilloscope by two channel.
I have digital output -card and one bit sets
after receiving proxy (from ISR).

This seems odd. I’m working a QNX4 system with a 486/133 processor.
We’re handling data at 4-5KHz, with a fair amount of floating
point and processing required for each interrupt, and we’re
seeing solid ISR latency of around 25 us max, as measured on a
scope. Total ISR time is around 160 us.

We’re only using one interrupt for ourselves, and our ISR
process is running at priority 29 with Proc32 at priority
28.

[…]