This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430 Opamp to ADC12

Other Parts Discussed in Thread: MSP430FG4618

Hi,

i want to use all of the three opamps of the MSP430fg4618. One of the Opamps is connect interal to the ADC. At the Opamp output pin i can measure the voltage, but I can´t read readout the right value from the ADC memeory register. If I connect the output to another ADC input, the voltage breaks down.

 

  • Ingo Bernsdorf said:
    One of the Opamps is connect interal to the ADC

    Which one?

    Ingo Bernsdorf said:
    If I connect the output to another ADC input

    Which one?

    Ingo Bernsdorf said:
    the voltage breaks down.

    Is the port pin configured as low output? Digital outputs are much stronger than the OpAmp output signal.

    If you have the OAx output active, the digital input and output drivers of this pin are automatically deactivated (By OAPMx>0 and OAADC1 bits in OpAmp config). See device datasheet:I/O schematics for P6.1/3/5. If you route the output to a different pin, you'll need to configure this pin to input (to deactivate the output driver) and select it for module usage (which will deactivate he input and its parasitic currents).

    However, keep in mind that OA0 output goes to A1 input, OA1 output to A3 input and OA2 output to A5 input. (there's a bug in the schematics, erroneously labeling the inptu signal as A0..2 instead of A1,3,5 on the left side - it's correctly labeled on the right side of the schematics.)

  • I want to use all three as 3-amp differential amplifier. Opamp 1 is set as Out.

    void init_MSP_OPAMP(void)
    {
      OA0CTL0 = OAPM_1;                         // Select inputs, power mode
      OA0CTL1 = OAFC_7 + OARRIP;                // Differential amp mode
                                                // limited range (see datasheet)

      OA1CTL0 = OAN_3 + OAP_3 + OAPM_1 + OAADC1;// Select inputs, output
      OA1CTL1 = OAFC_6 + OAFBR_4 + OARRIP;      // Inverting PGA mode,
                                                // OAFBRx sets gain
                                                // limited range (see datasheet)

      OA2CTL0 = OAPM_1;                         // Select inputs, power mode
      OA2CTL1 = OAFC_1 + OAFBR_4 + OARRIP;      // Unity gain mode,
                                                // OAFBRx sets gain
                                                // limited range (see datasheet)

    }

    I want to route this output signal to adc in A3 on P6.3.

    void init_ADC(void)
    {
        ADC12CTL0 &= ~ENC;
        ADC12CTL0 |= ADC12ON + MSC + SHT0_4 + REFON + REF2_5V;
        ADC12CTL1 |= SHP + SHS_1 + CONSEQ_1;
        ADC12MCTL0 |= INCH_1 + SREF_1;            //P6.1
        ADC12MCTL1 |= INCH_3 + SREF_1 + EOS;      //P6.3
        ADC12IE |= BIT1;
        ADC12CTL0 |= ENC;
        ADC12CTL0 |= ADC12SC;
    }

    With which register I can deactivate the output stage? PDIRx or PSEL?

    Thanks for the information.

     

  • OpAmp1 output is on P6.3. OAADC1 and OAPM_1 disable the input and output stages of P6.3 and output the signal to P6.3/A3. For internal A13/INCH_13 loopback, OAADC0 needs to be set.

    Ingo Bernsdorf said:
    I want to route this output signal to adc in A3 on P6.3.
    There it already is.

    Ingo Bernsdorf said:
    ADC12CTL1 |= SHP + SHS_1 + CONSEQ_1;

    SHS_1? So you're triggering the conversion cycle using TACCR1? But then you also set ADC12SC at the end. This doesn't fit.

    And after enabling the reference, you don't wait for it to settle before you start the first conversion.

    Ingo Bernsdorf said:
    ADC12IE |= BIT1;

    There's an ADC12IE1 symbol available. As well as an ADC12IFG1, if needed. Just cosmetics.

    btw: you don't sample nor output OA2 (which is on P6.5 and available on A5/INCH_5). So I wonder what you do with it. :)

  • With the OAADC1 or OAADC0 I can route the signal internal and external to differnt pins, I have tried both setting without sucess. Is there a problem with ADC settings of A3 or A13?

    ADC12MCTL1 |= INCH_3 + SREF_1 + EOS;      //P6.3  or ADC12MCTL1 |= INCH_13 + SREF_1 + EOS;      //P5.0

    Do have any example code which deals with a similar application?

     

    Yes I am using the TACCR1 for triggering the analog input.

     

**Attention** This is a public forum