Message-ID: <38CFF244.A29DDEDB@radar.mcgill.ca> From: Frederic Cazenave Organization: IRD (ex ORSTOM) X-Mailer: Mozilla 4.08 [en] (X11; I; IRIX64 6.1 IP26) MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp Subject: interrupt priority Content-Type: multipart/alternative; boundary="------------EA1AAB3F9AA6F964B6B1AB7B" Lines: 139 Date: Wed, 15 Mar 2000 20:27:05 GMT NNTP-Posting-Host: 132.206.246.96 X-Complaints-To: abuse AT mcgill DOT ca X-Trace: carnaval.risq.qc.ca 953152025 132.206.246.96 (Wed, 15 Mar 2000 15:27:05 EST) NNTP-Posting-Date: Wed, 15 Mar 2000 15:27:05 EST To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com --------------EA1AAB3F9AA6F964B6B1AB7B Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi, I have made a program with 2 interrupts actives sources, One is coming from a ADC ISA board on IRQ5 et the second one is coming from a DSP pci board on a interrupt on the second PIC (IRQ 13 in think). The ADC interrupt appears 6 time more often than the DSP one. At a frequency up to 300 hz for the ADC interrupt, it seems that a ADC interrupt occurs during the execution of the DSP interrupt routine but , I lose it cause of this lower priority. The code of the DSP interrupt is quite long. So I need to set the priority of the ADC interrupt higher than the DSP one. I have try to do than in two different ways : // in my main program outp(0x20,0xC2); // set IRQ2 to the lowest priority and // at the beginning of the DSP interrupt routine outp(0x20,68); // Set special mask mode outp(0x21,inp(0x21) | 0x02); // disable irq 2 on PIC 2 . . . . // and this at the end outp(0x20,0x48); // clear special mask mode outp(0x21,inp(0x21) & ~(0x02)); // restore the original mask if(Intnum > 7) { outp(0xA0, 0x60 + (Intnum - 8 )); /* reset PIC1 */ /* do this first */ outp(0x20, 0xE2); } else outp(0x20,0x60+Intnum); /* reset PIC0 */ Unfortunately, I lose always one of the ADC int. I use to _go32_dpmi_set_protected_mode_interrupt_vector to set my interrupt routines. Thanks in advance for your help Fred Cazenave -- _________________________________________________________ | | | Frederic CAZENAVE | | _/\_ /^= McGill Radar | | \_/ \// Box 198, MacDonald College | | | /-\ | Ste Anne de Bellevue | | || || Quebec, Canada H9X 3V9 | | Tel (514) 398 7733 fax (514) 398 7755 | | mailto:Frederic DOT Cazenave AT hmg DOT inpg DOT fr | | http://www.mpl.orstom.fr/hydrologie/catch/ | |__________________________________________________________| --------------EA1AAB3F9AA6F964B6B1AB7B Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit Hi,

I have made a program with 2 interrupts actives sources, One is coming
from a ADC ISA board on IRQ5 et the second one is coming from a DSP
pci board on a interrupt on the second PIC (IRQ 13 in think).
The ADC interrupt appears 6 time more often than the DSP one.
At a frequency up to 300 hz for the ADC interrupt, it seems that a ADC
interrupt occurs during the execution of the DSP interrupt routine but
, I lose it cause of this lower priority. The code of the DSP interrupt is
quite long. So I need to set  the priority of the ADC interrupt higher than
the DSP one.

I have try to do than in two different  ways :

// in my main program
  outp(0x20,0xC2); // set IRQ2 to the lowest priority

and

// at the beginning  of the DSP interrupt routine
   outp(0x20,68);                         // Set special mask mode
   outp(0x21,inp(0x21) | 0x02);  // disable irq 2 on PIC 2
    .
    .
    .
    .
// and this at the end
   outp(0x20,0x48);                            // clear special mask mode
   outp(0x21,inp(0x21) & ~(0x02));  // restore the original mask
   if(Intnum > 7) {
      outp(0xA0, 0x60 + (Intnum - 8 ));     /* reset PIC1 */ /* do this first */
      outp(0x20, 0xE2);
   }
   else
      outp(0x20,0x60+Intnum);                /* reset PIC0 */
 

Unfortunately, I lose always one of the ADC int.

I use to _go32_dpmi_set_protected_mode_interrupt_vector to set
my interrupt routines.

Thanks in advance for your help

Fred Cazenave

-- 
 _________________________________________________________
|                                                          |
|               Frederic CAZENAVE                          |
|    _/\_  /^=  McGill Radar                               |
| \_/    \//    Box 198, MacDonald College                 |
|   | /-\ |     Ste Anne de Bellevue                       |
|   ||   ||     Quebec, Canada   H9X 3V9                   |
|               Tel (514) 398 7733 fax (514) 398 7755      |
|               mailto:Frederic DOT Cazenave AT hmg DOT inpg DOT fr       |
|               http://www.mpl.orstom.fr/hydrologie/catch/ |
|__________________________________________________________|
  --------------EA1AAB3F9AA6F964B6B1AB7B--