Microcontroller takes control of comparator
By Abel Raynus, Armatron International, Melrose, MA -- EDN, 9/1/2000
In many µC applications, a signal conditioner modifies an analog input signal from a sensor and passes it to the µC for processing. The last stage of the signal conditioner is always a device that transforms the signal level to a value acceptable for the µC's input. Usually, it is a comparator. Often, this signal channel is open or closed for some programmable time period. For this purpose, you can use a variety of analog switches. Figure 1 shows an alternative: a cost-effective technique that needs no additional switches. The circuit exploits the fact that the µC's output pin can work as a programmable SPDT switch, connecting the lower end of R1 either to 5V or to ground. When you program the µC's output pin (pA1 in Figure 1a) to a low level, R1 connects to ground, and the predetermined reference voltage connects to Pin 2 of the comparator. In Figure 1b, VREF=2V. The channel is open, and for input signals greater than VREF, the comparator provides 5V to the µC's Pin pA0. When the output pin pA1 is high, the reference voltage becomes 5V, and the comparator's output switches to 0V. The channel is then closed. (DI #2582)
















