
UM1000
Demonstration applications
Doc ID 17964 Rev 1
7/23
3.4 Calendar
demo
The STM8L15x features a real-time clock (RTC) including an independent BCD
timer/counter, time-of-day clock /calendar, a software programmable alarm, and a periodic
programmable wakeup flag with interrupt capabilities that can be used to exit the device
from Low power modes.
The calendar submenus allow to configure the system time, date and alarm.
3.4.1 Setting
the
time
The
TIME
submenu offers two options allowing to adjust and display the current time. Once
set, the time is used to configure the RTC time.
Time adjust
Use the
Time adjust
option either to modify the current time, or to change the time to the
current time after the STM8L1528-EVAL evaluation board is powered up.
1.
To set the time, select the
Time adjust
option. The
Time adjust
submenu is then
displayed to show the current time value. (see
Figure 6
).
2.
Enter the first digit of the hour field:
–
Pressing the joystick
UP
increments the current digit value.
–
Pressing the joystick
DOWN
decrements the current digit value.
The digit value is limited to a range depending on the time field (hours, minutes or
seconds).
3.
After selecting the digit value press
SEL
. The cursor then jumps automatically to the
next digit.
4.
When all the time digits are set, the
Time adjust
submenu is displayed again to show
the current time. (see
Figure 6
).
Figure 6.
Time adjust message
Time show
Select
Time show
to display the current time. The time start counter from (00:00:00) after
the first run for the demo the time is cleared if the STM8L1528-EVAL evaluation board is
powered down. The
Time adjust
option is used to configure the time.
When this option is selected, the following message is displayed on the LCD screen:
Figure 7.
Time show message
To exit from the
Time show
submenu press the joystick
UP
.
Time adjust
HH:MM:SS
Time show
HH:MM:SS
www.BDTIC.com/ST