4. Interfacing to the world 48
modules.
Warning
The debouncing lter adds a delay to the signal chain, starting from the instant
when it has actually become stable, as long as the selected sampling time (see
Figure 4.6). The debounce time can be set between 0 (debouncing disabled)
and 65 535 µs, with a 1 µs granularity.
Figure 4.6: Time diagram of the debouncing lter
The debouncing module is independently available for all input lines and can be programmed with a
different delay for each one of them.
Warning
When using the debouncing module, it is important to set a debounce time just
longer than the maximum expected instability time of the input signal: setting
shorter times might prevent ltering unwanted spurious transitions, while us-
ing longer times may cause missed detection of valid transitions.
4.3.1.2 Input events
NECTA input modules detect and log input events (raising and falling edges) occurring to any input port;
the event logging allows easy detection of changes in input signals, avoiding continuous input polling.
Rising and Falling events can be individually read; reading an event ag immediately resets its status.
This allows you to check if any input status transition has occurred since the last event ag reading.
The following code source reads the event ags bound to input port 1:
Example Code 4.2 | Input Change Event
bool riseEvent = device.PIOPorts[1].RisingEvent;
bool fallEvent = device.PIOPorts[1].FallingEvent;