13.07.2015 Views

Data Acquisition

Data Acquisition

Data Acquisition

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Using the internal oscillator or bus clock, this mode can be used to generate a negativepulse on the external output after a programmable time from an external trigger. Table D.5Summary of the functions of the gate inputsD.6 Interrupt handlingEach timer/counter maybe configured to generate interrupt requests (IRQs) to the hostcomputer. It is the same, in principle, as using any other device to generate PC interrupts:• Program the counter and perform any other setup that has to be done• Save the state (enabled or disabled) of the selected interrupt level on the PCsystem board and then disable it• Save the old interrupt vector and install a new one that will point to theinterrupt service routine that will service the timer interrupts• Enable the interrupt level in the PC’s interrupt controllerNow the software can continue with other tasks. The interrupt service routine must:• Do whatever processing it needs to do• Either chain another interrupt-routine if the interrupt line is being shared, orwrite an end-of-interrupt command to the PC system board interrupt controllerTo clean up the interrupts after using them:• Disable the interrupt level• Restore the interrupt vector to what it was before• Restore the interrupt level to its previous stateNote that some timer/counter modes are more suitable for generating interrupts (forexample, mode 0) than others.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!