English
Language : 

SAM4L Datasheet, PDF (967/1185 Pages) ATMEL Corporation – ATSAM ARM-based Flash MCU
ATSAM4L4/L2
mode, while others are in window mode. There are restrictions on which ACs can be grouped in
a window mode, see Section 37.6.5.
37.6.1
Analog Comparator Operation
Each AC can be in one of four measurement modes, determined by CONFx.MODE:
• No Measurement
• Continuous Measurement mode (CM)
• User Triggered Single Measurement mode (UT)
• Peripheral Event Triggered Single Measurement mode (ET)
An AC is disabled between measurements if the Always On bit in the corresponding CONFx reg-
ister (CONFx.ALWAYSON) is zero. This is the default value after reset. This reduces the AC
power dissipation between measurements, but the AC output will not be available until after an
AC startup time. If the ACx Ready bit in the Status Register (SR.ACRDYx) is one, the output of
ACx is ready. In window mode the result is available when both the comparator outputs are
ready (SR.ACRDYx=1 and SR.ACRDYx+1=1).
An AC is always enabled (i.e., during and between measurements) if the corresponding
CONFx.ALWAYSON bit is one. This allows a measurement on AC to be made quickly after a
measurement is triggered, without waiting for the AC startup time (except for the first startup
after reset).
37.6.1.1
Continuous Measurement Mode
In the CM mode, AC is performing comparisons continuously. Therefore the result of the latest
comparison is always available in the ACx Current Comparison Status bit in the Status Register
(SR.ACCSx). Comparisons result are updated on every positive edge of CLK_ACIFC.
CM is enabled by writing CONFx.MODE to one. When the corresponding AC is ready,
SR.ACRDYx is set and comparison status is reflected in SR.ACCSx.
Corresponding peripheral events and interrupts are generated if enabled. New comparisons are
performed continuously until the CONFx.MODE field is written to zero.
37.6.1.2
User Triggered Single Measurement Mode
In the UT mode, the user starts a single comparison by writing a one to the User Start Single
Comparison bit (CTRL.USTART).
This mode is enabled by writing CONFx.MODE to 2. Once the corresponding AC is ready, user
can start a single comparison then SR.ACCSx is updated accordingly. CTRL.USTART is
cleared automatically by hardware when the single comparison has been done.
Corresponding peripheral events and interrupts are generated if enabled.
37.6.1.3
Peripheral Event Triggered Single Measurement Mode
This mode is enabled by writing CONFx.MODE to 3 and the Peripheral Event Trigger Enable bit
in CTRL (CTRL.EVENTEN) to one. The ET mode is similar to the UT mode, the difference is that
a peripheral event from another hardware module causes the hardware to automatically set the
Peripheral Event Start Single Comparison bit (CTRL.ESTART). Once the corresponding AC is
ready, an event starts a single comparison then SR.ACCSx is updated accordingly.
CTRL.ESTART is cleared automatically by hardware when the single comparison has been
done.
42023C–SAM–02/2013
967