IRQ 0 - Interrupt Handling

Hello everyone, here i am again,

well… my question of the day :wink:

Can i program an interrupt handler for IRQ 0 (Interrupt that the clock can
generate) ?

Why i need this? Well, as i’ve told before in other post, i’m porting some
programs from the old DOS that use this feature. And, i think that is a
faster and easier way to do some tests with interrupt handling.

If so, can anyone send me an example?

I’ve done a lot of sucessful tests using timer (Thanks to Rob again), and
now i want the timer to generate an interrupt for my tests with interrupt
routines.

I’ve done some tests trying to InterruptAttach(IRQ0,…) but when i do this
the qnx stop responding and i have to restart the machine. Once again, sorry
for this dumb thing… RTOS is a new thing to me…


Thx
Leandro.

Leandro Colen <lcrocha@yahoo.com> wrote in article <aceskg$oh1$1@inn.qnx.com>…

Hello everyone, here i am again,

Hello,

well… my question of the day > :wink:

Can i program an interrupt handler for IRQ 0 (Interrupt that the clock can
generate) ?

Yes, you can. But I would not suggest to do it. You can write your handler and attach it to the
another ones (you aren’t one in this handling) by InterruptAttach(). Also, you can’t
“to drown” another ones as you can do it in DOS. Actually, you have nothing for this handler. If
you want to get periodically events - use InterruptAttachEvent().

Why i need this? Well, as i’ve told before in other post, i’m porting some
programs from the old DOS that use this feature.

Usualy DOS programs used INT 0x1c or INT 0x08 to take control every 55ms (handle IRQ 0 or to be in
long train of handlers). But you don’t need use it anymore in QNX. You have much more safe timers.

And, i think that is a
faster and easier way to do some tests with interrupt handling.

I don’t think you have chosen good interrupt line (IRQ 0) for interrupt handling tests :wink: Just
because this timer is used by OS to do all time related operations for you (except nanospin() which
uses CPU loops).

If so, can anyone send me an example?

I suggest you to find the example with ISR 8 handling:

From: Rennie Allen
Newsgroups: qdn.public.qnxrtp.os
Subject: Re: ISR about isr 8
Date: Fri, 11 Jan 2002 10:12:31 -0800
Xref: inn.qnx.com qdn.public.qnxrtp.os:6729

Or just read the documentation
http://qdn.qnx.com/support/docs/neutrino_2.11_en/prog/inthandler.html
I believe it’s best place for start if you want to program Interrupt Service Routines.

I’ve done a lot of sucessful tests using timer (Thanks to Rob again), and
now i want the timer to generate an interrupt for my tests with interrupt
routines.

You can use messages and pulses in QNX instead of users’ vectors and soft INT in DOS. Ideology of
DOS and QNX is quite different. You’re able to use all your DOS background but don’t copy
everything from one OS to another.

I’ve done some tests trying to InterruptAttach(IRQ0,…) but when i do this
the qnx stop responding and i have to restart the machine. Once again, sorry

I’m not surprised :wink:. The better is InterruptAttachEvent(). But I tell you once more, you don’t
want to do it.

Cheers,

Eduard.
ed1k at ukr dot net


for this dumb thing… RTOS is a new thing to me…


Thx
Leandro.
\

Hey ed1k,

Why i need this? Well, as i’ve told before in other post, i’m porting
some
programs from the old DOS that use this feature.

Usualy DOS programs used INT 0x1c or INT 0x08 to take control every 55ms
(handle IRQ 0 or to be in
long train of handlers). But you don’t need use it anymore in QNX. You
have much more safe timers.

The timers in QNX are very safe to do this kind of work right? Every
time-interval i need to gather some hardware information and make some
decisions… i CAN thrust in the timers right? That’s what i see until now.
A little thing… In my program i try to configure the timer to repeat every,
for example, 100ms, my osciloscope shows me that i’m getting an accuracy of
80 ms, when i try to use 1ms is see that this accuracy is 0.8ms.
I’ve set the thread priority to 63, just for minimize the interferece with
other programs, and do some tests using and QNX build image too (As is
explain in Programmers Guide Manual) and again i get this 20% difference…

What makes this 20% difference?


What i want to do now is to test the InterruptAttach routines. I’m trying to
simulate an Paralel Interrupt to see if my program is working well, but it’s
more complicated then just send a 5v signal to the ACK pin of the port.

So, i just want to see if my InterruptAttach code is working, how can i
simulate an Interrupt ?

I’ve done a lot of sucessful tests using timer (Thanks to Rob again),
and
now i want the timer to generate an interrupt for my tests with
interrupt
routines.

You can use messages and pulses in QNX instead of users’ vectors and soft
INT in DOS. Ideology of
DOS and QNX is quite different. You’re able to use all your DOS background
but don’t copy
everything from one OS to another.

Yes… That’s what i’m trying to do… Porting not just the code from DOS to
QNX, but adapting the code to work better!

Thanx
Leandro

P.S. I’m posting this message in the qdn.public.qnxrtp.os too … I think
that newsgroup is better to do this kind of questions and discussions. I
will stop posting this in this group (qdn.public.qnxrtp.devtools)

“Leandro Colen” <lcrocha@yahoo.com> wrote in message
news:acgb5c$rg1$1@inn.qnx.com

Hey ed1k,



Why i need this? Well, as i’ve told before in other post, i’m porting
some
programs from the old DOS that use this feature.

Usualy DOS programs used INT 0x1c or INT 0x08 to take control every 55ms
(handle IRQ 0 or to be in
long train of handlers). But you don’t need use it anymore in QNX. You
have much more safe timers.

The timers in QNX are very safe to do this kind of work right? Every
time-interval i need to gather some hardware information and make some
decisions… i CAN thrust in the timers right? That’s what i see until now.
A little thing… In my program i try to configure the timer to repeat
every,
for example, 100ms, my osciloscope shows me that i’m getting an accuracy
of
80 ms, when i try to use 1ms is see that this accuracy is 0.8ms.
I’ve set the thread priority to 63, just for minimize the interferece with
other programs, and do some tests using and QNX build image too (As is
explain in Programmers Guide Manual) and again i get this 20%
difference…

What makes this 20% difference?


What i want to do now is to test the InterruptAttach routines. I’m trying
to
simulate an Paralel Interrupt to see if my program is working well, but
it’s
more complicated then just send a 5v signal to the ACK pin of the port.

So, i just want to see if my InterruptAttach code is working, how can i
simulate an Interrupt ?

I’ve done a lot of sucessful tests using timer (Thanks to Rob again),
and
now i want the timer to generate an interrupt for my tests with
interrupt
routines.

You can use messages and pulses in QNX instead of users’ vectors and
soft
INT in DOS. Ideology of
DOS and QNX is quite different. You’re able to use all your DOS
background
but don’t copy
everything from one OS to another.

Yes… That’s what i’m trying to do… Porting not just the code from DOS
to
QNX, but adapting the code to work better!

Thanx
Leandro

P.S. I’m posting this message in the qdn.public.qnxrtp.os too … I think
that newsgroup is better to do this kind of questions and discussions. I
will stop posting this in this group (qdn.public.qnxrtp.devtools)

Re: ACK pin on parallel port

I’ve encountered some funny behavior using ISRs tied to pin 10 on the
parallel port, namely, that you may want to check your machine’s BIOS
settings and disable EPP/ECP (revert to SPP), and you may need to slay off
devc-par.

I use the ack line as a strobe and also use a scope to verify timings.
Running the ISR code at priority 24, my scope reports only microseconds
latency between the rising edge of the ACK signal and the receipt of the
pulse in the code. (I use D0 on the parallel port to output this
information.)

Harry Qualls,
Tree-D, Inc.