Handling Host Interrupts - Allen-Bradley 1784-KTX Reference Manual

Table of Contents

Advertisement

Chapter 3
Programming Overview

Handling Host Interrupts

3-4
To properly handle interrupts from the KTx, the host (in this example, an
IBM PC-compatible running DOS) must first install an interrupt service
routine (ISR) and enable the appropriate interrupt.
To install the interrupt service routine, first the hardware interrupt (0–15)
must be converted to a software interrupt number (0–7,0x70–0x78). Then
the address of the ISR must be written to the appropriate software interrupt
vector. Finally, the interrupt must be enabled by setting the appropriate bit
of the programmable interrupt controller (PIC) to a zero. This diagram
illustrates the steps required to install and enable interrupts in a DOS host.
KTx
In the interrupt service routine, the host should make sure that the interrupt
was generated by the KTx, act on the data, acknowledge the interrupt to the
KTx, and then issue an end-of-interrupt (EOI) to the PIC. This diagram
illustrates the steps that the ISR should implement.
KTx
Causes a host interrupt by writing to the
host interrupt register of the ASIC
Clears the least significant bit
of the status register
Host
Convert hardware interrupt number
to software interrupt number
Save the old interrupt vector
Set the new interrupt vector
Set the appropriate bit in the PIC to a zero
Host
Checks the least significant bit of the status
register for a 1 to verify that the KTx
generated the interrupt
Acts on the data
Acknowledges the interrupt by writing a 1
to the host_ack_of_ktx_int_reg register
Issues an EOI to the PIC

Advertisement

Table of Contents
loading

This manual is also suitable for:

1784-ktxd1784-kts

Table of Contents