
## 10.2  SERIAL PORT REGULAR INTERRUPT

If your application will have a spare serial port to play with, it can
generate
a regular interrupt using the Transmit interrupt facility on the serial
chip
(known as a UART, for Universal Asynchronous Receiver/Transmitter).  There
are
other ways to make the UART generate interrupts, but the Transmit
interrupt is
easiest to use.

UARTs usually drive IRQ4 and IRQ3.  These interrupts are reserved for COM1
and
COM2 respectively.  When COM3 and COM4 are present, they sometimes 'share'
IRQ4
and IRQ3 respectively, with COM1 and COM2, but this 'sharing' only works
if the
ports are not used simultaneously (except on MicroChannel machines and
possibly
on EISA machines, where proper interrupt sharing is possible with the
right
software support).  In some cases, the otherwise spare interrupt lines,
such as
IRQ5 and IRQ2/9, are used for COM3 and COM4.




The baud rate divisor is chosen as 115200 divided by the baud rate.  For
example if a baud rate of 9600 bits per second is required, the divisor
value
is 115200/9600, which is 12.  Both lobyte and hibyte must be programmed.
The
DLAB must be set prior to writing the divisor, and turned off afterwards.



The serial port interrupt must be enabled on the PIC for interrupt driven
operation (see section  6.10 for details).


The pentium has as instruction to produce a CPU-speed resolution 64 bit
timestamp.






## 10.3.3  EXTERNAL INTERRUPT THROUGH SOUND CARD

Sound cards such as the Sound Blaster can most probably generate periodic
interrupts, though these are usually used for some purpose related to
sound
generation, not for timing in the general sense.  I haven't investigated
this
one.  Get a technical reference such as the Sound Blaster Freedom project
if
you want to try this.





Some video cards (notably EGA cards) are able to generate a vertical
retrace
interrupt themselves, usually on IRQ2/9, but this facility is not standard
on
VGA cards.  The vertical retrace interrupt can be simulated using CTC
channel 0.

