Owner's manual

Chapter 4: PowerDAQ Software
5
0
Digital Input Change-Of-State interrupts
One of the powerful features of the PowerDAQ DIO boards is an
ability to detect state change on any of the selected input line and
optionally interrupt the host PC when those conditions are detected.
The way this feature implemented guarantees minimum possible
response time for the digital input change – all unused time of the DSP
is dedicated to the state change detection process. Usually, the
minimum width of the detected signal is 1uS for all 128 lines and 0.2uS
for the 16 lines.
Change-of-state interrupt subsystem is represented to the used
software as a set of 16-bit arrays each of them has a eight entries
corresponding to the ports 0 through 7. Those arrays are Interrupt
Mask, Interrupt Data and Edge Data. Interrupt mask is only array
configured by the user. It should have one in every bit corresponding to
the input line, where user software is interested in getting interrupt
when this line changes its state. Interrupt Data array returns one for
every bit, which was not masked (0 in Interrupt Mask), and changes its
state since interrupts were enabled. Interrupt Edge array contains one
for the rising edge and zero for the falling edge, but only those bits
are valid that have a corresponding bit set to one in Interrupt Data
array.
Generally, interrupts are initialized in the following sequence
(driver/board initialization not included) :
Define direction of the I/O ports
Create Interrupt Mask array
Enable Interrupts
Wait for the interrupt
Every time, when interrupt is happens, read Interrupt Data/
Interrupt Edge arrays and re-enable interrupt
Stop this process, when required
pddi_evt.c example shows how to use this powerful feature.