Create interrupt lines

The DAQ module supports up to seven concurrent input interrupt lines on D0-D3 and D5-D7. In order to mitigate the interrupt-processing latency of the .Net Micro Framework and the latency of SPI communications between the Netduino Go! and the DAQ module, the DAQ handles interrupts locally, independently of the Netduino Go! main board. The DAQ module tracks the interrupt counts and interrupt count roll-overs. Because interrupts are handled locally by the DAQ, tens of thousands of interrupts per second can be processed without losing data. This allows the application running on the main board to retrieve the interrupt counters at a much slower rate, without missing anything.

Configuring Digital Input Interrupt Lines

By default, all input interrupt lines are configured with 'Pull-Up' resistors, are triggered on the falling edge of the interrupt and have a roll-over limit set to 0xFFFFFFFF. Interrupt lines also support 'Pull-Down' resistors and can be triggered by a rising edge or when both edge types are detected. Refer to the the datasheet of the device connected to the interrupt line to determine the proper resistor type and edge detection configuration.

Handling interrupts

First, the application must register an event handler with the DAQ to receive interrupt notifications.

daq.Interrupts += new InterruptEventEventHandler(InterruptHandler);
Then, then application needs to start monitoring interrupts. It can do so in two ways:

Synchronously by calling PollInterruptCounters(); The rate at which polling for interrupt events takes place is at the discretion of the application.
Asynchronously by calling StartInterruptMonitor(); This starts a thread which calls PollInterruptCounters(); behind the scene and ends when StopInterruptMonitor(); is called. By default, StartInterruptMonitor() polls for interrupt events every 5ms and does not reset the interrupt counters after retrieving them. The sampling rate and resetting interrupt counters can be controlled at any time through the following DAQ properties:
InterruptCountersResetAfterReading
InterruptCountersSamplingPeriodMs
Changes to these properties are effective on the next scan.

Sample Output

...
Interrupt on Gpio:5, Count: 473, Rollover: 2
Interrupt on Gpio:5, Count: 480, Rollover: 2
Interrupt on Gpio:5, Count: 486, Rollover: 2
Interrupt on Gpio:5, Count: 492, Rollover: 2
Interrupt on Gpio:5, Count: 498, Rollover: 2
Interrupt on Gpio:5, Count: 8, Rollover: 3
Interrupt on Gpio:5, Count: 9, Rollover: 3
Interrupt on Gpio:5, Count: 27, Rollover: 3
Interrupt on Gpio:5, Count: 40, Rollover: 3
Interrupt on Gpio:5, Count: 41, Rollover: 3
...