[comp.sys.misc] Halp!?

ROsman%ASS%SwRI05@D26VS046A.CCF.SWRI.EDU (06/20/91)

I have a few problems that are nagging me, and I'm looking for
ideas.  I have a device that generates an interrupt every 300 +/-
5 milliseconds.

Okay, here's the code in question:

+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
=+=+=+=

void (_interrupt _far tite_handler (void))

{
/*
	Cycle the board through mode 3 to clear the pending in-
terrupt
	I should use card_off() here, but fear of stack check-
ing...
*/

access = inpw(ACCESS_REGISTER);
command_word = inpw (COMM_DATA_RAM);
outpw (CARD_CONFIG, 0x0310 );

_disable();

	/* and clear the Peripheral Interrupt Controller */

	if (pic_addr > LO_PIC_ADDR)
		 {
		 outp ( LO_PIC_ADDR , END_OF_INTERRUPT );
		 }

	outp ( PIC_EOI , END_OF_INTERRUPT );

_enable();

/*
access_flag indicates the number of unserviced interrupts. The
interrupt
service routine zeros it after service is complete.
*/

access_flag++;

}

+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=

I have two possibly related problems.

First, the output of this routine is checked in a do forever type
loop that checks "access_flag".  I'm doing this so I can safely
use library routines like printf.  When I print "access_flag"
from this loop, it's value is ALWAYS 2.  Interrupts from the card
being serviced are re-enabled at the end of the servicing code
just after the statement:

	access_flag = 0;


Second, when I use interrupt lines associated with PIC1 (irqs 5
and 7), the thing hangs without an interrupt occuring after five
or so interrupts.  If I use interrupt lines associated with PIC2
(irqs 10, 11, 12 and 14) the thing runs for thousands of cycles
(10,000 so far) without a hitch.

Watching the hardware with a 'scope indicates that the response
time is no more than 50 microseconds, and is usually less than 20.
The interrupt line transitions are clean and I see an edge ONLY
once every every 300 +/- 5 milliseconds.

The machine is 25 MHz EISA 486.

Thanks in advance for any help,

Rich Osman

Please reply to >INTERNET:Oz@SwRI.edu