Analog comparator is an electronic device which compares the two voltage signals and provides TTL logic output to indicate the larger signal. The analog [[wysiwyg_imageupload::]]comparator is used in various applications where two inputs signals need to be compared. IR sensor is a very common example where analog comparator is used.PIC18F4550 has two in-built comparators which can be used in eight different modes. These in-built comparators save the cost and connections for providing an extra IC (like LM324, LM339 etc) in the circuit. This article explains the configuration of the analog comparators of this PIC microcontroller.PIC18F4550 consists of two analog comparators and these comparators can be used in eight different modes. The analog comparators’ I/O pins are multiplexed with PortA pins (RA0 – RA5) pins of the controller. The register CMCON is configured to set the mode of the comparator in a PIC microcontroller. Read more to find how PIC’s analog comparator is used to make this circuit.
How to use inbuilt analog comparator of AVR microcontroller- (Part 29/46)
Analog comparator is a device which compares two input voltages and generates output accordingly. The article on IR sensor explains the use of comparator in [[wysiwyg_imageupload::]]sensor designing. Comparators form an integral part of circuit designing in majority of the applications. AVR microcontrollers have in-built analog comparator. Using the in-built analog comparator of AVR, the controller can be used to compare the signal and process the signal as well. This reduces the external comparator components on our circuits. In this article proximity sensor is designed using in-built analog comparator of ATmega16. The analog comparator needs two inputs positive and negative. The positive input is given on AIN0 (PB2) pin of controller. In ATmega16 nine pins are available to connect negative input of comparator. This means microcontroller can compare maximum of nine analog signals with one positive input voltage. Although, signals are not compared simultaneously but the time difference between two consecutive comparisons is of the order of microseconds which is quite low to identify. The negative input of comparator is applied on pin AIN1 (PB3).