# Internal Temperature Sensor

An on-chip temperature sensor provides a device internal temperature reading to the LSAD. This temperature sensor requires no external components.

The temperature sensor output voltage is read by the LSAD and converted to a digital value. (For information on configuring the LSAD to measure the internal temperature, see LSAD.) The temperature sensor has offset and gain measurements stored in NVR7, separate from the standard gain and offset values used for regular LSAD measurements.

An offset one point calibration is necessary to reach the specified temperature accuracy. Typically the gain does not need to be calibrated; but for measurements that require higher accuracy, a 2 point gain and offset calibration can be performed.

To calculate the final compensated temperature, the formula below can be used:

Where LSAD_DATA_LSB is the digital value received from the LSAD, TEMP_SENSOR_GAIN is the value in LSB/Co for the temperature sensor, typically 21.3 LSB/°Celsius, and TEMP_SENSOR_OFFSET is a static offset in Celsius, typically 334° Celsius. However, these values vary across devices, and if higher accuracy is desired, you need to calibrate for the values.

Stored in NVR7 is a set of measurements intended to aid software development, since the accuracy of the temperature measurement at production, when NVR7 is written, is +/- 5° Celsius — this does not refer to the overall accuracy of the temperature sensor. The temperatures used for these data points are 30° Celsius and 90° Celsius.

A higher-accuracy calibration by the user is advised for applications that require more precise temperature measurements.

## Enabling the Temperature Sensor

The temperature sensor is enabled or disabled in the ACS_TEMP_SENSOR_CFG register. If the ACS_TEMP_SENSOR_CFG_DUTY_TEMP_SENS bit of the ACS_TEMP_SENSOR_CFG register is set, the temperature sensor is enabled automatically when the appropriate LSAD channel is sampled. If the ACS_TEMP_SENSOR_CFG_DUTY_TEMP_SENS bit is cleared, the temperature sensor is instead enabled via the ACS_TEMP_SENSOR_CFG_ENABLE bit in the ACS_TEMP_SENSOR_CFG register.

## Calibration Procedures

A one-point calibration is sufficient to generate the TEMP_SENSOR_OFFSET at a single temperature. A two-point calibration is required to generate the TEMP_SENSOR_GAIN between the two temperature points. Using more calibration points in a curve fitting calibration procedure will result in higher temperature accuracy.

### One-Point Calibration

To perform a one-point calibration, follow these steps:

| 1. | Place the device in a temperature controlled location. In the equation that follows, the temperature used is called T CAL. The TEMP_SENSOR_GAIN used is the average value, 21.3 LSB/°Celsius.

| 2. | Enable the LSAD and the internal temperature sensor, and configure the LSAD to measure the internal temperature. (See LSAD for information on how to perform this configuration.)

| 3. | Retrieve the result from the LSAD measurement, in LSBs. In the equation that follows, this values is called `D` out(Tcal).

| 4. | Use the following equation to calculate the offset:

### Two-Point Calibration

Two-point calibration allows the calculation of an accurate gain for the device temperature sensor between the two temperature points. Accurate reference temperatures must be used. The two point calibration method can be extended to multiple temperature points using curve fitting for higher accuracy.

The two-point calibration can be performed by following these steps:

| 1. | Place the device in a temperature-controlled location. In the equation that follows, the temperature used is called T cal1.

| 2. | Enable the LSAD and the internal temperature sensor, and configure the LSAD to measure the internal temperature. (See LSAD for more information on how to perform this configuration.)

| 3. | Retrieve the result from the LSAD measurement, in LSBs. In the equation that follows, this value is called D out(Tcal1).

| 4. | Repeat steps 1-3 at the second reference temperature. This is referenced as Tcal2.

| 5. | The temperature sensor gain can be calculated with the formula below:

For registers, see Internal Temperature Sensor Registers.