App note: Op-amp/comparator module for dsPIC

in app notes by DP | 10 comments

Some dsPIC33E and PIC24E microcontrollers have an comparator module that can function as an op-amp [PDF]. The module can be used as a simple non-inverting amplifier by adding two external resistors, no external op-amp chip needed. The output can be read internally by the ADC module, or routed externally to use in your circuit.

This entry was posted in app notes and tagged , , , .

Comments

  1. DwayneR says:

    Note: the op-amp can be configured as an INVERTING amplifier, NOT non-inverting.

    Note that it does make a pretty darned awful op-amp – but sometimes that’s all you need.

    dwayne

    • rsdio says:

      Why? All 3 op-amp connections are available, so non-inverting configurations should work equally well. i.e. CxIN1+ is an external pin and can be connected to something besides ground if needed, such as Vin. In that case, R1 would be grounded where it connects to Vin in the inverting configuration.

      If I’m missing something, then please explain.

      Did you mean to say that the comparator output cannot be inverted if you want the op-amp to function?

      • DwayneR says:

        [quote] Why? All 3 op-amp connections are available [/quote]

        Yeah – you are correct. I was paying more attention to the circuit as drawn which, of course, is an inverting amplifier.

        dwayne

  2. Philip says:

    Hi Guys!

    If its a comparator it means that it does not have compensation[compensationcap] – which means this could affect its performance in high frequencies? This is a question..what are your views on it?

    • rsdio says:

      Single op-amps sometimes have compensation capacitors, but quad op-amps never do. If quad op-amps can work just fine without compensation then it seems these dsPIC op-amps can do at least as well.

  3. ultrasoundero says:

    @Philip. You are spot on. Comparators are not optimized for closed loop operation though you could always use one. People often get away by using one of the un-used comparators in a quad package as a cheap-ass opamp. So, a comparator when operated in closed loop has very low gain band-width and lack of internal miller compensation means a tendency to oscillate. A comparator also drives its output to logic levels as against an OpAmp. I personally always steer away from using a comparator as an OpAmp. I have to read the datasheet to understand the actual implementation details.

  4. Kunal Thakkar says:

    LE/4901/1712/VI

    Dear Sir,

    We seek competitive quote for the following:

    Sr. No DESCRIPTION QTY
    1 QUAD COMPARATOR & OPAMP
    QUOTE IN SLABS: 1-299 & 300-500 Nos.

    NOTE: PLEASE PROVIDE TECHICAL DATSHEET, DRAWING, COMPLY YOUR PRODUCT WITH OUR SPECIFICATION. Please also note that in payment terms Letter of Credit is preferable.
    Also do quote our Inquiry no. during your reply.

    You are requested to quote CIF Bombay (for foreign suppliers) price including delivery schedule by return fax/email along with Technical sheet.

    Yours Truly,
    FOR LEKHPAL ENGINEERING PVT. LTD.

    Mrs. BINA THAKKAR
    Coordinator
    +91-9004986160

  5. Pepijntje says:

    Back to the basics : the main difference between an Opamp and a Comparator is the internal Miller compensating capacitor (to guarantee phase margin in the loop). The Opamp has it, the Comparator has not. Feedback requires the Miller else you will have a nice oscillator. But Miller makes your circuit slow. Opamp speed is microseconds, Comparator speed is nanoseconds.
    An Opamp can be used as a (slow) Comparator.
    A comparator cannot be used as an Opamp, unless you add a quite large external capacitor in your feedback loop.
    Single or dual or quad versions are irrelevant to the above.

  6. Martin Hoppe says:

    Hi,

    I´m trying something very similar to the schematic above. I want to connect the output of the OPAMP of a PIC24F16KM204 internally to the AD-Converter. But the datasheet of the Pic-Opamp-Datasheet refers to the Pic-ADC-Datasheet and this one doesn´t give the option OAOUT as an internal input.
    Am I doing something wrong? What am I missing? Would be cool if someone has an idea!

Leave a Comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Notify me of followup comments via e-mail. You can also subscribe without commenting.