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.

IWR1843BOOST: Non-blocking ADC readings

Part Number: IWR1843BOOST

Hello,

I have to read the temperature from a NTC sensor connected to GPADC_1. Reviewing the SDK I see that is implemented blocking and non-blocking methods. However, I do not know how to use them. As it is said in the documentation:

There are a callbackFxn and a returnMode to do it in non-block way. However, my ADCBuf_Params does not have those variables:

I am using mmwave_sdk_03_05_00_04 version on iwr18xx EVK. How can I implement in non-blocking way?

If it is not possible, Which is the better approach to do it? How can I retrieve the readings?

Best regards,

Javier

  • Hi, 

    If you are trying to read the GPADC's, I would recommend following the advice in this thread:
    https://e2e.ti.com/support/sensors-group/sensors/f/sensors-forum/910986/faq-faq-hardware-queries-related-to-mmwave-devices

    And use the MmwaveLink_setGpAdcConfig function from the mmwavelink control layer, and then look for the Async event RL_RF_AE_GPADC_MEAS_DATA_SB in your main file (you should be able to find the Aync Event handler in MSS_Main.c or equivalent file)

    Best Regards,
    Alec

  • Hi Alec,

    Many thanks for the recommendation, it is working as expected. I can share my configuration:

    const rlGpAdcCfg_t gpAdcCfg =
    {
     .enable = 0x01,
     .bufferEnable = 0x01,
     .numOfSamples[0].sampleCnt = 14,
     .numOfSamples[0].settlingTime = 3,
     .numOfSamples[1].sampleCnt = 20,
     .numOfSamples[1].settlingTime = 3,
     .numOfSamples[2].sampleCnt = 14,
     .numOfSamples[2].settlingTime = 3,
     .numOfSamples[3].sampleCnt = 14,
     .numOfSamples[3].settlingTime = 3,
     .numOfSamples[4].sampleCnt = 14,
     .numOfSamples[4].settlingTime = 3,
     .numOfSamples[5].sampleCnt = 14,
     .numOfSamples[5].settlingTime = 3,
     .reserved0 = 0,
     .reserved1[0] = 0,
     .reserved1[1] = 0,
     .reserved1[2] = 0
    };

    And then I just create a task with the following code:

        while (1)
        {
            Semaphore_pend(mAdcReadSemHandle, BIOS_WAIT_FOREVER);
    
            int32_t         retVal;
    
            /* Set GPADC configuration */
            retVal = rlSetGpAdcConfig(RL_DEVICE_MAP_INTERNAL_BSS, (rlGpAdcCfg_t*)&gpAdcCfg);
    
            /* Check for mmWaveLink API call status */
            if(retVal != 0)
            {
                /* Error: Link reported an issue. */
                System_printf("Error: rlSetGpAdcConfig retVal=%d\n", retVal);
            }
    
            Task_sleep(1);
        }

    And read the value as follow:

            case RL_RF_AE_GPADC_MEAS_DATA_SB:
            {
                System_printf ("!!!!GPADC DATA!!!! \n");
                memcpy(&rcvGpAdcData, payload, sizeof(rlRecvdGpAdcData_t));
                uint16_t adc_val = rcvGpAdcData.sensor[RL_SENSOR_ANALOGTEST_ONE].avg;

    Best regards,

    Javier