Atmel Xplained Pro Evaluation Kit for the ATSAMD21J18A Microcontroller ATSAMD21-XPRO ATSAMD21-XPRO Fiche De Données

Codes de produits
ATSAMD21-XPRO
Page de 1018
881
Atmel | SMART SAM D21 [DATASHEET]
Atmel-42181C–SAM-D21_Datasheet–07/2014
33.7 Additional Features
33.7.1 DMA Operation
Not applicable.
33.7.2 Interrupts
The peripheral has the following interrupt sources:
z
Comparator (COMPx): this is an asynchronous interrupt and can be used to wake-up the device from any sleep 
mode.
z
Window (WINx): this is an asynchronous interrupt and can be used to wake-up the device from any sleep mode.
Comparator interrupts are generated based on the conditions selected by the Interrupt Selection bit group in the 
Comparator Control registers (COMPCTRLx.INTSEL). Window interrupts are generated based on the conditions 
selected by the Window Interrupt Selection bit group in the Window Control register (WINCTRL.WINTSEL[1:0]).
Each interrupt source has an interrupt flag associated with it. The interrupt flag in the Interrupt Flag Status and Clear 
register (INTFLAG) is set when the interrupt condition occurs. Each interrupt can be individually enabled by writing a one 
to the corresponding bit in the Interrupt Enable Set register (INTENSET), and disabled by writing a one to the 
corresponding bit in the Interrupt Enable Clear register (INTENCLR). An interrupt request is generated when the interrupt 
flag is set and the corresponding interrupt is enabled. The interrupt request remains active until the interrupt flag is 
cleared, the interrupt is disabled or the peripheral is reset. An interrupt flag is cleared by writing a one to the 
corresponding bit in the INTFLAG register. 
Each peripheral can have one interrupt request line per interrupt source or one common interrupt request line for all the 
interrupt sources. If the peripheral has one common interrupt request line for all the interrupt sources, the user must read 
the INTFLAG register to determine which interrupt condition is present.
For details on clearing interrupt flags, refer to the INTFLAG register description.
Note that interrupts must be globally enabled for interrupt requests to be generated. Refer to 
33.7.3 Events
The peripheral can generate the following output events:
z
Comparator: COMPEO0, COMPEO1(EVCTRL)
z
Window: WINEO0(EVCTRL)
Output events must be enabled to be generated. Writing a one to an Event Output bit in the Event Control register 
(EVCTRL.COMPEOx) enables the corresponding output event. Writing a zero to this bit disables the corresponding 
output event. The events must be correctly routed in the Event System. Refer to 
for details.
The peripheral can take the following actions on an input event:
z
Single-shot measurement
z
Single-shot measurement in window mode
Input events must be enabled for the corresponding action to be taken on any input event. Writing a one to an Event 
Input bit in the Event Control register (EVCTRL.COMPEIx) enables the corresponding action on input event. Writing a 
zero to a bit disables the corresponding action on input event. Note that if several events are connected to the peripheral, 
the enabled action will be taken on any of the incoming events. The events must be correctly routed in the Event System. 
Refer to 
 for details.
When EVCTRL.COMPEIx is one, the event will start a comparison on COMPx after the start-up time delay. In normal 
mode, each comparator responds to its corresponding input event independently. For a pair of comparators in window 
mode, either comparator event will trigger a comparison on both comparators simultaneously.