Thermal Sensor

Supported ICs[ RTL8720E ][ RTL8726E ][ RTL8713E ][ RTL8730E ][ RTL8721F ]

Introduction

The thermal meter of AmebaSmart is used to monitor the temperature inside the chip, and provide low-temperature warning, high-temperature warning and over-temperature protection.

  • When the temperature exceeds the limit high-temperature threshold, interrupt will be send to the CPU, and CPU can reduce the frequency.

  • When the temperature exceeds the limit low-temperature threshold, interrupt will be send to the CPU, and CPU can increase the frequency.

  • When the temperature exceeds the limit over-temperature protection threshold, hardware will automatically power down for over-temperature protection.

Features

  • No calibration

  • Power: 3.3V/0.9V

  • Measurement range: ─40°C ~ 125°C

  • Variation: ±1.5°C (typical), ±5°C (worst)

  • Resolution: 0.0125°C

  • Clock: 2MHz

  • Power consumption: 30uA@LV, 100uA@HV

  • 19-bit thermal temperature value: 1 signed bit, 8 integer bits, and 10 decimal bits

  • Provides low- temperature warning, high-temperature warning and over-temperature protection

  • Provides thermal enable and over-temperature protection enable write access control

Functional Description

Block Diagram

The thermal block diagram is shown in the following figure.

../../_images/thermal_block_diagram.svg

The thermal includes the following sub-modules:

  • Bias circuit

    • Generates bias current for bipolar core

  • Bipolar core

    • Generates temperature-dependent voltages and

  • ∑-∆ ADC

    • Contains ∑-∆ modulator and decimation filter

    • Output temperature-dependent digital value

  • Controller

    • Controls and manages the interrupt

    • Controls low- temperature warning, high-temperature warning and over-temperature protection

  • Register

    • Contains configuration registers, result registers, interrupt registers

    • The interface to software

    • Measured temperature can be read directly from the register

Bipolar Core

In order to produce a digital temperature reading, a ratio-metric measurement has to be performed: a temperature-dependent signal has to be compared to a reference signal.

While virtually every device has temperature-dependent characteristics, two diode-connected substrate PNP transistors are used to generate two voltages: a positive temperature coefficient voltage and a negative temperature coefficient voltage . They can be used to generate both a voltage that is accurately proportional to absolute temperature (PTAT), and a temperature-independent bandgap reference voltage.

The substrate PNP transistors block diagram is shown in the following figure.

../../_images/substrate_pnp_transistors_block_diagram.svg

The relationship between temperature and with is shown in the following figure.

../../_images/temperature_dependency_of_key_voltages.jpeg
\[\mu = \frac{\alpha \times \Delta V_{BE}}{V_{BE} + \alpha \times \Delta V_{BE}} = \frac{V_{PTAT}}{V_{REF}}\]
  • \(V_{PTAT} = \alpha \times V_{BE}\), is proportional to absolute temperature.

  • \(V_{REF} = V_{BE} + \alpha \times V_{BE}\), is a conventional bandgap reference voltage (around 1.2V), with a zero temperature coefficient.

  • \(\mu\) is proportional to temperature, \(\alpha\) should be chosen reasonably to realize \(V_{REF}\).

∑-∆ ADC

∑-∆ ADC contains ∑-∆ modulator and decimation filter. and are input to a ∑-∆ modulator, which produces a bit-stream bs, of which the average value \(\mu\) is equal to the ratio of \(\alpha \times V_{BE}\) and \(V_{REF}\) . A decimation filter is used to filter the quantization noise from the bit-stream bs and perform the required scaling to obtain the ADC output Dout.

∑-∆ modulator block diagram is shown in the following figure.

../../_images/sigma_delta_modulator_block_diagram.jpeg

∑-∆ modulator consists of a loop filter and a clocked comparator. For simplicity, only a first-order loop filter is shown. In the actual modulator, a second-order filter is used. Every clock cycle, the comparator produces a bit of the bit-stream bs based on the polarity of the output Vint of the loop filter. The feedback is arranged to drive the output of the integrator to zero.

If the bit-stream in a given clock cycle is zero, \(\alpha \times V_{BE}\) is integrated, while is integrated if the bit-stream is one. This can be expressed as follows:

As a result of the feedback in the modulator, the average input to the integrator is zero. In other words, the charge added by is balanced by the charge removed by .

So ∑-∆ modulator realizes the quantization of μ.

Power-on Flow

Since thermal mainly uses analog circuit to measure temperature, and analog circuit needs to take a while to stabilize after power on, so additional operations are needed to get the correct temperature.

Thermal keeps power on in default state. When the system powers on, thermal is on too. But the analog circuit is not stable now, so the current temperature is not correct. To fix this problem, latch is configured to enable in default state, after 10 cycles later, latch is disabled automatically.

The power-on flow of thermal can be described as the following figure.

../../_images/power_on_flow_of_thermal.svg

Power-on temperature (temp_out_poweron) is the first temperature measured after latch disabled with thermal stabilized. Also tm_max and tm_min start recording only after thermal is stable.

Registers Access Control

The values of thermal registers can be obtained directly by reading the registers’ addresses. Also, most of the thermal registers’ bits can be programmed by writing values to the registers’ addresses directly.

There are only five bits write access different from other bits. The five special bits are: tm_pow, tm_powcut, tm_rstb, tm_highcmp_pt_en and tm_high_pt_thr. The special bits write flow is illustrated in the following figure.

../../_images/thermal_special_bits_access_flow.svg

The grant code is used to protect special bits write in case that incorrect operation causes thermal disable and over-temperature protection disable, or high temperature protection threshold wrong.

Note

Configuration with TM OSR greater than or equal to three is not supported.

Registers

Base Address: 0x4101D000

Name

Address offset

Access

Description

REG_TM_GAIN

000h

R/W

Thermal parameter a

REG_TM_OFFSET

004h

R/W

Thermal parameter b

REG_TM_CTRL

008h

R/W

Thermal control register,config thermal parameter

REG_TM_TH_CTRL

00Ch

R/W

Thermal threshold control register,config warning and low temperature threshold

REG_TM_RESULT

010h

R

Thermal result register

REG_TM_ADC_RESULT

014h

R

Thermal ADC result register,for debug

REG_TM_MAX_CTRL

018h

R/W

Record thermal max temperature

REG_TM_MIN_CTRL

01Ch

R/W

Record thermal min temperature

REG_TM_OUT_PWR_ON

020h

R

Record thermal output temperature when power on reset

REG_TM_INTR_CTRL

024h

R/W

Thermal interrupt control register

REG_TM_INTR_STS

028h

R/W

Thermal interrupt status register

REG_TM_TIMER

02Ch

R/W

Thermal time register,when over protect temperature,time count value

REG_TM_DUMMY

030h

R/W

REG_TM_GAIN

  • Name : Thermal Meter Gain Register

  • Size : 32

  • Address offset : 000h

  • Read/write access : R/W

Thermal parameter a

31:29 RSVD 28:0 TM_A

Bit

Symbol

Access

Reset

Description

31:29

RSVD

R

-

Reserved

28:0

TM_A

R/W

0x08284000

This bit defines thermal meter gain.

  • Bit[28:14]: Integer part

  • Bit[13:0]: Decimal part

REG_TM_OFFSET

  • Name : Thermal Meter Offset Register

  • Size : 32

  • Address offset : 004h

  • Read/write access : R/W

Thermal parameter b

31:22 RSVD 21:0 TM_B

Bit

Symbol

Access

Reset

Description

31:22

RSVD

R

-

Reserved

21:0

TM_B

R/W

0x00371700

This bit defines thermal meter offset.

  • Bit21: Signed bit

  • Bit[20:11]: Integer part

  • Bit[10:0]: Decimal part

REG_TM_CTRL

  • Name : Thermal Meter Control Register

  • Size : 32

  • Address offset : 008h

  • Read/write access : R/W

Thermal control register,config thermal parameter

31:24 TM_PWR 23:22 RSVD 21 TM_POW 20 TM_POWCUT 19 TM_CLK_INV_SEL 18 TM_RSTB 17:14 TM_CHOPFREQSEL 13:11 TM_OSR 10 TM_HOLD_EN 9:8 TM_HOLD_DLY 7 TM_CHOP_EN 6 TM_EN_LATCH 5:4 TM_BIAS_SEL 3 TM_BIASDEM_EN 2:1 RSVD 0 TM_ADCCKSEL

Bit

Symbol

Access

Reset

Description

31:24

TM_PWR

R/W

0x69

Thm protect password.

Tm_pow,tm_powcut,tm_rstb,tm_highcmp_pt_en,tm_high_pt_thr, is o_thm can be programed only when this value is 8’h69.

23:22

RSVD

R

-

Reserved

21

TM_POW

R/W

0x1

Thermal poweron signal

  • 0:power down

  • 1:power on

20

TM_POWCUT

R/W

0x1

Power cut

  • 0: disable power cut

  • 1: enable power cut

19

TM_CLK_INV_SEL

R/W

0x0

Clock phase invert select when read temperature.

  • 0: not invert (sample data in rising edge)

  • 1: invert (sample data in falling edge)

18

TM_RSTB

R/W

0x1

Thermal reset signal.

  • 0: disable thermal

  • 1: enable thermal

17:14

TM_CHOPFREQSEL

R/W

0x1

Chop frequecy select

  • 0: fs/64

  • 1: fs/128

  • 3: fs/256

  • 7: fs/512

  • 15: fs/1024

13:11

TM_OSR

R/W

0x0

Deci filter DSR select

  • 0: 128

  • 1: 256

  • 2: 512

  • 3: 1024

10

TM_HOLD_EN

R/W

0x0

Hold output

9:8

TM_HOLD_DLY

R/W

0x1

Hold delay, adjust TM_CLK_OUT width

7

TM_CHOP_EN

R/W

0x1

Chop enable

6

TM_EN_LATCH

R/W

0x1

Latch thermal sensor output immediately after power on for m ore accurate test

5:4

TM_BIAS_SEL

R/W

0x1

Select ADC bias current

  • 0: 8μA

  • 1: 10μA

  • 2: 12μA

  • 3: 14μA

3

TM_BIASDEM_EN

R/W

0x1

Bias DEM enable

2:1

RSVD

R

-

Reserved

0

TM_ADCCKSEL

R/W

0x1

Selelct ADC fs

  • 0: clk_src/256

  • 1: clk_src/128

REG_TM_TH_CTRL

  • Name : Thermal Meter Threshold Control Register

  • Size : 32

  • Address offset : 00Ch

  • Read/write access : R/W

Thermal threshold control register,config warning and low temperature threshold

31 RSVD 30 ISO_THM 29 TM_HIGHCMP_PT_EN 28:20 TM_HIGH_PT_THR 19 TM_HIGHCMP_WT_EN 18:10 TM_HIGH_WT_THR 9 TM_LOWCMP_WT_EN 8:0 TM_LOW_WT_THR

Bit

Symbol

Access

Reset

Description

31

RSVD

R

-

Reserved

30

ISO_THM

R/W

0x0

  • 1: ISO signals from thermal power domain

  • 0: Release

29

TM_HIGHCMP_PT_EN

R/W

0x0

To enable compare tm_out with over temperature protect thres hold:

When tm_out[18:10] > tm_high_pt_thr, it will set aon reset.

  • 1: Enable the compare;

  • 0: Disable the compare.

28:20

TM_HIGH_PT_THR

R/W

0x07D

Set over temperature protection threshold for comparison wit h TEMP_OUT.

Only between 0x046 (70°C) and 0x08C (140°C) are valid.

  • Bit28: Signed bit

  • Bit[27:20]: Integer part

19

TM_HIGHCMP_WT_EN

R/W

0x0

To enable compare tm_out with over temperature warning thres hold:

When tm_high_thr <= tm_out[18:10] < tm_high_pt_thr, it will set Interrupt pending flag ISR_TM_HIGH.

  • 1: Enable the compare;

  • 0: Disable the compare.

18:10

TM_HIGH_WT_THR

R/W

0x069

Set the over temperature warning threshold for comparison wi th TEMP_OUT.Only values greater than 0 are supported

  • Bit18: Signed bit

  • Bit[17:10]: Integer part

9

TM_LOWCMP_WT_EN

R/W

0x0

To enable compare TM_OUT with set Low threshold:

When tm_out[18:10] <= tm_low_thr, it will set Interrupt pend ing flag ISR_TM_LOW.

  • 1: Enable the compare

  • 0: Disable the compare

8:0

TM_LOW_WT_THR

R/W

0x1D8

Set the Low threshold for comparison with TEMP_OUT.

  • Bit8: Signed bit

  • Bit[7:0]: Integer part

REG_TM_RESULT

  • Name : Thermal Meter Temperature Result Register

  • Size : 32

  • Address offset : 010h

  • Read/write access : R

Thermal result register

31:19 RSVD 18:0 TM_OUT

Bit

Symbol

Access

Reset

Description

31:19

RSVD

R

-

Reserved

18:0

TM_OUT

R

0x0

This bit defines real temperature. The result refreshes in r eal time.

  • Bit18: Signed bit

  • Bit[17:10]: Integer part

  • Bit[9:0]: Decimal part

REG_TM_ADC_RESULT

  • Name : Thermal Meter ADC Result Register

  • Size : 32

  • Address offset : 014h

  • Read/write access : R

Thermal ADC result register,for debug

31:22 RSVD 21:0 TM_ADC_OUT

Bit

Symbol

Access

Reset

Description

31:22

RSVD

R

-

Reserved

21:0

TM_ADC_OUT

R

0x0

This bit defines thermal meter ADC output. The result refres hes in real time.

  • ADC output is a positive decimal number, real output=tm_ou t/2^22

REG_TM_MAX_CTRL

  • Name : Thermal Meter Max Temperature Control Register

  • Size : 32

  • Address offset : 018h

  • Read/write access : R/W

Record thermal max temperature

31:20 RSVD 19 TM_MAX_CLR 18:0 TM_MAX

Bit

Symbol

Access

Reset

Description

31:20

RSVD

R

-

Reserved

19

TM_MAX_CLR

R/W

0x0

This bit defines clear max temperature

  • 0: not clear

  • 1: clear tm_max value

18:0

TM_MAX

R

0x40000

These bits define max temperature.

REG_TM_MIN_CTRL

  • Name : Thermal Meter Min Temperature Control Register

  • Size : 32

  • Address offset : 01Ch

  • Read/write access : R/W

Record thermal min temperature

31:20 RSVD 19 TM_MIN_CLR 18:0 TM_MIN

Bit

Symbol

Access

Reset

Description

31:20

RSVD

R

-

Reserved

19

TM_MIN_CLR

R/W

0x0

This bit defines clear min temperature

  • 0: not clear

  • 1: clear tm_min value

18:0

TM_MIN

R

0x3FFFF

These bits define min temperature.

REG_TM_OUT_PWR_ON

  • Name : Thermal Meter Power On Temperature Register

  • Size : 32

  • Address offset : 020h

  • Read/write access : R

Record thermal output temperature when power on reset

31:19 RSVD 18:0 TEMP_OUT_POWERON

Bit

Symbol

Access

Reset

Description

31:19

RSVD

R

-

Reserved

18:0

TEMP_OUT_POWERON

R

0x0

This bit defines output temperature when power on reset.

  • Bit18: Signed bit

  • Bit[17:10]: Integer part

  • Bit[9:0]: Decimal part

REG_TM_INTR_CTRL

  • Name : Thermal Meter Interrupt Control Register

  • Size : 32

  • Address offset : 024h

  • Read/write access : R/W

Thermal interrupt control register

31:2 RSVD 1 IMR_TM_LOW_WT 0 IMR_TM_HIGH_WT

Bit

Symbol

Access

Reset

Description

31:2

RSVD

R

-

Reserved

1

IMR_TM_LOW_WT

R/W

0x0

Interrupt control for thermal meter detect low temperature.

  • 0: Disable low temperature detect interrupt

  • 1: Enable low temperature detect interrupt

0

IMR_TM_HIGH_WT

R/W

0x0

Interrupt control for thermal meter detect over temperature warning.

  • 0: Disable over temperature warning detect interrupt

  • 1: Enable over temperature warning detect interrupt

REG_TM_INTR_STS

  • Name : Thermal Meter Interrupt Status Register

  • Size : 32

  • Address offset : 028h

  • Read/write access : R/W

Thermal interrupt status register

31:2 RSVD 1 ISR_TM_LOW_WT 0 ISR_TM_HIGH_WT

Bit

Symbol

Access

Reset

Description

31:2

RSVD

R

-

Reserved

1

ISR_TM_LOW_WT

R/W

0x0

Interrupt pending flag for thermal meter detect low temperat ure.

  • 0: normal

  • 1: interrupt pending

0

ISR_TM_HIGH_WT

R/W

0x0

Interrupt pending flag for thermal meter detect over tempera ture warning.

  • 0: normal

  • 1: interrupt pending

REG_TM_TIMER

  • Name : Thermal Meter Timer Register

  • Size : 32

  • Address offset : 02Ch

  • Read/write access : R/W

Thermal time register,when over protect temperature,time count value

31:8 RSVD 7:0 TIME_PERIOD

Bit

Symbol

Access

Reset

Description

31:8

RSVD

R

-

Reserved

7:0

TIME_PERIOD

R/W

0x0F

Time period of auto power on

REG_TM_DUMMY

  • Name : Thermal Dummy Register

  • Size : 32

  • Address offset : 030h

  • Read/write access : R/W

31:16 RSVD 15:0 DUMMY

Bit

Symbol

Access

Reset

Description

31:16

RSVD

R

-

Reserved

15:0

DUMMY

R/W

0x0

Rsvd for hw