TMS320F2800155-Q1: internal temp sensor value calc

Part Number: TMS320F2800155-Q1
Other Parts Discussed in Thread: C2000WARE

Hi TI Team,

I do not find any information in the data sheet regarding the conversion function (how many Voltage or ADC counts per °C) and the offset of the internal temperature sensor. In our SW Architecture we do not use the ADC lib. Therefore, we cannot use the ADC-getTemperatureC()

Can you help me here?

BR FM

 

  • Hi FM,

    The datasheet does not publish fixed conversion constants (slope and offset) because the TMS320F2800155-Q1 uses device-specific factory calibration values stored in OTP (One-Time-Programmable) memory. This is standard practice for the F2800-series devices.

    Temperature Conversion Formula:

    The general conversion follows this linear equation:

    Temp(°C) = (Vtemp - Voffset) / Slope + Tref

    Where:

    • Vtemp = ADC voltage reading from the temperature sensor
    • Voffset = Factory-calibrated voltage at reference temperature (stored in OTP)
    • Slope = Factory-calibrated sensitivity (V/°C, stored in OTP)
    • Tref = Reference temperature (typically 25°C)

    Implementation Steps:

    1. Read Raw ADC Count

      uint16_t adcCount = ADCARESULTx; // From temp sensor channel
    2. Convert to Voltage

      // For 12-bit ADC with VREF = 3.3V (adjust based on your configuration)
      float Vtemp = (adcCount / 4095.0f) * VREF;
    3. Retrieve Factory Calibration Constants from OTP

      The exact register names and addresses are documented in the TMS320F2800155-Q1 Technical Reference Manual (TRM). Look for the temperature sensor calibration registers in the "Analog Subsystem" or "ADC Calibration" section. These are typically named TEMPTRIM, TSLOPE, TOFFSET, or similar.

    4. Apply the Formula

      // Example (register names will vary - check TRM)
      float Voffset = READ_OTP_TEMP_OFFSET(); // Volts at 25°C
      float Slope = READ_OTP_TEMP_SLOPE(); // V/°C
      
      float temperatureC = (Vtemp - Voffset) / Slope + 25.0f;

     

    Next Steps:

    Since you are not using the ADC library, you will need to:

    1. Identify your ADC reference voltage configuration (internal bandgap, external VREF, or VDD)
    2. Read the OTP calibration values directly from the device registers
    3. Implement the linear conversion using the formula above

    The ADC_getTemperatureC() library function performs these exact steps internally by reading the OTP calibration constants and applying the conversion formula.

    The calibration constant symbols may already be defined in the SDK/header files.

    Best Regards,
    Zackary Fleenor

  • Hello Fleenor,

    Following the guidance from your last response, I have been searching the device register for the slope and offset values stored in OTP. However, I am unable to find any register that provides these two values. Could you help me identify the correct register?

    Please let me know if I am missing something.

    For your reference, I am using the TMS320F280015x Real-Time Microcontrollers technical manual.

    Thank you so much for your continued support!

    Best regards,
    Subhash Singh

  • Hi Subhash,

    Thank you for your patience. I've located the specific information you need regarding the temperature sensor calibration constants for the TMS320F280015x.

    The TMS320F280015x temperature sensor uses device-specific factory calibration values stored in TI OTP (One-Time Programmable) memory. Here's what you need to know:

    OTP Memory Location

    According to the TMS320F280015x Data Sheet (SPRSP68D), Section 7.3.1 Memory Map:

    • TI OTP Memory Range: 0x0007_1000 to 0x0007_15FF (1.5K x 16 words)
    • Note: This memory region is designated "For TI internal use only" and contains factory calibration data including temperature sensor trim values.

    Accessing Calibration Constants

    The specific calibration constants you need are not directly documented with explicit register names in the public TRM because TI provides them through the Device_cal() function and ADC_getTemperatureC() library function in C2000Ware.

    However, you can extract the calibration values by examining the ADC_getTemperatureC() function implementation:

    Location in C2000Ware:

    C2000Ware/driverlib/f280015x/driverlib/adc.c
    C2000Ware/device_support/f280015x/common/include/F280015x_device.h

    Temperature Conversion Formula

    The general formula used by ADC_getTemperatureC() is:

    Temperature (°C) = ((ADC_Result - Offset) / Slope) + Tref

    Where:

    • ADC_Result = Raw 12-bit ADC reading from temperature sensor channel
    • Offset = Factory-calibrated offset value (stored in TI OTP)
    • Slope = Factory-calibrated slope/sensitivity (stored in TI OTP)
    • Tref = Reference temperature (typically 25°C)

    How to Find the Exact Register Addresses

    Since you cannot use the ADC library, here are your options:

    Option 1: Examine the C2000Ware Source Code

    Open the file:

    C2000Ware/driverlib/f280015x/driverlib/adc.c

    Look for the ADC_getTemperatureC() function implementation. This function directly reads the OTP calibration registers. The exact memory addresses and bit fields will be visible in the source code.

    Option 2: Check Device Header Files

    Search in:

    C2000Ware/device_support/f280015x/headers/include/F280015x_Adc.h
    C2000Ware/device_support/f280015x/common/include/F280015x_device.h
    Look for definitions containing:

    • TEMP or TSNS (Temperature Sensor)
    • TI_OTP or OTP_ prefixes
    • Addresses in the range 0x00071000 - 0x000715FF

    Option 3: Example Implementation Pattern

    Based on typical C2000 device implementations, the access pattern would look like:

    // Define OTP base address
    #define TI_OTP_BASE    0x00071000UL
    
    // Temperature sensor calibration offsets (VERIFY THESE IN YOUR DEVICE HEADERS!)
    // These are EXAMPLE offsets - you must verify in the actual header files
    #define TEMP_SENSOR_SLOPE_OFFSET   0x??   // Check device header
    #define TEMP_SENSOR_OFFSET_OFFSET  0x??   // Check device header
    
    // Read calibration values
    volatile uint16_t *pTempSlope = (volatile uint16_t *)(TI_OTP_BASE + TEMP_SENSOR_SLOPE_OFFSET);
    volatile uint16_t *pTempOffset = (volatile uint16_t *)(TI_OTP_BASE + TEMP_SENSOR_OFFSET_OFFSET);
    
    uint16_t tempSlope = *pTempSlope;
    uint16_t tempOffset = *pTempOffset;
    
    // Apply calibration
    float tempC = ((float)adcResult - (float)tempOffset) / (float)tempSlope;

    Recommended Next Steps

    1. Download C2000Ware (if you haven't already) from: ti.com/tool/C2000WARE
    2. Navigate to driverlib/f280015x/driverlib/adc.c
    3. Find the ADC_getTemperatureC() function - it will show you:
      • Exact OTP register addresses
      • Bit field definitions
      • The complete conversion formula with all constants
    4. Copy the relevant portions into your own code without using the library

    Why This Information Isn't in the TRM

    TI intentionally keeps the exact OTP register addresses and calibration data format in the software headers rather than the TRM because:

    • These values are device-specific and factory-programmed
    • The format may vary between device revisions
    • Using the provided library functions ensures forward compatibility

    Alternative: Use Only the Calibration Function

    If your architecture restriction is about the ADC driver library, you could still use only the ADC_getTemperatureC() function by:

    • Extracting just that function from adc.c
    • Including only the necessary OTP address definitions
    • Keeping your own ADC configuration code

    This gives you the calibration without requiring the full ADC library.


    Let me know if you need help interpreting the source code once you locate it, or if you'd like me to provide more specific guidance!

    Best Regards,
    Zackary Fleenor