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.

Need help for On board Temperature sensor based ADC Sample for RM46 HDK

Other Parts Discussed in Thread: HALCOGEN

Hi,

May I get  any sample code includes ADC configuration to use Temperature sensor on RM46 HDK board.

You should give more information about your chip and RM46 HDK board in user mannual for RM46 HDK, Its difficult to generate any sample code on it.You should give  an application code which includes all sensors and peripherals Embedded on board along with useful samples, so that it will be easy for a new user like me.

Please provide some guideline to generate a sample for it.

 

Thanks,

Neha.

  • Hi Neha,

    Did you install the Hercules Safety Demos that come on the DVD bundled with the HDK? You can also download these demos from this web site: http://www.ti.com/tool/hercules_safety_mcu_demos

    One installed, you can find source code examples under the C:\ti\Hercules\Hercules Safety MCU Demos\4.0.0\RM46x_target_sources\demo-app\source folder, assuming that you chose "C:\ti" as the initial install location.

    These examples include code for the temp sensor as well as the light sensor demos.

    Regards, Sunil

  • Hi,

    thanks for your reply.

    I have generated a code using HALCOGEN for light sensor using ADC for RM46hdk board.

    I am not getting whats going wrong in it.Please help. attaching my sample project in keil IDE.http://e2e.ti.com/cfs-file.ashx/__key/communityserver-discussions-components-files/312/1376.ADC_5F00_try_5F00_2.7z

    Thank you

  • Hi Neha,

    The issue is with the adcStartConversion function.

    void adcStartConversion(adcBASE_t *adc, uint32 group)
    {
        uint32 index = (adc == adcREG1) ? 0U : 1U;
    
    /* USER CODE BEGIN (7) */
    /* USER CODE END */
    
        /** - Setup FiFo size */
        adc->GxINTCR[group] = s_adcFiFoSize[index][group];
    
        /** - Start Conversion */
        adc->GxSEL[group] = 8U;
    
        /**   @note The function adcInit has to be called before this function can be used. */
    
    /* USER CODE BEGIN (8) */
    /* USER CODE END */
    }
    

    Your channel selection shows 10 channels selected for conversion, while the above function only selects channel 3 for conversion. The original adcStartConversion function looks like this:

    void adcStartConversion(adcBASE_t *adc, uint32 group)
    {
        uint32 index = (adc == adcREG1) ? 0U : 1U;
    
    /* USER CODE BEGIN (7) */
    /* USER CODE END */
    
        /** - Setup FiFo size */
        adc->GxINTCR[group] = s_adcFiFoSize[index][group];
    
        /** - Start Conversion */
        adc->GxSEL[group] = s_adcSelect[index][group];
    
        /**   @note The function adcInit has to be called before this function can be used. */
    
    /* USER CODE BEGIN (8) */
    /* USER CODE END */
    }
    

    Regards, Sunil