English
Language : 

AN3397 Datasheet, PDF (18/24 Pages) STMicroelectronics – Temperature sensor example using the STM8L-DISCOVERY board
Software description
AN3397
3.2.2
User calibration routine flowchart
The user calibration routine performs the ADC measurement (see Section 2.4.3: Calibration
technique) at ambient temperature (VAMBIENT) and calculates the average slope. These
values are stored in the Data EEPROM.
This routine is automatically launched in temperature sensor Advanced mode when the user
calibration point has not been previously processed. It may also be forced by the user if the
calibration point is to be updated.
Before proceeding to this calibration, the #define Tambient in the main.c file must be
updated with the ambient temperature value of the environment. It is set by default to 25 (for
25 °C).
As shown in Figure 6, the temperature measurement is averaged from 20 acquisition
samples, and the resulting data is stored in the EEPROM to be re-used even after
STM8L-DISCOVERY is powered off.
18/24
Doc ID 018809 Rev 1