Electronic Design

  
Reprints     Printer-Friendly    Email this Article    RSS        Font Size     What's This?


[Ideas For Design]
Get Extra Op Amps By Using Spare Comparators

Hartono Darmawaskita  |   ED Online ID #8029  |   May 24, 2004


So, you have selected an MCU with an analog-to-digital converter (ADC) and analog comparator peripherals for your cost-sensitive application. You then realize that your sensor signal needs to be amplified to a voltage level suitable for analog-to-digital conversion. Do you need to buy an additional op-amp device, or is there another lower-cost alternative? If the sensor output is a fast-moving signal, then most likely you'll need to spend more money to add that op amp. If, however, the sensor output is a slow-moving voltage, such as in temperature, humidity, or ambient light sensors, then you may be able to convert one of the onboard comparators to operate as an amplifier.

Figure 1 shows a circuit that will perform as a non-inverting-gain amplifier using a comparator as the active component. Depending on the selected PIC MCU, the comparator output can optionally be synchronized using a D flip-flop. Usually, the synchronization clock frequency can be adjusted by choosing the proper divider from the MCU's main oscillator. The RC network R1, R2, and C1 scales down the comparator output, which is either 5 V (supply voltage) or ground, and provides an RC time constant. At every active edge of the synchronization clock (Sync Clock), the comparator output is latched to the D flip-flop, which then updates the COUT signal to R1.

Now let's assume that initially the VCAP voltage is lower than the input voltage, VIN. Thus, the comparator output is high. As the active edge of Sync Clock arrives, the comparator output is latched to the flip-flop output. Therefore, the signal COUT becomes high, causing the voltage on VCAP to start rising. Upon the next active edge of Sync Clock, the VCAP voltage becomes higher than VIN, causing the COUT signal to transition low. Now, the VCAP voltage changes direction.

When the next clock arrives, the VCAP voltage continues to fall, but let's assume that it's still higher than VIN. Signal COUT then stays low for another clock period. This operation continues as long as the clock is present. Over many clock cycles, the average VCAP voltage is equal to VIN. In addition, the average voltage on COUT can be expressed using the non-inverting-gain-amplifier equation:

The average voltage on COUT can be extracted using a simple low-pass RC filter, R3 and C2, producing a linear output VOUT. Then VOUT can be read via an ADC, or it can drive another comparator peripheral.

Depending on the application, the synchronization flip-flop can be eliminated. But without synchronization, the only delay elements in the system are the comparator's response time and the RC time constant introduced by R1, R2, and C1. Under this configuration, the comparator output switches at a much higher rate. Therefore, the device is more likely to draw higher supply current.

A prototype circuit was built, and the performance was subsequently evaluated in the lab. VIN was varied from nearly 0 to 0.65 V, and VOUT was recorded. The transfer function and gain were then plotted over the input range shown in Figure 2.

The gain is very close to the calculated value and mostly constant over the tested range. The gain does have some distortions when VOUT is close to either ground or 5 V. Because the COUT signal is either 0 or 5 V, generating pulses for an accurate average value near those extremes is more difficult than in the middle of the range. In general, this technique should perform well enough when VOUT has at least 0.5-V headroom from each rail.


Reprints   Printer-Friendly  Email this Article  RSS    Font Size   What's This?


  • Network-On-Chip Tools Arrive for The Masses
  • Tackling System Design Challenges Through Early Verification
  • ESL Tools Take Center Stage As Designers Move Up
  • Parasitic Extraction Tool Targets Next-Generation Custom ICs
  • Synopsys Jumps Into ESL-Synthesis Pool
  • Verify Control Systems Before Committing To Hardware
  • You're Using How Many FPGAs?
  • Tool Up For The FPGA Blitz
    1) Build A Smart Battery Charger Using A Single-Transistor Circuit
    (181 views today)
    2) Hot Hands For Some Cool Rock: Motion Sensing Meets Audio Engineering
    (167 views today)
    3) What's All This Transimpedance Amplifier Stuff, Anyhow? (Part 1)
    (72 views today)
    4) GPS-Derived Grandmaster Clock Delivers Ultra-Precise Time And Frequency Sync
    (70 views today)
    5) Downconverting Mixers Lower Power Consumption While Improving Performance
    (55 views today)
    ALL TOP 20



    POST YOUR COMMENTS HERE
    Name:

    Email:
    Your Comments:

    Enter the text from the image below


    Please refresh the page if you have trouble reading this text.

    Search Electronic Design
         
      
     
    Email Newsletter
    Sponsored By:
    Electronic Design UPDATE provides readers with late-breaking news, opinions from industry experts, and timely technology stories. It's a unique opportunity to get your product message in front of engineers, engineering managers, and corporate managers while they're reading about critical information online.

    Enter Email to Subscribe
      

    Electronic Design Europe Electronic Design China EEPN Power Electronics Auto Electronics Microwaves & RF
    Mobile Dev & Design Schematics Find Power Products Military Electronics EE Events Related Resources