« Close

Datasheets and User Guides

App Notes

Software & Driver


13.1.13 Conditional Reset

Capable DIO: FIO0, FIO2, FIO3, FIO4, FIO5

Requires Clock Source: No

Index: 12

DIO_EF Conditional Reset will reset a specified DIO_EF after a specified number of edges have been detected.

To set up a DIO_EF Conditional Reset is simple. Just set the DIO number of the DIO_EF you would like to reset and then set the other options. More options are likely to be added, so be sure to leave unused bits cleared to zero.
DIO#_EF_ENABLE: 0 = Disable, 1 = Enable
DIO#_EF_OPTIONS: Not used.
DIO#_EF_CONFIG_A: Reset Options bitmask:
  • bit 0: Edge select. 1 = rising, 0 = falling
  • bit 1: reserved
  • bit 2: OneShot. 1 = only reset once. 0 = reset every n edges.
DIO#_EF_CONFIG_B: Number of edges per reset.
DIO#_EF_CONFIG_C: IO number of DIO_EF to be reset.
DIO#_EF_CONFIG_D: Not used.

No update operations can be performed on Conditional Reset.

DIO#_EF_READ_A – Returns the current count.
DIO#_EF_READ_B – Not Used.
DIO#_EF_READ_A_F – Not Used.

Stream Read:
All operations discussed in this section are supported in command-response mode.  In stream mode, you can read from the integer READ registers (A, B, A_AND_RESET), but as mentioned in the Stream Section those reads only return the lower 16 bits so you need to also use STREAM_DATA_CAPTURE_16 in the scan list to get the upper 16 bits.

This example assumes that DIO0 has a running extended feature such as quadrature or a counter. Now we will set up DIO2 as a falling edge trigger that will reset the count of DIO0_EF.

DIO2_EF_ENABLE = 0 // Ensure that the DIO_EF is not running so that it can be configured.
DIO2_EF_INDEX = 12 // Set to Conditional Reset
DIO2_EF_CONFIG_A = 0 // Falling edges
DIO2_EF_CONFIG_B = 1 // Reset every edges
DIO2_EF_CONFIG_C = 0 // Reset events clear the count of DIO0_EF
DIO2_EF_ENABLE = 1 // Turn on the DIO_EF

Now falling edges on DIO2 will set the count of DIO0_EF to zero.