Chapter 3
Programming Overview
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.
KT
x
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
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.
KT
x
Host
Causes a host interrupt by writing to the
host interrupt register of the ASIC
Checks the least significant bit of the status
register for a 1 to verify that the KT
x
generated the interrupt
Acts on the data
Acknowledges the interrupt by writing a 1
to the host_ack_of_ktx_int_reg register
Clears the least significant bit
of the status register
Issues an EOI to the PIC
Handling Host Interrupts