25.4.1 Initialization

The EIC must be initialized in the following order:

  1. Enable CLK_EIC_APB.
  2. If required, configure the NMI by writing the Non-Maskable Interrupt Control (NMICTRL) register.
  3. Enable GCLK_EIC or CLK_OSC32K when one of the following configurations is selected:
    • The NMI uses edge detection or filtering
    • One or more EXTINT uses filtering
    • One or more EXTINT uses edge detection

    GCLK_EIC is used when a frequency higher than 32.768 kHz is required for filtering.

    CLK_OSC32K is recommended when the power consumption is the priority. For CLK_OSC32K, write a ‘1’ to the Clock Selection (CKSEL) bit in the Control A (CTRLA) register.

  4. Configure the EIC input sense and filtering by writing the Configuration (CONFIG0 or CONFIG1) register.
  5. Enable the EIC by writing a ‘1’ to the Enable (ENABLE) bit in the Control A (CTRLA) register.