Instructions

227 C-Control Pro IDE
© 2013 Conrad Electronic
5.3.2.1
AC_Disable
Analog Compare Functions Example
Syntax
void AC_Disable(byte ctrl);
Sub AC_Disable(ctrl As Byte);
Description
Turns the specified Analog Comparator off.
Parameter
ctrl Analog Comparator (0 - 1)
5.3.2.2 AC_Enable
Analog Compare Functions Example
Syntax
void AC_Enable(byte ctrl, byte in_pos, byte in_neg);
Sub AC_Enable(ctrl As Byte, in_pos As Byte, in_neg As Byte);
Description
Turns the Analog Comparator on. The Atmel AVR32 has 2 Analog Comparators. The table shows
which port inputs can be used for which comparator (Ctrl 0, Ctrl 1), and for what input parameter (in_pos or
in_neg). Only inputs on the same comparator can be compared, but both comparators can work on the
same time. A hysteresis of 0 is used.
Due to the used TQFP100 version of the processor, Analog Comparator 0 has fewer choices for
the selection of the input pins than Comparator 1.
Parameter
ctrl Analog Comparator (0 - 1)
in_pos Input V_ip
in_neg Input V_in
Table Analog Comparator Pin Selection
#define
Port
Value
Ctrl 0
Ctrl 1
AC_AC0AP0
P18
0
in_pos
-