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.

RTOS/CC2640R2F: ADC use both VDD Reference and internal Reference

Part Number: CC2640R2F

Tool/software: TI-RTOS

Dear All,

I"m working with TI RTOS and use the Simple peripheral project, 

i have 5 Analog inputs, and need to work with different references as follow:

1. 3 Analog inputs,  i need to work with VDDs reference.

2.  2 Analog inputs,  i need to work with 1.4v reference.

the only option that i success to do, is to sample all the ADC channels with 4.3v  reference 

it is possible to use 2  different references at the same time?

if not, how can i change the 4.3V  reference to another ADC  reference ?

Thanks a lot

Adel

  • Hi,
    From the architecture of the ADC, it seems only one reference at a time can be used. In your situation you would reconfigure the ADC with different references and sample the channels sequentially.
  • Hi,

    there any example that configure the ADC with different references?

    Thanks a lot
    Adel
  • Hi Adel,
    Please see the code below. I am using device driver library functions to sample one channel in while(1) loop. You can reconfigure the ADC every time you want to sample a different channel with a different reference. You would change the parameters AUXADC_REF_FIXED and ADC_COMPB_IN_AUXIO7 in their respective functions.

    You should be able to use the same code snippet in RTOS example project by including appropriate header files:

    #include "hw_aux_sysif.h"
    #include "hw_adi_4_aux.h"
    #include "hw_aux_anaif.h"
    #include "aux_adc.h"

    int main(void)
    {
    uint32_t ui32AdcData;
    // Enable the ADC data interface
    HWREG(AUX_ANAIF_BASE + AUX_ANAIF_O_ADCCTL) = 1;

    /* for 7x7 device the AUX IO to DIO mapping is as follows:
    DIO AUX IO
    30 0
    29 1
    28 2
    27 3
    26 4
    25 5
    24 6
    23 7
    */


    while(1)
    {
    AUXADCSelectInput(ADC_COMPB_IN_AUXIO7);
    AUXADCEnableSync(AUXADC_REF_FIXED,AUXADC_SAMPLE_TIME_2P7_US, AUXADC_TRIGGER_MANUAL);
    AUXADCGenManualTrigger();

    ui32AdcData = AUXADCReadFifo();

    CPUdelay(160000);

    }
    }