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
Содержание C-Control Pro Mega Series
Страница 1: ... 2008 Conrad Electronic C Control Pro Mega Series ...
Страница 9: ...VIII Inhalt 2008 Conrad Electronic ...
Страница 10: ...Part 1 ...
Страница 17: ...Part 2 ...
Страница 23: ...Part 3 ...
Страница 41: ...32 Hardware 2008 Conrad Electronic 3 3 5 3 Component Parts Plan ...
Страница 57: ...48 Hardware 2008 Conrad Electronic 3 4 5 3 Component Parts Plan ...
Страница 58: ...Part 4 ...
Страница 91: ...82 IDE 2008 Conrad Electronic ...
Страница 92: ...Part 5 ...
Страница 135: ...126 Compiler 2008 Conrad Electronic 31 1F US 63 3F 95 5F _ 127 7F DEL ...
Страница 136: ...Part 6 ...
Страница 231: ...Part 7 ...
Страница 240: ......