Introduction
This application note proposes two methods for measuring and displaying temperature using the STM8L built-in temperature sensor connected to the STM8L-DISCOVERY board. The two methods are illustrated in the application code example provided with this application note within two configurable modes: normal and advanced.
More generally, this application note explains the care that should be taken with the temperature sensor, and describes the peripheral settings and configuration required to develop the temperature sensor application.
The temperature sensor application does not require any additional hardware. Once the STM8L-DISCOVERY is powered up through a USB cable connected to the host PC, the application immediately starts, and the chip temperature is continuously displayed on the liquid crystal display (LCD). The minimum and maximum temperatures recorded over the past runtime period are automatically stored by the application, and are available for display by pressing the user push button on the STM8L-DISCOVERY. The temperature tendency information is displayed as a bar graph on the LCD.