ADuCM3029 ADC_CFG bit 3 purpose?

Hi,

In adi_adc.c, the adi_adc_SetVrefSource() function is setting bit no. 3 (mask 0x8) of the ADC_CFG register when eVrefSrc is ADI_ADC_VREF_SRC_VBAT. But I can't seem to find any information on this bit in the Hardware Reference Manual.

What is the purpose of this bit?

 

/* macro definition for ADuCM3029 */
#if defined(__ADUCM302x__)
#define BITM_ADC_CFG_VREFVBAT                (_ADI_MSK_3(0x00000008,0x00000008U, uint16_t  ))    /*  VRef VBAT */
#endif

/* ... */

ADI_ADC_RESULT adi_adc_SetVrefSource (
    ADI_ADC_HANDLE   hDevice,
    ADI_ADC_VREF_SRC eVrefSrc)
{
    /* ... */
        case ADI_ADC_VREF_SRC_VBAT:
        pDevice->pReg->CFG |= BITM_ADC_CFG_VREFVBAT;
        break;
    /* ... */
}

Thanks,
Guillaume

  • 0
    •  Analog Employees 
    on Jan 15, 2018 5:09 AM

    Hi ,

    Bit no. 3 of ADC_CFG register is reserved in case of ADuCM3027/ADuCM3029. 

    The bit is used for additional functionality in case of ADuCM4050, for selecting VBAT as VREF (ADC reference). This feature is not supported in case of ADuCM3027/ADuCM3029. 

    Best Regards,

    Narsimh

  • Hi ,

    Thanks for the response.

    Ok, so it is safe to use VBAT as VREF without setting the ADC_CFG_VREFVBAT bit to 1 on ADuCM3029?

    Just to make sure: Setting this bit, marked as reserved will have no effect on ADuCM3029 . The code was added in the adi_adc.c driver for code portability purposes. Any other reasons?

    When you say

    selecting VBAT as VREF (ADC reference). This feature is not supported in case of ADuCM3027/ADuCM3029. 

    The bit selection feature is not supported, the ADuCM302x ADC can still use VBAT as VREF correct?

    Best regards,
    Guillaume

  • 0
    •  Analog Employees 
    on Jan 15, 2018 11:38 PM

    Hi ,


    Thanks for your question. 

    To clarify, the additional functionality provided by use of the ADC_CFG.VREFVBAT bit in case of ADuCM4050 is an option to use VBAT_ADC as ADC reference without requiring any external connection to the VREFP_ADC pin. This can be thought of, as an internal multiplexer option to route VBAT_ADC to the ADC reference. This is what is NOT supported in case of ADuCM302x. 

    At the same time, if you do need to use VBAT_ADC as ADC reference in case of ADuCM302x, you could consider connecting VBAT to VREFP_ADC pin externally and configure the ADC to use external reference. 

    In general, it would be recommended to not write in to peripheral control register bits that are marked reserved (shaded in gray color). You are right in that code portability was the motivation for trying to maintain a common source code for the ADC driver between ADuCM302x and ADuCM4050. Apologies if this has caused some confusion. 

    Best Regards,

    Narsimh

  • Hi ,

    I'm still missing something here.

    I have an ADuCM3029 EZ-KIT 1.2 with JP11/ADC_SEL removed so the VREF_ADC pin is not connected to any supply.

    And, according to the board schematics, VBAT_ADC is connected to PROC_3V.

    When I set the ADC_CFG.VREFVBAT bit to 1, VREF_ADC goes up to 3V. When ADC_CFG.VREFVBAT is cleared, VREF_ADC goes back to 0V (with cap. discharge).

    What's going on?

    Best regards,
    Guillaume

  • 0
    •  Analog Employees 
    on Jan 18, 2018 12:13 AM

    Hi ,

    Bit no. 3 of ADC_CFG register is reserved in case of ADuCM3027/ADuCM3029. The behavior of ADuCM302x is not guaranteed or supported if writing to reserved peripheral configuration registers.

    If you do need to use VBAT_ADC as ADC reference in case of ADuCM302x, you could consider connecting VBAT_ADC to VREFP_ADC pin externally and configure the ADC to use external reference. 

    Best Regards,

    Narsimh