« Close

Datasheets and User Guides

App Notes

Software & Driver

 

13.1.13 Conditional Reset

Overview

 

T4 Capable DIO: DIO4, DIO5, DIO6, DIO7, DIO8, DIO9 (aka FIO4, FIO5, FIO6, FIO7, EIO0, EIO1)

 

T7 Capable DIO: DIO0, DIO1, DIO2, DIO3, DIO6, DIO7 (aka FIO0, FIO1, FIO2, FIO3, FIO6, FIO7)

Requires Clock Source: No

Index: 12

Streamable: No

DIO-EF Conditional Reset will reset a specified DIO-EF after a specified number of edges have been detected.

Configure

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_INDEX: 12
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.

Update

No update operations can be performed on Conditional Reset.

Read

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

Example

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.