Download User Manual - EAGLE Technology

Transcript
EDR Software Development Kit
Interrupt functions
board when it has completed a conversion even if the board can generate
several other interrupts. Counter timer (or digital IO) generated interrupts
are handled by adding the counter timer channel number (or DIO port
number) to the base interrupt ID. Figure 14 lists the interrupt ID's for the
PC14B interrupts. The demo programs FREQCNT and EXTINT show how
to install ISRs for counter/timer and external interrupts.
PC30Fxx/Gxx Interrupt source
ID number
Some boards (such as the
End
of
A/D
conversion
EDR_INT_ADIN
PC30Fxx and PC30Gxx) allow the
End of DMA block (TC)
EDR_INT_TC
source of interrupts to be set from
Counter/timer pulse
EDR_INT_COUNTER
software. To use this feature from
Do not generate interrupts
-1
EDR call
Figure 15. PC30Fxx/Gxx interrupt
EDR_SetInterruptSource (16.8)
sources
with an interrupt ID corresponding
to the interrupt type you want to receive. Figure 15 lists interrupt ID’s and
types.
DOS: Generally the only thing you should do in an ISR is update global
variables. You should not call any DOS functions (this includes runtime
library functions that call DOS) from within the ISR unless you really know
what you are doing. You can call most EDR functions safely. Do not call
any EDR functions that do disk access as these functions use DOS.
Windows: Any interrupt handlers installed by these functions must be in a
fixed code segment. The easiest way to do this is to put the ISR in a fixed
code segment in a DLL. Note that interrupt latencies for interrupts handled
in this way (ring 3) may exceed 1 millisecond. The interrupt service routines
built in to EDR are in a VxD (EDRVXD.386) mainly to reduce this latency
time.
Windows: Also remember that the only Windows API function you can
safely call from an ISR is PostMessage. You can call most EDR functions
except those that do disk access. If you are using the PC73A you should
turn off all sampling delays as explained in EDR_SetADNoDelay (9.48).
EDR does a PeekMessage loop if it has to delay for a while. This causes
Windows to crash if done from an ISR.
177