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.

AWR6843: AWR6843 configuration for gpadc

Part Number: AWR6843
Other Parts Discussed in Thread: AWR1843BOOST

Hi TI members,

I have a question concerning about gpadc configuration on AWR6843 platform.

The code below is how I configure:

int32_t  retVal;

retVal = rlSetGpAdcConfig(RL_DEVICE_MAP_INTERNAL_BSS, (rlGpAdcCfg_t*)&gpAdcCfg);

/* Check for mmWaveLink API call status */
if(retVal != 0)
{
/* Error: Link reported an issue. */
PRINTF("Error: rlSetGpAdcConfig retVal=%d\n", retVal);
}

However, it printed out "Error: rlSetGpAdcConfig retVal=-2". Is anything wrong about my configuration?

By the way, I also configured like this on AWR1843boost platform and seems no problem.

Sincerely,

EricHuang 

  • Hello EricHuang,

    Thankyou for reaching out to us on TI E2E Forums.

    Our expert will look into your concern and get back by tomorrow or early next week.

    Thankyou for your patience.

    Regards,

    Ishita

  • Hi EricHuang

    Can you specify at which point in code this function is called?

    Also how are you setting variable gpAdcCfg?

    Regards,

    AG

  • Hi Akash,

    Sorry for late reply, I want to get some voltage signals via gpadc. The following is my configuration in MmwDemo_initTask() which is in mss_main.c:

    ==============================================================================

    typedef struct MmwDemo_MSS_MCB_t
    {

        rlUInt8_t isGetGpAdcMeasData;
        rlRecvdGpAdcData_t rcvGpAdcData;
    } MmwDemo_MSS_MCB;

    /************************************************
    * Globals *
    ************************************************/
    extern MmwDemo_MSS_MCB gMmwMssMCB;

    gpadc_table getGpAdc_data (int8_t *errCode)
    {
    int32_t retVal;
    rlGpAdcCfg_t gpAdcCfg = {0};
    gpadc_table gpadc = {0};

    gpAdcCfg.enable = 0x3F;
    gpAdcCfg.bufferEnable = 0x0;
    gpAdcCfg.numOfSamples[0].sampleCnt = 30;
    gpAdcCfg.numOfSamples[0].settlingTime = 3;
    gpAdcCfg.numOfSamples[1].sampleCnt = 30;
    gpAdcCfg.numOfSamples[1].settlingTime = 3;
    gpAdcCfg.numOfSamples[2].sampleCnt = 30;
    gpAdcCfg.numOfSamples[2].settlingTime = 3;
    gpAdcCfg.numOfSamples[3].sampleCnt = 30;
    gpAdcCfg.numOfSamples[3].settlingTime = 3;
    gpAdcCfg.numOfSamples[4].sampleCnt = 30;
    gpAdcCfg.numOfSamples[4].settlingTime = 3;
    gpAdcCfg.numOfSamples[5].sampleCnt = 30;
    gpAdcCfg.numOfSamples[5].settlingTime = 3;

    gMmwMssMCB.isGetGpAdcMeasData = 0;
    retVal = rlSetGpAdcConfig(RL_DEVICE_MAP_INTERNAL_BSS, (rlGpAdcCfg_t*)&gpAdcCfg);

    /* Check for mmWaveLink API call status */
    if(retVal != 0)
    {
    /* Error: Link reported an issue. */
    PRINTF("Error: rlSetGpAdcConfig retVal=%d\n", retVal);
    *errCode = GPADC_FAIL;
    return gpadc;
    }
    while(gMmwMssMCB.isGetGpAdcMeasData == 0U)
    {
    /* Sleep and poll again: */
    Task_sleep(1);
    }

    gpadc.adc1_0 = ((float)gMmwMssMCB.rcvGpAdcData.sensor[0].avg / GPADC_ADC_MAX_STEP) * MAX_VOLTAGE;
    gpadc.adc1_1 = ((float)gMmwMssMCB.rcvGpAdcData.sensor[1].avg / GPADC_ADC_MAX_STEP) * MAX_VOLTAGE;
    gpadc.adc1_2 = ((float)gMmwMssMCB.rcvGpAdcData.sensor[2].avg / GPADC_ADC_MAX_STEP) * MAX_VOLTAGE;
    gpadc.adc1_3 = ((float)gMmwMssMCB.rcvGpAdcData.sensor[3].avg / GPADC_ADC_MAX_STEP) * MAX_VOLTAGE;
    gpadc.adc1_4 = ((float)gMmwMssMCB.rcvGpAdcData.sensor[4].avg / GPADC_ADC_MAX_STEP) * MAX_VOLTAGE;
    gpadc.adc1_5 = ((float)gMmwMssMCB.rcvGpAdcData.sensor[5].avg / GPADC_ADC_MAX_STEP) * MAX_VOLTAGE;
    // PRINTF("V0:%f\tV1:%f\t,V2:%f\t,V3:%f\t,V4:%`f\t,V5:%f\n",gpadc.adc1_0, gpadc.adc1_1, gpadc.adc1_2,
    // gpadc.adc1_3, gpadc.adc1_4, gpadc.adc1_5);
    *errCode = GPADC_SUCCESS;
    return gpadc;
    }

    ==============================================================================

    I also add the following code in MmwDemo_eventCallbackFxn() which is in mss_main.c  

    ==============================================================================

    case RL_RF_AE_GPADC_MEAS_DATA_SB:
    {
    gMmwMssMCB.isGetGpAdcMeasData = 1U;
    memcpy(&gMmwMssMCB.rcvGpAdcData, payload, sizeof(rlRecvdGpAdcData_t));
    break;
    }

     ==============================================================================

    Did I configure anything wrong?

    Sincerely,

    EricHuang

  • Thanks Eric

    I'll need some time to look into this but I'll try to have an answer for you by end of week.

    Regards,

    AG