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.

TMS320F2800157-Q1: Information is required on OTP slope address and Offset address.

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

Hi

I need an Information regarding OTP Slope address and OTP Offset address in order to Calculate temperature through ADC values of Internal temperature Sensor. There is no information available in the datasheet. Could you please help me with this?

Thank you,

Rohit Nilagar

  • Hi Rohit,

    Thank you for your question. I am checking with experts on this. Please provide till end of week for response.


    Regards,

    Vince

  • Hi Rohit,

    Thanks for your question. C2000Ware driverlib actually already has these values defined for your use in the "adc.h" file for each device. Please install the latest C2000Ware (released within the past week) and see the following defines and functions:

    #define ADC_EXT_REF_TSSLOPE  (*(int16_t *)((uintptr_t)0x701B2))
    #define ADC_EXT_REF_TSOFFSET (*(int16_t *)((uintptr_t)0x701B3))
    
    // temp sense calculation
    static inline int16_t
    ADC_getTemperatureC(uint16_t tempResult, float32_t vref)
    {
        float32_t temp;
    
        //
        // Read temp sensor slope and offset locations from OTP and convert
        //
        temp = (float32_t)tempResult * (vref / 2.5F);
        return((int16_t)((((int32_t)temp - ADC_EXT_REF_TSOFFSET) * 4096) /
                         ADC_EXT_REF_TSSLOPE));
    }

    Regards,

    Vince