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.

TMS320F28386D: Temperature Sensor Control Register

Expert 2350 points
Part Number: TMS320F28386D


When do the debug in CCS, find that Temperature Sensor Control Register  only available by CPU1.

But is there documented that this register only available by CPU1 in Technical Reference Manual?

I want to double confirm this important infotmation.

  • Hi,

    Thank you for the feedback.  The temperature Sensor Control register, as well as the other registers in the above table is accessible only from CPU1.  We will add a note in the TRM to specify this.  This note will be available on the next TRM version.

    Best regards,

    Joseph

  • I tried to enable the internal temperature sensor in CPU1, then to use ADCA SOC13 to get the raw data of the sensor in CPU2. 

    But this test failed, I cannot get the right raw data.

    Does this design have some uncorrects? 

  • Couple of things to check:

         - Did you assign the ownership of ADCA to CPU2 using CPUSEL11 registe?

         - Did you assign the correct channel for temperature sensor?  Temperature sensor is available internally on CH13 of ADCA (not SOC13).

    Best regards,

    Joseph

  • Couple of things are confirmed as right configured.

    Is there setting for ADCA or ADCA CH13'S  reference voltage ?

  • I use the ipc_ex1_basic for Dual core application.

    There is difference value that run in CPU1 to get the internal temperature sensor and run in CPU2(Move the ADC releted code from CPU1 to CPU2, and assign the CPU2 the ADCA ownership).

    I attach the code below

    Could you please help confirm?

    DualCore.rar

  • 7446.DualCore.rar

    I update the project here. 

    Also find the 

    static inline int16_t

    ADC_getTemperatureC(uint16_t tempResult, float32_t vref)

    {

        //

        // Read temp sensor slope and offset locations from OTP and convert

        //

        return((int16_t)((((float32_t)tempResult * vref / 4096.0F) -

                          ADC_EXT_REF_TSOFFSET) / ADC_EXT_REF_TSSLOPE));

    }

    This shall be the root cause, why read the temperature sensor in CPU1 is differenet from CPI2.

  • Hi W Z,

    The issue here is that the pointers assigned for ADC_EXT_REF_TSOFFSET and ADC_EXT_REF_TSSLOPE are only mapped to CPU1.  You would have to read the values at these CPU1 memory locations and transfer it to CPU2.  You can use CPU1 to CPU2 message RAMs to transfer these values.

    Regards,

    Joseph

  • I face another problem.

    When I merge the above code to our existing company project in CPU2 to get the temperature sensor raw data.

    I got the different raw data with the above example.

    In the example ipc_ex1_basic for Dual core application, I can get the same raw data both in CPU1 and CPU2. Value of CH13 of ADCA  is 4095.

    When I merge the above code to our existing company project in CPU1, it also gets the 4095.

    But when I merge the above code to our existing company project in CPU2, it gets the 1687.

    This makes me quite confused!   

    All the test perform in the same development board, hardware part are same.

    Is there one possible setting which I missed may cause this problem?

  • Hi,

    This follow up question somehow did not get a response from our side.  This happens because the thread has been closed, then a follow up question was posted.  Suggestion is that, once the thread is closed, please open a new thread so our team will be notified accordingly.

    Anyway, one reason why conversions are getting the max value of 4095 is that VREFHI is not getting any bias. Another possibility is ADC ownership sharing between CPU1 and CPU2.  Have you resolved this issue yet or are you still debugging the problem?

    Regards,

    Joseph

  • Not yet, due to there is no technical detail how to do the setting in the TRM.

  • Hi WZ,

    Can you be more specific on what settings are not shown in TRM? I thought you were successful in carrying out below tasks:

    (Move the ADC releted code from CPU1 to CPU2, and assign the CPU2 the ADCA ownership)

    Regards,

    Joseph

  • Anyway, one reason why conversions are getting the max value of 4095 is that VREFHI is not getting any bias.

    I mean that I always get the raw data is 4095.

  • I did not find any setting or bias that shows in TRM.

    I suppose TI's example will offer the right result.

  • Hi WZ,

    VREFHI does not require a setting.  Just ensure that VREFHIA terminal is getting the correct voltage reference.  Did you also check the ADC tnd temperature sensor registers to see if the registers are written to correctly by the CPU that the module is assigned to?  Based from your description where your original code works, then migrating the working code to your existing company project and always getting the incorrect temperature sensor value, it seems like there have been issues during code merging.  I suggest that you start stepping through your code while checking the ADC registers to see if the values are updated properly.

    Regards,

    Joseph

  • I will start a new question, thanks a lot.