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.

TMS320F280039C: MCU Temperature Sensor Readings

Part Number: TMS320F280039C
Other Parts Discussed in Thread: C2000WARE

Tool/software:

Hi Team,

I would like to confirm whether the temperature sensor on the TMS320F280039C MCU can read negative temperatures. If it does, what is the supported temperature range?

From my understanding, the ADC raw data is always positive, as it represents the sensor's output in digital format. Since temperature conversion is performed based on this ADC value, how does the system correctly interpret negative temperatures? Could you provide a brief explanation of the mechanism behind this?

Additionally, could you clarify whether the ADC_getTemperatureC() function in the ADC DriverLib correctly handles negative temperature readings?

Looking forward to your response.

Best Regards,

Manasa P

  • Hi Manasa,

    Yes, you are correct that the return value of the temperature sensor is always a positive number that is between 0 on 4095.   However, reading out the actual temperature requires a linear function that involves reading and recording the raw temp sensor values at known extreme two temperature points.  Next step involves calculating the slope and intercept from these two points and using them later on to calculate the actual temperature based from raw temperature sensor reading.

    Sope and intercept calculation is already done on each F280039 device during factory testing and these values are stored in the device's OTP (one time programmable) region.  All the user has to do is configure the ADC to read out the raw temperature sensor reading and apply an API to use the stored temperature sensor slope/intercept of the device and API returns a signed int value for the temperature sensor.

    See example adc_ex3_temp_sensor.c in C2000Ware.  In this example, you would see in the ISR (__interrupt void adcC1ISR),  the raw temperature sensor value is read out in ADC_redResult() function and assigned to variable sensorSample.  This would return a value that is between 0 and 4095. sensorSample is then passed as an argument to ADC_getTemperatureC().  This function uses the stored slope and intercept values derived during factory testing to calculate the actual temperature.  It is assumed in the example that device is configured to use the internal 3.3V reference.  If your application requires a different reference mode, you need to change this in your code as well as in the ISR by changing the arguments in function call ADC_getTemperatureC(), otherwise the device will use different scaling number and slope/offset values and will result in erratic calculations.

    Best regards,

    Joseph

  • Hi Joseph,

    Thank you for your detailed explanation regarding how the TMS320F280039C temperature sensor uses factory-calibrated slope and offset values to compute actual temperature readings.

    I have tested the implementation with a 3.3V reference and successfully read positive temperatures up to 35°C. Based on this, I would like to confirm:

    1) Does the provided temperature sensor conversion code correctly handle negative temperatures?

    2) If negative readings are supported, what is the minimum temperature range this sensor can measure?

    Additionally, could you confirm the maximum positive temperature range that the sensor can support?

    Looking forward to your response.

    Best Regards,

    Manasa

  • Hi Manasa,

    1) Does the provided temperature sensor conversion code correctly handle negative temperatures?

    JC: Yes, routine correctly handle negative temperatures. ADC_getTemperatureC() returns a signed integer value.

    2) If negative readings are supported, what is the minimum temperature range this sensor can measure?

    Additionally, could you confirm the maximum positive temperature range that the sensor can support?

    JC: Returned value of the temperature sensor would sense close to the junction temp of the chip.  This will be approximately -40degC to 150degC

    Regards,

    Joseph