
Demonstration applications
UM1000
Doc ID 17964 Rev 1
3.5 Thermometer
demo
The STM8L15x microcontroller has one embedded I
2
C peripheral that can be connected to
any device supporting the I
2
C protocol including the system management bus (SMBus)
mode. An STLM75 (or compatible devices) I
2
C temperature sensor is mounted on the
STM8L1528-EVAL board and used to get instantaneous external temperature (–55°C to
125°C).
Once the
THERMOMETER
menu has been selected by pressing the SEL push-button, the
message shown in
is displayed on the LCD.
Figure 12.
Thermometer message
Then the temperature value is displayed in Celsius as shown in
.
Figure 13.
Temperature in Celsius message
When the joystick
RIGHT
is pressed the temperature in degrees Fahrenheit is displayed on
LCD screen as shown in
for two seconds then the temperature in degrees Celsius
is
displayed again
.
Figure 14.
Temperature in Celsius message
Thanks to STM8 I2C SMBus feature, we can easily monitor the temperature variations. This
is managed by the SMBus Alert which is generating a dedicated interrupt informing the
system that the temperature is out of the selected ranges. This is very useful when a higher
temperature needs an emergency intervention like in a critical systems (motor control,
medical...).
If the temperature exceeds the over-limit high (TEMPERATURE_TOS: Over Limit
Temperature) the SMBus alert interrupt is generated and the following warning message as
shown in
is displayed on the LCD screen.
Thermometer
Temperature
Temperature
+xx.x C
Temperature
+xxx.x F
www.BDTIC.com/ST