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.

LAUNCHXL-CC1350-4: Running the ConvertISRC2TEMP example on SCS doesn't work

Part Number: LAUNCHXL-CC1350-4

Hello,

I'm trying to read ambient temperature with CC1350-4 by following the ConvertISRC2TEMP example of SCS described in the following document, but the adcOutVal remains 0. Is it possible that something is missing in the procedure description ? 

Thanks,

Dvir

  • We have some large customers using this method without issues.

    Have you done task testing in SCS? This line adcReadFifo(adcVal); should return the ADC reading. Does it do so? Then output.adcOutVal= adcVal; should set the value.
  • Thanks for the prompt reply.

    When I do task testing in SCS, the board led blinks, then the debugger halts after adcReadFifi(adcVal).

    I'm attaching screenshots of the project configuration and execution attempts. Should I define I/O mapping? What am I missing (The LED example works fine)?

    Thanks again and sorry for multiple attachments,

    Dvir

  • It looks like I'm able to reproduce what you are seeing. Due to a lot of people out of the office this week it could be that I'm not able to provide you with more information before next week.
  • It looks like the app note contains an error... I will come back to you on this.
  • Could you try:

    // Enable ISRC with 20 µA output, and then enable the temperature measurement with a // 50 kΩ resistor. This gives a nominal output voltage of 1 V, which will // vary with temperature. U16 current = ((BV_ISRC_CURR_0P25U | BV_ISRC_CURR_0P5U) | (BV_ISRC_CURR_1P0U + BV_ISRC_CURR_2P0U)) | (BV_ISRC_CURR_4P5U | BV_ISRC_CURR_11P75U); //Only one resistor value allowed U16 resistor = ISRC_TEMP_MEAS_RES_50_KOHM; isrcEnable(current); isrcEnableTempMeasWithAdc(resistor); // For better precision, we can disable the ADC input scaling if this does not // violate the maximum input rating of the ADC. adcDisableInputScaling(); adcEnableSync(ADC_REF_FIXED, ADC_SAMPLE_TIME_2P7_US, ADC_TRIGGER_MANUAL); // Sample the temperature dependent voltage using the ADC. For better precision, // perform multiple ADC measurements and calculate the sum or average of the // resulting ADC values. U16 adcVal; adcGenManualTrigger(); adcReadFifo(adcVal); output.adcOutVal= adcVal; // Disable ADC, temperature measurement, and ISRC. // - isrcDisableTempMeasWithAdc() MUST always be called after temperature // measurement. // - isrcDisableTempMeasWithAdc() MUST be called before isrcDisable(). adcDisable(); isrcDisableTempMeasWithAdc(); isrcDisable(); fwGenAlertInterrupt(); fwScheduleTask(1);

  • The code you provided works , Thanks !

    It seems like the code included in the application note was indeed incorrect. I also managed to resolve the issue by adding the adcEnableSync command, and also by switching the order of the adcGenManualTrigger and adcReadFifo commands


    Thanks !
    Dvir
  • Have you had the chance to test the ADC reading vs temperature to check if this is correct?

    I have written a ticket to correct the code in the app note.
  • The ADC reading seems to be correlated with temperature but I still did not perform an exact test yet.