Temperature Indicator

Last modified by Microchip on 2024/02/06 14:32

Some PIC® Microcontroller Unit (MCU) Devices are equipped with a temperature circuit designed to measure the operating temperature of the silicon die. The circuit’s range of operating temperature falls between -40°C and +85°C. The output of the circuitry is a voltage that is proportional to the device temperature and is connected internally to the device's Analog to Digital Converter (ADC). A channel is reserved for the temperature circuit output. Depending on the application, the Analog-to-Digital Converter result can be either compared directly against specific trip points or used to determine the actual temperature by calculation, a look-up table, or a combination of both.

The Temperature Indicator circuit may be used as a temperature threshold detector or a more accurate temperature indicator, depending on the level of calibration performed. A single temperature or one-point calibration allows the circuit to indicate a temperature around that calibration temperature. A dual temperature or two-point calibration allows the circuit to sense the entire range of temperature more accurately. The accompanying image shows a simplified block diagram of the temperature circuit.

simplified temperature circuit schematic

The temperature can be calculated per the equation below. The output of the ADC is converted to a temperature based on the operating voltage (Vdd) and the mode selected.

temperature equation

Reference for the above equation:
mode (High Mode) = 4
mode (Low Mode) = 2
where n is the resolution of the ADC; 8 or 10 bits.

ADC Result

The ADC reading of the Temperature is acquired by setting the ADC channel to the Temperature Indicator. The Analog-to-Digital Result Registers (ADRESH and ADRESL) will contain the result of the temperature conversion. For more detail on the ADC peripheral operation refer to the article on the Analog to Digital Converter (ADC).

A sample output is shown in the chart below with the ADC result plotted against the Temperature.

Back to Top

ADC Result (Decimal) VS. Temperature (Regulated Supply Voltage)

ADC Result vs Temperature graph

Back to top

Temperature Indicator Circuit Operation

The Temperature Indicator circuit, inside many PIC Microcontroller Unit (MCU) Devices, outputs a proportional voltage relative to the silicon temperature. The proportional voltage output is achieved by measuring the forward voltage drop across multiple silicon junctions inside the device. A voltage across two (low range) or four (high range) silicon junctions can be selected.

The temperature sense circuit is integrated with the Fixed Voltage Reference (FVR) module. The circuit is enabled by setting the Temperature Sensor Enable bit (TSEN) of the Fixed Voltage Reference Control (FVRCON) register. When disabled, the circuit draws no current.

Temperature Circuit

The ideal voltage of a single junction temperature can be calculated per the equation below.

(1) Vt = 0.659 – (TemperatureDegreesC+40)∗(0.00132)

The equations below describe the output characteristics of the temperature indicator where Vt is the voltage across a single silicon junction.

High Range:

(2) Vtemp = VDD − 4Vt

Low Range:

(3) Vtemp = VDD − 2Vt

The high range, selected by setting the TSRNG bit of the FVRCON register, provides a wider output voltage. This provides more resolution over the temperature range but may be less consistent from part to part. This range requires a higher bias voltage to operate and thus a higher VDD is needed.

The low range is selected by clearing the TSRNG bit of the FVRCON register. The low range generates a lower voltage drop and thus a lower bias voltage is needed to operate the circuit. The low range is provided for low-voltage operation.

Minimum Operating VDD vs. Minimum Sensing Temperature

When the temperature circuit is operated in low range, the device may be operated at any operating voltage that is within specifications. When the temperature circuit is operated in high range, the device operating voltage, VDD, must be high enough to ensure that the temperature circuit is correctly biased.

The table below shows the recommended minimum VDD vs. Range setting for a PIC16F1825 device. The device data sheet should be reference for the exact range.

table of the minimum VDD vs Range setting for PIC16F1825

The final temperature value is presented as an ADC value per the equation below.

(4) ADCResult = (Vtemp/VDD)∗((2^n)−1))

where n is the resolution of the ADC; 8 or 10 bits.

Back to top

Temperature Indicator Calibration

The temperature indicator output is based on the ideal junction temperature formula below. However, the results can vary slightly from device to device. This is due to the device’s transistor voltage threshold, Vt, which will vary within production allowances. The temperature indicator doesn't have a built-in calibration mechanism so external testing may be required if the tolerances are outside the specific applications needs. Typically the temperature indicator works best for single trip points or over-temp applications. For more accurate temperature measurements an external temperature sensor such as the MCP9700 or MCP9800 can deliver the accuracy over a larger range of temperatures.

The ideal voltage of a single junction temperature can be calculated per the equation below.

(5) Vt = 0.659 – (TemperatureDegreesC+40)∗(0.00132)

Some applications can take calibration data during the manufacturing process. For those cases, the temperature indicator can be measured and a calibration value can be calculated and stored in Electrically-Erasable Programmable Read Only Memory (EEPROM) or Flash Memory to offset the results of the ideal temperature ADC result equation. This may require single-point or dual-point calibration where multiple devices are measured. For example, a sample of 12 devices could offer a range of temperature measurements similar to the chart below.

Temperature Data From 12 Sample Devices

Graph of Temperature Data From 12 Sample Devices

Ideal Temperature ADC Result Equation

(6) ADCResult = ((mode∗Vt)/VDD)∗((2^n)−1))

mode (High Mode) = 4
mode (Low Mode) = 2
where n is the resolution of the ADC; 8 or 10 bits.

Single-Point Calibration

Single-point calibration is done by measuring the device reaction at a single fixed temperature. This can offer an offset value to give a more accurate measurement for a trip point. But variation from device to device may affect any measurement accuracy at higher or lower temperature points around the test point. Therefore, single-point calibration is recommended when the temperature indicator is used for a threshold or trip point based on the temperature of the device. Single-point calibration can be expressed per the equation below.

(7) ADCResultcalibrated = ADCresult – calibrationvalue

With a sample PIC16F1937 device under the following conditions:
• Powered at 5V
• High-range 4Vt operation
• 25°C forced temperature

The measured Analog-to-Digital conversion gives a result of 561 decimal.

Typical Analog-to-Digital conversion result at 25°C is calculated as 554 decimal using equation (2) above.
For single-point calibration, the difference between the conversion result and the ideal A/D conversion result value is the calibration value.

(8) CalibrationValue = ideal – measured

(9) 554 − 561 = 7

Consequently, for this device the calibration value would be 7. This value can be stored in a nonvolatile program or data EEPROM memory within the device for use when taking temperature measurements.

Two-Point Calibration

Calibration is performed at two temperatures from which we can determine calibrated temperature. As a result, this method is more accurate across a larger range of temperatures but requires two distinctively different temperature calibration measurement points. Those calibration points can be used to develop the parameters of the equation below.

(10) ADCResultcalibrated = A + (B∗ADCResult)

(11) A = (Ideal@T1–Ideal@T2)/(Actual@T1–Actual@T2)

(12) B = Actual@T1−(A∗Ideal@T1)

Where:
T1 calibration temperature 1
T2 calibration temperature 2

Refer to "AN1333: Use and Calibration of the Internal Temperature Indicator" (DS01333) for more details regarding the calibration process.

Back to top