English
Language : 

GPS140 Datasheet, PDF (30/38 Pages) List of Unclassifed Manufacturers – GPS Positioning Module
The second major concern when writing ISR's is to make them as short as possible in
term of execution time. Spending long times in interrupt service routines may mean
that other important interrupts are not serviced. Also, if you spend too long in your ISR,
it may be called again before you have exited. This will lead to your computer hanging
up and will require a reboot.
Your ISR should have the following structure:
• Push any processor registers used in your ISR. Most C compiler do this automatically
• Put the body of your routine here
• Clear the interrupt bit by reading GPS140HR RXD register
• Issue the EOI command to the 8259 by writing 20h to address 20h
• Pop all registers. Most C compilers do this automatically
The following C example shows what the shell of your ISR should be like:
/*-------------------------------------------------------------------------------
| Function: new_IRQ_handler
| Inputs:
Nothing
| Returns: Nothing
|-------------------------------------------------------------------------------*/
void interrupt far new_IRQ_handler(void)
{
IRQ_flag = 1;
// Indicate to main process interrupt has occurred
{
// Your program code to read UART data put here
// read to a data buffer for example:
Guc_buffer[Gi_bufpos++] = inp(gi_SERIAL_DATA);
}
outp(0x20, 0x20); // Acknowledge the interrupt controller
}
Saving the Startup Interrupt Mask Register (IMR) and interrupt vector
The next step after writing the ISR is to save the startup state of the interrupt mask
register (IMR) and the original interrupt vector you are using. The IMR is located in
address 21h. The interrupt vector you will be using is located in the interrupt vector
table which is an array of pointers (addresses) and it is locate din the first 1024 bytes
of the memory (Segment 0 offset 0). You can read this value directly, but it is better
practice to use DOS function 35h (get interrupt vector) to do this. Most C compilers
have a special function available for doing this. The vectors for the hardware interrupts
on the XT - bus are vectors 8-15., where IRQ0 uses vector 8 and IRQ7 uses vector 15.
Thus if your GPS140HR is using IRQ5 it corresponds to vector number 13.
GPS140HR
30
RTD Embedded Technologies, Inc.