DieTemp different temperature in other device

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
TamirM
Level 2
Level 2
25 sign-ins First like given 10 questions asked

I called ADC_SAR_EnableInjection() during initialization once.

i call the GetDieTemp Function at a rate of 1KHz.

i've placed the exact same code on 2 separate CPUs (same exact model) and i get about 10°C difference.

i know it's not exactly by the suggested parameters but this is a running machine and i can't change much.

i've noticed that if i use more sampled average the temp drops.

 

what can i do?

 

int32_t GetDieTemp(void)

{

        int16_t ADCCountsCorrected = 0;

        int16_t adcCounts = 0;

        int32_t temp = 0xFF;

       

        if (ADC_SAR_IsEndConversion(ADC_SAR_RETURN_STATUS_INJ))

        {

            adcCounts = ADC_SAR_GetResult16(ADC_SAR_SEQUENCED_CHANNELS_NUM);

 

            /* Adjust data from ADC with respect to ADC Vref value */

            ADCCountsCorrected = (int16)(((int32)adcCounts * ADC_SAR_DEFAULT_VREF_MV_VALUE) >> 10u);

 

            /* Calculate temperature value */

            temp =  DieTemp_CountsTo_Celsius(ADCCountsCorrected);

           

            ADC_SAR_EnableInjection();

        }          

      return temp;

}

0 Likes
1 Solution
Len_CONSULTRON
Level 9
Level 9
Beta tester 500 solutions authored 1000 replies posted

Tamir,

Although technically Sampath is correct, it is possible to see a 10°C difference between identical PSoC parts operating the SAME FW in the SAME ambient environment, it is not that likely.

There are a number of things that might account for a 10°C difference between parts.

  • The ambient temperature at the case of each PSoC.  If the ambient temp at PSoC #1 is +10°C warmer than PSoC #2 then it will reflect this temp difference.
  • The faster the clocking occurs on a PSoC, the higher the die temp.  For example, if PSoC #1 is operating at 48MHz BUS_CLK and PSoC #2 is operating at 12MHz BUS_CLK, then PSoC #1 will be running hotter.
  • GPIO output loading.  If the outputs on one PSoC are driving more loads (resistive or capacitive) this will heat up the IC more.

These factors are the significant ones.  There are other less significant factors that can contribute to what you are seeing.

In general, the die temp is primarily used to make adjustments if EEPROM (or Emulated EEPROM in FLASH) are being written.  There are corrections in the EEPROM writing algorithms that are made depending on the internal die temp.

Using the die temp for determining ambient operating temperature should be used with caution.   Because of the factors I listed above, it is very difficult to gauge the ambient temp without knowing how much these contributing factors add to the reading.

If you need to determine a more accurate ambient temp I recommend one of the three methods:

Method #1

If your application goes to sleep for a significant time (> 1 minute), take the die temp immediately upon wakeup.  Since virtually all CPU operations are dormant during sleep, the die temp should be very close to the ambient temp.

Once the CPU has been running (for about 30 secs) take another die temp reading.  At this point, this could be close to the expected CPU maximum addition to the ambient.   In many of my past designs using other CPUs, this resulted in a +10°C to +15°C addition.

Method #2

If you need determine the ambient continuously during operation you need to determine the CPU running thermal contribution from Method #1.   Subtract this contribution from the die reading and this will get you closer to the actual ambient around the PSoC.

Method #3

Methods #1 and #2 obtain a reasonably accurate ambient temp around the PSoC.  However depending on where the PSoC is soldered in relationship to all the other circuits near it, it can easily heat up due to power dissipation of these other components.  For example, in a power FET design, I made sure the CPU was as far from the FETs as possible to minimize the heat generated by the FETs to add to the CPU ambient.

If these external contributing effects cannot be minimized, you might have to do what many designers do and place an external temp sensor far away from all heating sources.   This can be specific ICs designed for temp sensing or a simple thermistor circuit comprised two simple external components. 

Len
"Engineering is an Art. The Art of Compromise."

View solution in original post

3 Replies
SampathS_11
Moderator
Moderator
Moderator
250 sign-ins 250 solutions authored 5 questions asked

Hello @TamirM ,

Kindly refer to one of the PSoC5LP datasheet. Do kindly confirm if PSoC5LP is the device you are using. If you look into the Temperature Sensor specifications on page 110, you will see that this sensor has a typical error of  ±5°C. In my humble opinion, your observation of a 10°C is possible. 

You can implement a slope calibration function, so that each device can be calibrated, and the magnitude of errors reduced.

Best regards,

Sampath 

0 Likes
TamirM
Level 2
Level 2
25 sign-ins First like given 10 questions asked

I'm using CY8C4247AZI-M485

0 Likes
Len_CONSULTRON
Level 9
Level 9
Beta tester 500 solutions authored 1000 replies posted

Tamir,

Although technically Sampath is correct, it is possible to see a 10°C difference between identical PSoC parts operating the SAME FW in the SAME ambient environment, it is not that likely.

There are a number of things that might account for a 10°C difference between parts.

  • The ambient temperature at the case of each PSoC.  If the ambient temp at PSoC #1 is +10°C warmer than PSoC #2 then it will reflect this temp difference.
  • The faster the clocking occurs on a PSoC, the higher the die temp.  For example, if PSoC #1 is operating at 48MHz BUS_CLK and PSoC #2 is operating at 12MHz BUS_CLK, then PSoC #1 will be running hotter.
  • GPIO output loading.  If the outputs on one PSoC are driving more loads (resistive or capacitive) this will heat up the IC more.

These factors are the significant ones.  There are other less significant factors that can contribute to what you are seeing.

In general, the die temp is primarily used to make adjustments if EEPROM (or Emulated EEPROM in FLASH) are being written.  There are corrections in the EEPROM writing algorithms that are made depending on the internal die temp.

Using the die temp for determining ambient operating temperature should be used with caution.   Because of the factors I listed above, it is very difficult to gauge the ambient temp without knowing how much these contributing factors add to the reading.

If you need to determine a more accurate ambient temp I recommend one of the three methods:

Method #1

If your application goes to sleep for a significant time (> 1 minute), take the die temp immediately upon wakeup.  Since virtually all CPU operations are dormant during sleep, the die temp should be very close to the ambient temp.

Once the CPU has been running (for about 30 secs) take another die temp reading.  At this point, this could be close to the expected CPU maximum addition to the ambient.   In many of my past designs using other CPUs, this resulted in a +10°C to +15°C addition.

Method #2

If you need determine the ambient continuously during operation you need to determine the CPU running thermal contribution from Method #1.   Subtract this contribution from the die reading and this will get you closer to the actual ambient around the PSoC.

Method #3

Methods #1 and #2 obtain a reasonably accurate ambient temp around the PSoC.  However depending on where the PSoC is soldered in relationship to all the other circuits near it, it can easily heat up due to power dissipation of these other components.  For example, in a power FET design, I made sure the CPU was as far from the FETs as possible to minimize the heat generated by the FETs to add to the CPU ambient.

If these external contributing effects cannot be minimized, you might have to do what many designers do and place an external temp sensor far away from all heating sources.   This can be specific ICs designed for temp sensing or a simple thermistor circuit comprised two simple external components. 

Len
"Engineering is an Art. The Art of Compromise."