Event System (EVSYS) Setup

The application example uses the Event System to route the signals to and from the CCL for maximum flexibility. The button signal and a suitable clock signal must be routed to the event inputs of a LUT, while the output from this LUT must be routed to the ADC event input. Therefore, in this application the CCL will be both an event generator and an event user.

The event output from the Periodic Interrupt Timer (PIT) unit in the Real-Time Counter (RTC) is suitable as a clock signal, and by using it, other timer/counters on the device are kept available for other purposes. If the RTC clock is set to 32 kHz, a good starting point would be to select the PIT output event corresponding to dividing the RTC clock by 1024 as the source for one event channel. This might need to be modified depending on the characteristics of the button signal. The input event selected as IN[2] for the LUT may then be configured to be a user of this channel.

The I/O pin connected to the button may be configured as the event generator for a second event channel. The remaining available LUT input event may then be configured as a user of this channel. The I/O pin may also be configured as an input with its associated pull-up resistor enabled if there is no external pull-up resistor connected.

To trigger an ADC conversion from the filtered button signal, the LUT output may be configured as the generator for a third event channel, while the ADC may be configured as a user.