How to tell if hardware interrupt procedure is re-activated before finished ? 
Author Message
 How to tell if hardware interrupt procedure is re-activated before finished ?

I'm aquiring data from a data aquisition interface card at about 10Hz.
I'm using an external trigger source connected to the parallel port
ACK pin 10 to generate a hardware interrupt in order to detect when
the data needs to be transfered.  This works but I need to be able to
tell if the external trigger rate is too fast, i.e. if the next
trigger occurs before the interrupt procedure which is transfering the
data has had time to finish.  I tried telling the interrupt controller
(via port[$20] := $20) that the interrupt is finished as soon as the
procedure is entered so that hopefully that procedure would be called
again even though I was still inside it.  That did not seem to work:

procedure intr_7;
interrupt;
begin

if interrupt_active then
begin
 { trigger rate is too fast }
end;

interrupt_active := true;

{ tell interrupt controller that interupt is finished so that this
procedure could potentially be called again while still inside it }
port[$20] := $20;

{
  perform data transfer, etc here }

Quote:
}

interrupt_active := false;

{ typically "port[$20] := $20]" goes here }

end;

{ MAIN }
begin
interrupt_active := false;

{ install parallel port interrupt, etc }
end;



Wed, 18 Jun 1902 08:00:00 GMT  
 How to tell if hardware interrupt procedure is re-activated before finished ?

Quote:

>I'm aquiring data from a data aquisition interface card at about 10Hz.
>I'm using an external trigger source connected to the parallel port
>ACK pin 10 to generate a hardware interrupt in order to detect when
>the data needs to be transfered.  This works but I need to be able to
>tell if the external trigger rate is too fast, i.e. if the next
>trigger occurs before the interrupt procedure which is transfering the
>data has had time to finish.  I tried telling the interrupt controller
>(via port[$20] := $20) that the interrupt is finished as soon as the
>procedure is entered so that hopefully that procedure would be called
>again even though I was still inside it.  That did not seem to work:
>procedure intr_7;
>interrupt;
>begin
>if interrupt_active then
>begin
> { trigger rate is too fast }
>end;
>interrupt_active := true;

Upon further investigation, it seems that I need to enable interrupts
here with "asm sti; end;" to get this to work as I wish.  That seems
to enable ALL interrupts, including re-enabling this one (since it
then doesn't matter if the port[$20]:=$20 goes immediately here or at
the end of this procedure).  The port[$20]:=$20 does still have to be
done somewhere though for things to work.  But I thought
port[$20]:=$20 allowed THIS interrupt to be re-enabled.

Quote:
>{ tell interrupt controller that interupt is finished so that this
>procedure could potentially be called again while still inside it }
>port[$20] := $20;
>{
>  perform data transfer, etc here }
>}
>interrupt_active := false;
>{ typically "port[$20] := $20]" goes here }
>end;
>{ MAIN }
>begin
>interrupt_active := false;
>{ install parallel port interrupt, etc }
>end;





Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How to tell if hardware interrupt procedure is re-activated before finished ?

2. Writing a VXD or DLL for Hardware interrupts?

3. Does doing WRITELN to screen enable hardware interrupts?

4. Declare interrupt procedures in Object

5. DOS stacks and TP interrupt procedures

6. Interrupt procedure in assembler

7. Debugging an interrupt procedure

8. Interrupt Procedures in BP7.0 to work in Win95-DOS-box

9. How to use an interrupt procedure? BP7

10. How to declare Interrupt procedures within objects ?

11. How to activate Scroll, Caps and Num Lock

12. Handling Errors when activating a table.

 

 
Powered by phpBB® Forum Software