• AVR Freaks

Hot!OpAmp to ADC on PIC32MK0512MCF064

Author
stofanel
New Member
  • Total Posts : 26
  • Reward points : 0
  • Joined: 2010/03/19 23:02:25
  • Location: 0
  • Status: offline
2020/05/27 13:55:43 (permalink)
0

OpAmp to ADC on PIC32MK0512MCF064

Hello,
 
Is it possible to feed the output from the op-amps straight to an ADC input without using an actual ANx pin on the microcontroller? I don't need to see the analog signal, but I need to digitize it.
#1

11 Replies Related Threads

    ric
    Super Member
    • Total Posts : 28009
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: offline
    Re: OpAmp to ADC on PIC32MK0512MCF064 2020/05/27 14:13:27 (permalink)
    1 (1)
    stofanel
    Is it possible to feed the output from the op-amps

    What opamps?
    If you want good answers,. you have to supply good information, i.e. what sort of signal you are talking about.
     

    straight to an ADC input without using an actual ANx pin on the microcontroller?

    This is gobbledy-gook.
    The PIC datasheet clearly shows the inputs to the ADC are the ANx pins.
     

    I don't need to see the analog signal, but I need to digitize it.

    Explain what you mean by "see" and "digitize".
    Do you really mean you are just interested in if it is above or below a certain threshold voltage?
    If this signal can have any voltage between Vss and Vdd, then you MUST NOT feed it to a PIC pin which is in digital mode, only a pin in analog mode.
    Your PIC has five analog comparators which can check against a threshold, but you have to bring the signal in on an ANx pin.
     
    Please explain why you specify "without using an actual ANx" pin.
     
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #2
    al_bin
    Super Member
    • Total Posts : 214
    • Reward points : 0
    • Joined: 2011/02/11 06:28:47
    • Location: 0
    • Status: online
    Re: OpAmp to ADC on PIC32MK0512MCF064 2020/05/27 14:25:45 (permalink)
    5 (1)
    According http://ww1.microchip.com/downloads/en/DeviceDoc/PIC32MK_GP_MC_Familly_Datasheet_60001402G.pdf :
    "The following are key features of the Op amps:
    .........
    • Internal connection to ADC Sample and Hold circuits/SAR cores
    "
     
    Albert
     
     
     
    #3
    ric
    Super Member
    • Total Posts : 28009
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: offline
    Re: OpAmp to ADC on PIC32MK0512MCF064 2020/05/27 14:32:50 (permalink)
    0
    Ahh, so he means the PICs own internal opamps.
    Being a little bit less terse in the question can make it much easier to answer.
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #4
    stofanel
    New Member
    • Total Posts : 26
    • Reward points : 0
    • Joined: 2010/03/19 23:02:25
    • Location: 0
    • Status: offline
    Re: OpAmp to ADC on PIC32MK0512MCF064 2020/05/27 15:00:23 (permalink)
    5 (1)
    Sorry, I should have been more clear. I want to feed the output of the op amp (let's say OA2OUT) straight into the ADC without actually using an analog pin on the micro-controller. Yes, the data sheet says that it's possible to connect the op amp to ADC, but I don't know how. According to the ADC block diagrams, there are only 4 internal analog input sources (temperature sensor, reference voltages, etc), none of which are op amp outputs.
     
     
    #5
    al_bin
    Super Member
    • Total Posts : 214
    • Reward points : 0
    • Joined: 2011/02/11 06:28:47
    • Location: 0
    • Status: online
    Re: OpAmp to ADC on PIC32MK0512MCF064 2020/05/28 00:00:47 (permalink)
    0
    Read op amp chapter too.
    Especially 27.5
     
    Albert
     
     
    #6
    LdB_ECM
    Super Member
    • Total Posts : 406
    • Reward points : 0
    • Joined: 2019/04/16 22:01:25
    • Location: 0
    • Status: offline
    Re: OpAmp to ADC on PIC32MK0512MCF064 2020/05/28 07:22:49 (permalink)
    5 (1)
    Just for future reference the technical term for it is a "buried node"
    Buried node A combinational or registered signal that does not drive an output pin.

     
    al_bin already gave you the actual answer which is yes you can do that and Figure 27-8 actually shows it
    #7
    stofanel
    New Member
    • Total Posts : 26
    • Reward points : 0
    • Joined: 2010/03/19 23:02:25
    • Location: 0
    • Status: offline
    Re: OpAmp to ADC on PIC32MK0512MCF064 2020/05/28 15:17:16 (permalink)
    0
    At the risk of sounding really stupid, which register is used to route the op-amp output to the ADC? I have looked through the ADC chapter, and seen no mention of how to connect the op-amp internally to any of the ADC modules.
    #8
    al_bin
    Super Member
    • Total Posts : 214
    • Reward points : 0
    • Joined: 2011/02/11 06:28:47
    • Location: 0
    • Status: online
    Re: OpAmp to ADC on PIC32MK0512MCF064 2020/05/28 22:33:25 (permalink)
    0
    No additional register required.

    If you configure OA2OUT / AN0 / C2IN4- / C4IN3- / RPA0 / RA0 as OA2OUT, then AN0 will still act as input from this pin.
    See figure 7.2
    Yes, it must be an external pin, but you don't want to convert output of  OA running in an open loop, right?
     
    Albert
    post edited by al_bin - 2020/05/28 22:40:04
    #9
    ric
    Super Member
    • Total Posts : 28009
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: offline
    Re: OpAmp to ADC on PIC32MK0512MCF064 2020/05/28 22:45:28 (permalink)
    0
    al_bin
    Yes, it must be an external pin, but you don't want to convert output of  OA running in an open loop, right?

    I think it is this wording in the datasheet causing the confusion:

    With the proper configuration of the ADC module, theop amp can be configured such that the ADC can directly sample the output of the op amp without the need to route the Op amp output to a separate analoginput pin (see Figure27-8)

    As you say, you need the external pin for the opamp feedback connection.
    What it really means is that the ADC is able to sample the OAxOUT pin directly, you don't have to route the signal back to another AIN pin.
     
     
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #10
    al_bin
    Super Member
    • Total Posts : 214
    • Reward points : 0
    • Joined: 2011/02/11 06:28:47
    • Location: 0
    • Status: online
    Re: OpAmp to ADC on PIC32MK0512MCF064 2020/05/28 23:02:31 (permalink)
    0
    Interesting. This quote doesn't mislead me at all.
    Maybe sometimes poor language skills are better than good ones :-)
    #11
    stofanel
    New Member
    • Total Posts : 26
    • Reward points : 0
    • Joined: 2010/03/19 23:02:25
    • Location: 0
    • Status: offline
    Re: OpAmp to ADC on PIC32MK0512MCF064 2020/05/29 10:31:28 (permalink)
    0
    al_bin
    No additional register required.

    If you configure OA2OUT / AN0 / C2IN4- / C4IN3- / RPA0 / RA0 as OA2OUT, then AN0 will still act as input from this pin.
    See figure 7.2
    Yes, it must be an external pin, but you don't want to convert output of  OA running in an open loop, right?
     
    Albert


    Ok, so the answer was staring me in the face. Yes, the op amp will be running closed loop. It's not my first project with PIC, but it is my first PIC32, and it really had me stumped.

    Thank You.
    #12
    Jump to:
    © 2020 APG vNext Commercial Version 4.5