Instructions

225 C-Control Pro IDE
© 2013 Conrad Electronic
0
0
1
ADC Noise Reduction
0
1
0
Power-down
0
1
1
Power-save
1
0
0
Reserved
1
0
1
Reserved
1
1
0
Standby
1
1
1
Extended Standby
5.3 Analog-Comparator
5.3.1 Mega
The Analog Comparator allows to compare two analog signals. The result of this comparison is returned
as either "0" or "1". Voltages of between 0 and 5V can be compared at the positive and negative inputs.
5.3.1.1 AComp
AComp Functions Example
Syntax
void AComp(byte mode);
Sub AComp(mode As Byte);
Description
The Analog Comparator allows to compare two analog signals. The result of this comparison is returned
as either "0" or "1". ( Comparator Output ). The negative input is Mega32: AIN1 (PortB.3), Mega128: AIN1
(PortE.3). The positive input can either be Mega32: AIN0 (PortB.2), Mega128: AIN0 (PortE.2) , or an internal
reference voltage of 1,22V.
Parameter
mode working mode
Mode Values:
00 (Hex)
external inputs (+)AIN0 and (-)AIN1 are used
40 (Hex)
external Input (-)AIN1and internal reference voltage are used
80 (Hex)
Analog-Comparator gets disabled
5.3.1.2 AComp Example
Example: Usage of Analog-Comparators
// AComp: Analog Comparator