UM0501
User manual
STM8/128-EVAL demonstration firmware
Introduction
This document describes the demonstration firmware running on the STM8/128-EVAL
evaluation board. You can use it to evaluate the capabilities of the microcontroller and the
on-board peripherals.
The evaluation board is delivered with the demonstration firmware stored in the Flash
program memory of the microcontroller.
The firmware is based on the STM8S firmware library, and provides an example of how to
use this library. It is divided into various smaller demonstration applications (demos).
In case the STM8/128-EVAL evaluation board is not factory-programmed or the
demonstration application has been erased, you can reprogram the demonstration firmware
into the STM8S2xx Flash memory by following the instructions provided in
Section 3.
For more information about the evaluation board itself, please read the evaluation board
user manual.
Note:
To run some of the demonstration applications, the option byte must be configured
accordingly. Refer to
Section 2.10: BEEPER demo.
June 2009
Doc ID 14320 Rev 3
5/23
www.st.com
Contents
UM0501
Contents
1
User interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.1
1.2
1.3
Menu structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Documentation conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Navigating menus and sub-menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2
Demonstration applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.1
2.2
2.3
2.4
2.5
2.6
2.7
2.8
2.9
2.10
2.11
2.12
2.13
2.14
Menu overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Welcome screen and main menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Help mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
ADC demo 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
ADC demo 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
ADC demo 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
TIMER demo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
PWM demo 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
PWM demo 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
BEEPER demo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
MICROSD demo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
GAME demo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
SYSTEM demo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
About menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3
4
5
6
Upgrading the demonstration firmware . . . . . . . . . . . . . . . . . . . . . . . . 19
STM8S peripherals used . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Demo firmware architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
6/23
Doc ID 14320 Rev 3
UM0501
User interface
1
1.1
User interface
Menu structure
The demonstration firmware user interface is based on a circular navigation menu, with
submenus, item selection and back capability.
Figure 1
shows the menu system of the demonstration. The top row of items represents the
main menu.
Figure 1.
Menu structure and navigation
WELCOME
MESSAGE
SEL
Left / Right
ITEM 1
ITEM 2
Left / Right
ITEM 3
Left/Right
...
ITEM n
SEL
SEL
SEL
Up
Up
Up
Up
ITEM
1.1
SEL
ITEM
1.2
SEL
...
Up
ITEM
1.n
SEL
ITEM
2.1
SEL
ITEM
2.2
SEL
...
ITEM
2.n
SEL
...
...
...
...
...
...
1.2
Documentation conventions
In this document, the keywords in bold indicate user actions on the joystick (5-way switch).
The KEY button (1-way switch) and the RV1 potentiometer follow the conventions shown in
Table 1.
Table 1.
Documentation conventions
User action
Press joystick to the left
Press joystick to the right
Press joystick up
Press joystick down
Press joystick center
Press KEY button
Rotate RV1 potentiometer
Keyword
LEFT
RIGHT
UP
DOWN
SEL
KEY
RV1
Doc ID 14320 Rev 3
Up
...
SEL
...
7/23
User interface
UM0501
1.3
Navigating menus and sub-menus
To navigate the menus and sub-menus, perform the following actions as required.
RIGHT:
Navigates to the next menu or sub-menu items on the right.
LEFT:
Navigates to the next menu or sub-menu items on the left.
SEL:
Enters sub-menu.
UP:
Exits from a sub-menu.
8/23
Doc ID 14320 Rev 3
UM0501
Demonstration applications
2
2.1
Demonstration applications
Menu overview
The
Figure 2
shows all the menu and submenus of the demonstration applications.
Figure 2.
Menu overview
WELCOME MESSAGE
MAIN MENU
HELP
ADC
TIMER
PWM
BEEPER
MICROSD
GAME
SYSTEM
ABOUT
PWM1
PWM2
ADC DEMO1
ADC DEMO2
ADC DEMO3
The following sections provides a detailed description of each part of the demonstration
firmware.
2.2
Welcome screen and main menu
After a board RESET, a welcome message is displayed on the first line, the ST logo is
displayed moving on the second line and a melody is played (see
Figure 3).
The introduction
melody can be changed by using either PWM demo 1 or PWM demo 2 (see
Section 2.8
and
Section 2.9).
Figure 3.
Welcome message
STM8-128K Demo
ST
Once the melody is played, the main menu is activated and the message shown in
Figure 4
is displayed.
Figure 4.
Main menu
** MENU **
HELP - push SEL
Note:
Pressing the joystick in any direction (for around 1 second) ends the melody.
Doc ID 14320 Rev 3
9/23