Configurable Custom Logic (CCL) Setup

Each Lookup Table (LUT) in the CCL includes a filter that can be used to synchronize or filter the LUT output. The filter is by default clocked by the peripheral clock signal, but an alternative clock signal provided to the LUT on IN[2] can be used. By providing a suitable clock signal on IN[2] and the signal from a mechanical button on either IN[0] or IN[1], a single LUT can be used to filter glitches on the button signal that would otherwise cause unwanted behavior.

To configure a LUT for this purpose, its filter and alternative clock source features must be enabled.

The LUT inputs can be selected from a large number of different signals, among them two different event signals. For maximum flexibility in terms of sources for the button and clock signal, the two event signals may be selected as inputs. One of the event inputs must be assigned to IN[2] to be used as an alternative clock signal. The other event signal may be assigned to one of the two remaining inputs, while the unused input may be configured as Masked.

Since IN[2] will be masked as well when the alternative clock feature is enabled, only the input selected for the button signal needs to be considered when configuring the TRUTH register of the LUT. The LUT output may be high as long as the button is pressed. For instance, if the button signal is active-high and available on IN[1], the TRUTH register may be set to 4. If the button signal is active-low, which is the case for many evaluation kits, the TRUTH register may be set to 1.

Complete the CCL setup by enabling the LUT and the CCL.

Signals from I/O pins and/or other peripherals can be selected as LUT inputs instead of event signals, if required by the application.