![background image](http://html.mh-extra.com/html/conrad/c-control-pro-mega-series/c-control-pro-mega-series_manual_2654183138.webp)
129
C-Control Pro Mega Series
© 2008 Conrad Electronic
6.3
Analog-Comparator
The Analog Comparator allows to compare two analog signals. The result of this comparison is returned
as either "0" or "1".
6.3.1
AComp
AComp Functions
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:
0x00
external inputs (+)AIN0 and (-)AIN1 are used
0x40
external Input (-)AIN1and internal reference voltage are used
0x80
Analog-Comparator gets disabled
6.3.2
AComp Example
Example: Usage of Analog-Comparators
// AComp: Analog Comparator
// Mega32: Input (+) PB2 (PortB.2) bzw. band gap reference 1,22V
// Input (-) PB3 (PortB.3)
// Mega128: Input (+) PE2 (PortE.2) bzw. band gap reference 1,22V
// Input (-) PE3 (PortE.3)
// used Library: IntFunc_Lib.cc
// The function AComp returns the value of the comparator.
// If the voltage on input PB2/PE2 is greater than the input PB3/PE3 the
// function AComp returns the value 1.
// Mode:
// 0x00 external inputs (+)AIN0 and (-)AIN1 are used
Summary of Contents for C-Control Pro Mega Series
Page 1: ... 2008 Conrad Electronic C Control Pro Mega Series ...
Page 9: ...VIII Inhalt 2008 Conrad Electronic ...
Page 10: ...Part 1 ...
Page 17: ...Part 2 ...
Page 23: ...Part 3 ...
Page 41: ...32 Hardware 2008 Conrad Electronic 3 3 5 3 Component Parts Plan ...
Page 57: ...48 Hardware 2008 Conrad Electronic 3 4 5 3 Component Parts Plan ...
Page 58: ...Part 4 ...
Page 91: ...82 IDE 2008 Conrad Electronic ...
Page 92: ...Part 5 ...
Page 135: ...126 Compiler 2008 Conrad Electronic 31 1F US 63 3F 95 5F _ 127 7F DEL ...
Page 136: ...Part 6 ...
Page 231: ...Part 7 ...
Page 240: ......