![GigaDevice Semiconductor GD32E23 Series Скачать руководство пользователя страница 168](http://html.mh-extra.com/html/gigadevice-semiconductor/gd32e23-series/gd32e23-series_user-manual_2225794168.webp)
GD32E23x User Manual
168
The output voltage of the temperature sensor changes linearly with temperature. Because
there is an offset, which is up to 45°C and varies from chip to chip due to the chip production
process variation, the internal temperature sensor is more appropriate to detect temperature
variations than absolute temperature. When it is used to detect accurate temperature, an
external temperature sensor part should be used to calibrate the offset error.
The internal reference voltage (V
REFINT
) provides a stable (bandgap) voltage output for the
ADC and comparators. V
REFINT
is internally connected to the ADC_IN17 input channel.
To use the temperature sensor:
1.
Configure the conversion sequence (ADC_IN16) and the sampling time(17.1μs) for the
channel.
2.
Enable the temperature sensor by setting the TSVREN bit in the ADC control register 1
(ADC_CTL1).
3.
Start the ADC conversion by setting the ADCON bit or by the triggers.
4.
Read the internal temperature sensor output voltage(V
temperature
), and get the
temperature with the following equation:
Temperature (°C) = {(V
25
– V
temperature
) / Avg_Slope} + 25.
V
25
: internal temperature sensor output voltage at 25°C, the typical value please refer to
the datasheet.
Avg_Slope: average slope for curve between Temperature vs. internal temperature
sensor output voltage, the typical value please refer to the datasheet.
10.4.12.
Programmable resolution (DRES) - fast conversion mode
It is possible to obtain faster conversion time (t
ADC
) by reducing the ADC resolution.
The resolution is configured by programming the DRES[1:0] bits in the ADC_CTL0 register.
For applications that do not require high data accuracy, lower resolution allows faster
conversion time. The DRES [1:0] bits must only be changed when the ADCON bit is reset.
Lower resolution reduces the conversion time needed for the successive approximation
Table 10-4. tCONV timings depending on resolution
Table 10-4. t
CONV
timings depending on resolution
DRES[1:0]
bits
t
CONV
(ADC
clock cycles)
t
CONV
(ns) at
f
ADC
=28MHz
t
SMPL
(min)
(ADC clock
cycles)
t
ADC
(ADC
clock cycles)
t
ADC
(ns) at
f
ADC
=28MHz
12
12.5
446ns
1.5
14
500ns
10
10.5
375ns
1.5
12
429ns
8
8.5
304ns
1.5
10
357ns
6
6.5
232ns
1.5
8
286ns
10.4.13.
On-chip hardware oversampling
The on-chip hardware oversampling circuit performs data preprocessing to offload the CPU.