227
/
838
Nations Technologies Inc.
Tel
:
+86-755-86309900
:
Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North.
Nanshan District, Shenzhen, 518057, P.R.China
Figure 9-18 Temperature sensor and VREFINT diagram of the channel
9.10.1
Temperature sensor using flow
1)
Configure the channel (ADC_IN16) and sampling time of the channel to be 17.1 us
2)
Set ADC_CTRL2.TEMPEN bit to 1 to enable temperature sensor and V
REFINT
3)
Set ADC_CTRL2.ON bit to 1 to start ADC conversion (or through external trigger)
4)
Read the temperature data in the ADC data register, and calculate the temperature value by the following formula:
Temperature (°C) = {( V
30
- V
SENSE
) / Avg_Slope} + 30- T
offset
In which:
V
30
= V
SENSE
at 30 degrees celsius
Avg_Slope = temperature and Average slope of a V
SENSE
curve (mV/°C or μV/°C)
T
offset
= empirical value for temperature error compensation (°C)
Refer to the values of V
30
and Avg_Slope in the electrical characteristics chapter of the datasheet.
Note: There is a settling time before the sensor wakes up from the power-off mode to the correct output of VSENSE; there is also a
settling time after the ADC is powered on, so in order to shorten the delay, the ADC_CTRL2.TEMPEN and ADC_CTRL2.ON bits should
be set at the same time.
ADC interrupt
ADC interrupts can be from an end of regular or injection sequence conversion, an analog watchdog event when
input voltage exceeds the threshold, any end of regular or injection channel conversion. These interrupts have
independent interrupt enable bits.
There are 2 status flags in the ADC_STS register: injection sequence channel conversion started (JSTR) and regular
ADC
TEMPERATURE
SENSOR
ADC1_IN16
ADCx_IN18
INTERNAL
POWER
BLOCK(V
REFINT
)