Lost Interrupts
Jeppe Vesterbaek
mail at jhv.dk
Fri Jan 23 12:21:59 CET 2004
Hi Stephen
First, to give an update on my problem: By using the latency_calibration
program supplied with RTAI, I learned that one of the laptops had a worst
case (maximum) latency of 8 us when no load on the network card and 15 us
when ping flooding the network, hence running with an interrupt frequency of
100 kHz would mean that some are lost. Thus the simple solution for me was
to lower my interrupt frequency to 50 kHz. Now, I experience no losses :).
And now to the PIC regrogramming. After I reprogrammed it, I most definately
saw an improment in the amount lost interrupts. A standard PC concists of
two PICs, each with 8 interrupt lines (this is of historic reasons: the old
ibm computers only had one). All interrupts on PIC 2 are cascaded into
interrupt line 2 on PIC1. For priorities this means that the timer (IRQ0)
has priority one, the keyboard (IRQ1) priority 2 and then all IRQs on PIC2,
i.e., IRQ8-IRQ15 has priorities 3-10. The bottom line is that our parallel
port on IRQ7 has the lowest priority. I've depected this here:
http://www.control.auc.dk/~jhve02/pic_before.jpg
The PIC1 can though be reprogrammed to give the parallel port the highest
priority. I did this by consulting the PIC datasheet (a copy is fould here:
http://ftp.penguinppc.org/users/hollis/8259A_PIC_Datasheet.pdf). If you look
at page 16, pay attention to the Specific rotation, this enables you to
change the priorities in the way, you'd like by setting a new bottom
priority (lowest priority), e.g. something like this:
http://www.control.auc.dk/~jhve02/pic_after.jpg
You can find the address of the pic1 by doing: cat /proc/ioports
Hope this helped you.
Also, when writing in this thread, I'd like to thank Paolo and Jan for their
replies.
Best Regards
Jeppe Vesterbaek
----- Original Message -----
From: "Stephen Trickey" <trickey at nrl.navy.mil>
To: <mail at jhv.dk>
Sent: Thursday, January 22, 2004 7:28 PM
Subject: Lost Interrupts
> Hi Jeppe:
>
> I saw your posting to the RTAI mail list. In it you mentioned that you
> reprogrammed the PIC to give the parallel port the highest priority at
> the PIC level. Can you explain how you did that? I have a daq
> application that works fine on an older desktop but doesn't work well on
> a newer laptop. Something is trumping the
rt_global_save_flags_and_cli()
> function of rtai and pushing around or corrupting data read from the
> parallel port. I was hoping that if I could figure out how to set the
> parallel port interupt priority that might help me.
>
> Regards-
> Stephen
>
>
> --
> Stephen Trickey, Ph.D.
> U.S. Naval Research Lab Mechanical Engineer
> Code 5673 trickey at nrl.navy.mil
> 4555 Overlook Ave SW phone: (202)767-2638
> Washington D.C. 20375 fax: (202)767-5792
>
>
>
More information about the Rtai
mailing list