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.

TMS320F28P650DH: Are ADC Internal and External volatge references same for all the ADC modules?

Part Number: TMS320F28P650DH


Hi,

In the trm it is mentioned, that we need to short VREFHIA, VRFHIB, and VREFHIC if internal vref mode is used.

However, for external reference , nothing as such is mentioned.

However, I cannot find the function "void SetVREF(int module, int mode, int ref)" in C2000Wared for f28p65x.This function is available for other processors.

The only function I find is the following: ADC_setVREF(uint32_t base, ADC_ReferenceMode refMode, ADC_ReferenceVoltage refVoltage) which sets the internal or external reference irrespective of the ADC module.

I wanted to know whether the reference voltages for all the ADCs are same or not. If not, where can I find the SetVref function which sets the references based on modules?

Thanks,

Mukul

  • Hello Mukul,

    The base parameter determines which ADC module to configure (ADCA_BASE, ADCB_BASE or ADCC_BASE).

    The ADCs have independent reference voltage lines. The internal reference buffer is only connected to ADCA's reference voltage line, hence the requirement to connect externally if other ADCs need to use internal reference.

    Best regards,
    Ibukun

  • Hello,

    If you see the implementation of ADC_setVREF, it does not use the address passed as argument. It modifies the analog Subsystem register irrespective of the address passed as argument.

    void
    ADC_setVREF(uint32_t base, ADC_ReferenceMode refMode,
    ADC_ReferenceVoltage refVoltage)
    {
    //
    // Check the arguments.
    //
    ASSERT(ADC_isBaseValid(base));

    EALLOW;
    //
    // Configure the reference mode (internal or external).
    //
    if(refMode == ADC_REFERENCE_INTERNAL)
    {
    HWREGH(ANALOGSUBSYS_BASE + ASYSCTL_O_ANAREFCTL) &=
    ~(ASYSCTL_ANAREFCTL_ANAREFASEL | ASYSCTL_ANAREFCTL_ANAREFBSEL |
    ASYSCTL_ANAREFCTL_ANAREFCSEL);
    }


    else
    {
    HWREGH(ANALOGSUBSYS_BASE + ASYSCTL_O_ANAREFCTL) |=
    (ASYSCTL_ANAREFCTL_ANAREFASEL | ASYSCTL_ANAREFCTL_ANAREFBSEL |
    ASYSCTL_ANAREFCTL_ANAREFCSEL);
    }

    //
    // Configure the reference voltage (3.3V or 2.5V).
    //
    if(refVoltage == ADC_REFERENCE_3_3V)
    {
    HWREGH(ANALOGSUBSYS_BASE + ASYSCTL_O_ANAREFCTL) &=
    ~(ASYSCTL_ANAREFCTL_ANAREFA2P5SEL | ASYSCTL_ANAREFCTL_ANAREFB2P5SEL |
    ASYSCTL_ANAREFCTL_ANAREFC2P5SEL);
    }
    else
    {
    HWREGH(ANALOGSUBSYS_BASE + ASYSCTL_O_ANAREFCTL) |=
    (ASYSCTL_ANAREFCTL_ANAREFA2P5SEL | ASYSCTL_ANAREFCTL_ANAREFB2P5SEL |
    ASYSCTL_ANAREFCTL_ANAREFC2P5SEL);

    }
    EDIS;

    }

    I could not find the SetVref function? Is it available?

  • Hello Mukul,

    This is a bug in the driver. I am filing a ticket with our software team to get it fixed. The function should be selective based on the ADCx_BASE argument provided.

    In the meantime, you can use ASysCtl_setAnalogReferenceExternal(ASYSCTL_VREFHI[A|B|C]) instead of ADC_setVREF.

    Best regards,
    Ibukun