Digital I/O change detection

You can configure devices to transmit a data sample immediately whenever a monitored digital I/O pin changes state. IC (DIO Change Detect) is a bitmask that determines which digital I/O lines to monitor for a state change. If you set one or more bits in IC, the device transmits an I/O sample as soon it observes a state change on the monitored digital I/O line(s) using edge detection.

Change detection is only applicable to digital I/O pins that are configured as digital input (3) or digital output (4 or 5).

The figure below shows how I/O change detection can work in combination with Periodic I/O sampling to improve sampling accuracy. In the figure, the gray dashed lines with a dot on top represent samples taken from the monitored DIO line. The top graph shows only periodic IR samples, the bottom graph shows a combination of IR periodic samples and IC detected changes. In the top graph, the humps indicate that the sample was not taken at that exact moment and needed to wait for the next IR sample period.

Note Use caution when combining change detect sampling with sleep modesIC only causes a sample to be generated if a state change occurs during a wake period. If the device is sleeping when the digital transition occurs, then no change is detected and an I/O sample is not generated.
Use periodic sampling with IR in conjunction with IC in this instance, since IR generates an I/O sample upon wakeup and ensures that the change is properly observed.