English
Language : 

SAM4L Datasheet, PDF (968/1185 Pages) ATMEL Corporation – ATSAM ARM-based Flash MCU
ATSAM4L4/L2
Corresponding peripheral events and interrupts are generated if enabled. No new comparisons
will be performed.
37.6.1.4
Selecting Comparator Inputs
Each Analog Comparator has one positive (INP) and one negative (INN) input. The positive
input is fed from an external input pin (ACAPx, ACBPx).
There are several sources for negative input including external input pin ACA/BNx. The Negative
Input Select field (CONFx.INSELN) selects the source for the negative input. See
CONFx.INSELN: Negative Input Select table in Module Configuration section.
Note that in window mode, the negative input ACANx and positive input ACBPx+1 must have
the same source, as shown in Figure 37-2.
37.6.2
Interrupt Generation
The ACIFC has several interrupt sources. The status of each interrupt source can be read from
the Interrupt Status Register (ISR). An interrupt request will be generated if a bit in ISR and the
corresponding bit in the Interrupt Mask Register (IMR) are set. Bits in IMR are set by writing a
one to the corresponding bit in the Interrupt Enable Register (IER), and cleared by writing a one
to the corresponding bit in the Interrupt Disable Register (IDR). The interrupt request remains
active until the corresponding bit in ISR is cleared by writing a one to the corresponding bit in the
Interrupt Status Clear Register (ICR).
The interrupt sources are ORed together to form one interrupt request. The ACIFC will generate
an interrupt request if at least one the bits in IMR is set. Because all the interrupt sources are
ORed togheter, the interrupt request from the ACIFC will remain active utnil all the bits in ISR are
cleared.
37.6.3
Peripheral Event Generation
The ACIFC can be set up so that certain comparison results notify other parts of the device via
the Peripheral Event system. Refer to Section 37.6.4.3 and Section 37.6.5.3 for information on
which comparison results can generate peripheral events, and how to configure the ACIFC to
achieve this.
Zero or one peripheral event will be generated per comparison.
37.6.4
Normal Mode
In normal mode all Analog Comparators are operating independently.
37.6.4.1
Normal Mode Output
Each Analog Comparator generates one output ACOUT according to the input voltages on INP
(AC positive input) and INN (AC negative input):
• ACOUT = 1 if VINP > VINN
• ACOUT = 0 if VINP < VINN
• ACOUT = 0 if the AC output is not available (SR.ACRDY = 0)
The output can optionally be filtered, as described in Section 37.6.6.
37.6.4.2
Normal Mode Interrupt
There are two types of interrupt for each AC:
42023C–SAM–02/2013
968