SAM L10/L11 External Interrupt Controller (EIC)

External Interrupt Controller (EIC)

Overview

The External Interrupt Controller (EIC) allows external pins to be configured as interrupt lines. Each interrupt line can be individually masked and can generate an interrupt on rising, falling, or both edges, or on high or low levels. Each external pin has a configurable filter to remove spikes. Each external pin can also be configured to be asynchronous in order to wake up the device from Sleep modes where all clocks have been disabled. External pins can also generate an event. Each external pin can be defined as secured or non-secured, where secured pins can only be handled by secure accesses. A separate non-maskable interrupt (NMI) is also supported. It has properties similar to the other external interrupts but is connected to the NMI request of the CPU, enabling it to interrupt any other Interrupt mode.

Features

  • Up to eight external pins (EXTINTx), plus one non-maskable pin (NMI)
  • Dedicated, individually maskable interrupt for each pin
  • Interrupt on rising, falling, or both edges
  • Synchronous or asynchronous edge detection mode
  • Interrupt pin debouncing
  • Interrupt on high or low levels
  • Asynchronous interrupts for Sleep modes without clocks
  • Filtering of external pins
  • Event generation from EXTINTx
  • Selectable secured or non-secured attribution for each individual external pin (SAM L11)

Block Diagram

saml10-external-interrupt-controller.png

Principle of Operation

There are several interrupt request lines, at least one for the external interrupts (EXTINT) and one for Non-Maskable Interrupt (NMI). The EXTINT interrupt request line is connected to the interrupt controller. Using the EIC interrupt requires the interrupt controller to be configured first. The NMI interrupt request line is also connected to the interrupt controller but does not require the interrupt to be configured. The events are connected to the Event System. Using the events requires the Event System to be configured first.

The EIC detects edge or level condition to generate interrupts to the CPU interrupt controller or events to the Event System. Each external interrupt pin (EXTINT) can be filtered using majority vote filtering, clocked by GCLK_EIC or by CLK_ULP32K.

The EIC is enabled by writing a '1' to the Enable bit in the Control A register (CTRLA.ENABLE). The EIC is disabled by writing CTRLA.ENABLE to '0'. The EIC is reset by setting the Software Reset bit in the Control register (CTRLA.SWRST). All registers in the EIC will be reset to their initial state, and the EIC will be disabled.

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 register (NMICTRL)
  3. Enable GCLK_EIC or CLK_ULP32K when one of the following configuration is selected:
    • the NMI uses edge detection or filtering
    • one EXTINT uses filtering
    • one EXTINT uses synchronous edge detection
    • one EXTINT uses debouncing
  4. Configure the EIC input sense and filtering by writing the Configuration n register (CONFIG).
  5. Optionally, enable the Asynchronous mode.
  6. Optionally, enable the Debouncer mode.
  7. Enable the EIC by writing a ‘1’ to CTRLA.ENABLE.

GCLK_EIC is used when a frequency higher than 32 kHz is required for filtering. CLK_ULP32K is recommended when power consumption is the priority. For CLK_ULP32K write a '1' to the Clock Selection bit in the Control A register (CTRLA.CKSEL).


The following bits are enable-protected, meaning that it can only be written when the EIC is disabled (CTRLA.ENABLE=0):

  • Clock Selection bit in Control A register (CTRLA.CKSEL)

The following registers are enable-protected:

  • Event Control register (EVCTRL)
  • Configuration n register (CONFIG)
  • External Interrupt Asynchronous Mode register (ASYNCH)
  • Debouncer Enable register (DEBOUNCEN)
  • Debounce Prescaler register (DPRESCALER)


Enable-protected bits in the CTRLA register can be written at the same time when setting CTRLA.ENABLE to '1', but not at the same time as CTRLA.ENABLE is being cleared. Enable-protection is denoted by the "Enable-Protected" property in the register description.

Refer to the "EIC – External Interrupt Controller" chapter from the product data sheet for more details.

SAM L10 Code Example

SAM L11 Code Example

© 2024 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.