![](http://datasheet.mmic.net.cn/100000/IF180C52TXXX-20R_datasheet_3493957/IF180C52TXXX-20R_629.png)
629
32099I–01/2012
AT32UC3L016/32/64
27.6.5.3
Window Mode Peripheral Events
When operating in window mode, each channel can generate the same peripheral events as in
Additionally, when channels operate in window mode, programming Window Mode Event Selec-
tion Source (CONFWn.WEVSRC) can cause peripheral events to be generated when:
As soon as the common input voltage is inside the window.
As soon as the common input voltage is outside the window.
On toggle of the window compare output (ACWOUT)
Whenever a comparison is ready and the common input voltage is inside the window.
Whenever a comparison is ready and the common input voltage is outside the window.
When the comparison in both channels in the window pair is ready.
27.6.6
Filtering
The output of the comparator can be filtered to reduce noise. The filter length is determined by
the Filter Length field in the CONFn register (CONFn.FLEN). The filter samples the Analog
Comparator output at the GCLK frequency for 2
CONFn.FLEN samples. A separate counter (CNT)
counts the number of cycles the AC output was one. This filter is deactivated if CONFn.FLEN
equals 0.
If the filter is enabled, the Hysteresis Value field HYS in the CONFn register (CONFn.HYS) can
be used to define a hysteresis value. The hysteresis value should be chosen so that:
The filter function is defined by:
FLEN measurements are sampled. If the num-
ber of measurements that are zero is less than (2FLEN/2 - HYS), the filtered result is zero. If the
number of measurements that are one is more than (2
FLEN/2 + HYS), the filtered result is one.
Otherwise, the result is unchanged.
2FLEN
2
----------------
HYS
>
CNT
2FLEN
2
----------------
HYS
+
comp
≥
1
=
2FLEN
2
----------------
HYS
+
CNT 2
FLEN
2
----------------
H
– YS
≥
>
comp unchanged
CNT
2FLEN
2
---------------- H
– YS
comp
<
0
=