********************************************************************************
* Detailed Description:
*
* Example shows MCU's temperature measurement with the help of TSENS.
* Calibartion constants for TSENS0/TSENS1 are read from Test flash and
* eQADC is set to measure Vbg and TSENS outputs. eQADC calibration is also done.
* Calculated internal temperature can be displayed on the Terminal.
*
* See results on PC terminal (19200, 8N1, None). You should see following text
* (with different values for sure)
*
* TSENS0/TSENS1 temperature measurement
* press any key to continue...
*
* Calibration constants read from TSENS registers
*
* TSENS0 TSENS1
*
* TSCA_0 = 207 TSCA_1 = 148
* TSCB_0 = 7 TSCB_1 = 19
*
* T = (232 + TSCA * 2^-6) * TSENS_CODE_T / VBG_CODE_T - (273 + TSCB * 2^-4) [degC]
*
* VBG_CODE_T = 997
* TSENS0_CODE_T = 1325 TSENS1_CODE_T = 1332
*
* TSENS0 temp = 39.19 degC TSENS1 temp = 38.86 degC
*
* ------------------------------------------------------------------------------
* Test HW: MPC5777C-512DS Rev.A + MPC57xx MOTHER BOARD Rev.C
* MCU: PPC5777CMM03 2N45H CTZZS1521A
* Fsys: PLL1 = core_clk = 264MHz, PLL0 = 192MHz
* Debugger: Lauterbach Trace32
* Target: internal_FLASH
* Terminal: 19200-8-no parity-1 stop bit-no flow control on eSCI_A
* use USB connector (J21) on minimodule
* EVB connection: ETPUA30 (PortP P23-15) --> USER_LED_1 (P7-1)
* ETPUA31 (PortP P23-14) --> USER_LED_2 (P7-2)
*
********************************************************************************
"I measured it in the same way, but the ADC voltage for TempSense 1, TempSense 2, and the bandgap voltage is continuously varying. Is this expected? Because of this, the temperature values keep changing.
Here are the calibration values I retrieved from flash memory:
- TempSensor_0_Calibration_A: 237
- TempSensor_0_Calibration_B: 54
- TempSensor_1_Calibration_A: 127
- TempSensor_1_Calibration_B: 1
And the following are the current measured values:
- VBG_CODE_T: 1065
- TSENS_CODE_T_1: 1393
- TSENS_CODE_T_2: 1229
These values fluctuate, and sometimes they even go negative. Are these variations normal?"