ST STM8S User manual

February 2010 Doc ID 15330 Rev 4 1/23
UM0671
User manual
STM8/128-EV/TS
STM8S touch sensing evaluation board
Introduction
The STM8S touch sensing evaluation kit (STM8/128-EV/TS) provides a platform that
introduces users to STMicroelectronics capacitive touch sensing firmware library.
The kit contains an STM8S touch sensing (TS) evaluation daughterboard (STM8Sxxx-TS1)
in addition to the STM8/128-EVAL board.
The STM8S touch sensing evaluation daughterboard provides an evaluation platform for
resistor-capacitor (RC) touch sensing technology for an implementation using 5 keys and
one slider.
The STM8S TS evaluation kit provides a software solution for transforming any 8-bit STM8
microcontroller (MCU) into a capacitive touchkey controller.
For further details about the touch sensing software library, please read the technical
documentation available on www.st.com/touch-sense-sw-lib.
Figure 1. STM8S touch sensing evaluation kit
www.st.com
Downloaded from Arrow.com.

Contents UM0671
2/23 Doc ID 15330 Rev 4
Contents
1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 Getting started with the touch sensing evaluation kit . . . . . . . . . . . . . . 4
2.1 Evaluation kit contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.2 Using the evaluation kit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.3 User interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3 Evaluation kit board settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.1 STM8S touch sensing daughterboard . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.1.1 Dielectric . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.1.2 Daughterboard MCU pin functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.1.3 Daughterboard power supply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.1.4 SWIM connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.1.5 Analysis connectors (J2 and J3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.1.6 External supply and communication . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.2 STM8S2xx evaluation motherboard settings . . . . . . . . . . . . . . . . . . . . . . 13
4 Advanced evaluation using a debugging environment . . . . . . . . . . . . 15
4.1 Running the evaluation firmware in debug mode . . . . . . . . . . . . . . . . . . . 15
4.2 Entering debug mode using RLink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.3 Exploring key structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Appendix A STM8Sxxx-TS1 daughterboard schematics . . . . . . . . . . . . . . . . . . 21
Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Downloaded from Arrow.com.Downloaded from Arrow.com.

UM0671 Overview
Doc ID 15330 Rev 4 3/23
1 Overview
This solution enables designers, comfortable with the use of standard microcontrollers, to
create higher-end “look and feel” user interfaces by replacing conventional electro-
mechanical switches with touch sensing controls.
Designers can combine touch sensing functions with traditional MCU features
(communication, LED control, beeper, LCD control, etc.).
The touch sensing firmware library is part of the application firmware.
Maturity, robustness, flexibility and performance make this solution simple to implement with
a low “time to market” period making it easy to develop all types of applications including
mobile phones, cooking appliances and printers only to name a few.
The STM8S TS evaluation kit comes pre-programmed with evaluation firmware that
manages 5 touch keys and one slider all available on the touch sensing daughterboard.
Using this kit, the user can easily evaluate the touch sensing software features and
performances by monitoring sensing parameters using an LCD display interface.
In development mode, designers are able to debug, modify, adapt or integrate the touch
sensing library in application firmware using a USB debugging and programming tools:
●Raisonance RLink debugger/programmer for ST microcontrollers
●STice in-circuit emulation system
●ST MCU Toolset with ST Visual Develop (STVD) IDE and ST Visual Programmer
(STVP) programming interface
Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.

Getting started with the touch sensing evaluation kit UM0671
4/23 Doc ID 15330 Rev 4
2 Getting started with the touch sensing evaluation kit
2.1 Evaluation kit contents
The STM8S touch sensing evaluation kit (STM8/128-EV/TS) contains:
●STM8S touch sensing evaluation daughterboard (STM8Sxxx-TS1)
●STM8/128-EVAL board
●AC/DC power supply and its AC adaptors
●MCU selection guide
●User manual (this document)
IMPORTANT: The STM8 TS library, STM8 Toolset, STM8S firmware library and related
documentation are available at www.st.com/touch-sense-sw-lib
2.2 Using the evaluation kit
After connecting the motherboard to the mains supply, the evaluation kit is ready for use.
Just use the joystick to navigate through the menu options as described in Section 2.3: User
interface.
The evaluation firmware enables the user to quickly evaluate the main features of the touch
sensing library.
Figure 2. TS evaluation kit assembly
Daughterboard
Motherboard
Pre-programmed
STM8S sample
SWIM connector
Joystick
Reset
Power supply LCD display
Exit sub-menu
Enter sub-menu
Scroll right
Scroll left
Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.

UM0671 Getting started with the touch sensing evaluation kit
Doc ID 15330 Rev 4 5/23
2.3 User interface
The joystick is the main user interface used to display keys values and state or to modify the
main touch sensing library parameters: de-bounce filter, detection time-out, low power
mode, DES setting, etc.
Note: The 5 touch sensing keys are also for navigating through the touch sensing menu.
Figure 3. Navigation scheme
1. After power on, to quickly display the key and slider states (display option 1), move the joystick once to the right (→) and
twice towards the bottom (↓).
Decrement
Resolution Increment
Resolution
**Menu**
Help push
down (1)
**Menu**
Key info **Menu**
Detect
TIMEOUT
**Menu**
De-bounce
Filter
**Menu**
Low Power
Mode
**Menu**
DES Setting **Menu**
About
Exit sub-menu
Enter sub-menu
Scroll right
Scroll left
Menu entry point
Detect
TIMEOUT
00 sec
De-bounce
Filter
3
Low Power
Mode
128 mSec
DES Setting
Disable
STM8S Touch
Eval Vx.x.x
1
2
3
4
**Menu**
Sel Key
summary
**Menu**
Select Key X **Menu**
Select slider
K1 K2 K3 K4 K5
Slider Bar: = = = = = = = = STATE Key X
Idle or Detected KeyX Sig=0x0184
KeyX Ref=0x015E Noise rejection
Counter KeyX
0000
Slider STATE
Idle or Detected S Sig=0x92
S Pos=0x09
< Resolution <
x bits
Display
sub-menus
1 2 3 45 6
Counter
RESET
Parameter
setting
sub-menus
S Resolution
x bits 7
Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.

Getting started with the touch sensing evaluation kit UM0671
6/23 Doc ID 15330 Rev 4
Display options
Use the joystick to navigate through the sub-menus as shown in Figure 3 to do the following:
1. Display the state of keys (K1, K2, K3, K4 and K5) and slider on the same screen.
2. Display only the state of the selected key (Kx) (Idle or Detected).
3. Display the signal value and the reference threshold of the selected Key (Kx).
4. Display the number of samples rejected by the noise filtering system.
5. Display the state of the slider (Idle or Detected).
6. Display the signal value and the position of the slider.
7. Display/change slider resolution (default is 4 bits, may be set to up to 7 bits).
Parameter setting options
Use the joystick to navigate through the sub-menus as shown in Figure 3 to set the following
options:
1. Detection time-out
This feature automatically recalibrates keys after a fixed duration of continuous touch
detection. This prevents the keys from becoming 'stuck on' due to foreign objects or
other sudden influences. This is known as the detection time-out feature.
After recalibration, the keys will continue to operate normally, even if partially or fully
obstructed.
Infinite timeout (detection time-out value = 0) is useful in applications where a
prolonged detection can occur and where the output must reflect the detection
regardless of its duration.
2. De-bounce filter
The de-bounce filter reduces the effects of low frequency noise on key states. This
mechanism requires a specified number of measurements that qualify as detections
(and these must occur consecutively) or the detection will not be reported.
In a similar manner, the end of a touch (loss of signal) also has to be confirmed over
several measurements. This process acts as a type of “de-bounce” mechanism against
noise.
The typical value is equal to 2.
3. Low power mode
To reduce device power consumption, this feature inserts a low power mode window
between each key acquisition period.
This window duration is programmable with the following typical values (in
milliseconds): 0, 1, 2, 4, 8, 16, 32, 64, and 128.
4. Detection Exclusion System
The Detection Exclusion System (DES) prevents multiple keys from responding to a
single touch. This can happen with closely spaced keys.
Once a key is considered as “touched”, all other keys are locked in an untouched state.
To unlock these keys, the touched key must return to an untouched state.
Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.

UM0671 Evaluation kit board settings
Doc ID 15330 Rev 4 7/23
3 Evaluation kit board settings
3.1 STM8S touch sensing daughterboard
Figure 4. STM8S TS daughterboard overview
STM8S MCU
This board uses a STM8S microcontroller (STM8S207K6T6C) in a 32-pin LQFP package.
Keys
The 5 touchkeys (electrodes) are made of a simple copper surface.
4 direction keys
1 selection key
Slider
Connectors to
board Analysis
I2C connector
SWIM
STM8S MCU
connectors
connector
STM8/128-EVAL
and jumper
IDD measurement
Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.

Evaluation kit board settings UM0671
8/23 Doc ID 15330 Rev 4
Slider
The slider consists of 5 elementary juxtaposed electrodes.
Analysis connectors
All electrode and driven shield signals are available through two connectors (J2 and J3) for
analysis and monitoring.
I2C communication connector
In the event of I2C communication, the daughterboard provides a connector (J6) for the I2C
data and clock signals for interfacing with the STM8S microcontroller.
SWIM connector and setting jumper
A single-wire interface module (SWIM) interface (J5) with its associated jumper (W1) for
analysis and development.
3.1.1 Dielectric
A 1.5-mm thick Plexiglas panel (Figure 5) is used as a dielectric between the electrodes and
the touch surface. The user can replace this panel by another kind of dielectric with a
different thickness and/or material. Consequently, new firmware parameters will have to be
tuned.
Figure 5. Interchangeable dielectric panel
3.1.2 Daughterboard MCU pin functions
Table 1 describes the application functions assigned to each pin of the daughterboard
microcontroller.
The motherboard provides certain resources for the daughterboard such as the LCD, power
supply, LEDs, joystick, buzzer, etc.
For more information, see Section 3.2: STM8S2xx evaluation motherboard settings.
Screw holes
Table 1. Daughterboard MCU pin description
Pin no. Pin name Application usage Option Configuration
1RST
2 PA1 LED4 Disconnect R17
3 PA2 Backlight
Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.

UM0671 Evaluation kit board settings
Doc ID 15330 Rev 4 9/23
Note: Options are selected using 0-ohm resistors.
4VSS
5VCAP
6VDD
7VDDIO_1
8 PF4 Load
9VDDA
10 VSSA
11 PB5 LED2 I²C SDA R43
12 PB4 LED3 I²C SCL R42
13 PB3 Joy Down
14 PB2 Joy Left
15 PB1 Joy Right
16 PB0 Joy Up
17 PE5 LCD CS
18 PC1 Key K1
19 PC2 Key K2
20 PC3 Key K3
21 PC4 Buzzer Driven shield keys R4/R46
22 PC5 SPI SCK
23 PC6 SPI MOSI
24 PC7 Key K4
25 PD0 Key K5
26 PD1 DB SWIM connector MB SWIM connector W1
27 PD2 Slider S5
28 PD3 Slider S4
29 PD4 Slider S3
30 PD5 Slider S2
31 PD6 Slider S1
32 PD7 Driven shield slider LED1 R45/R44
Table 1. Daughterboard MCU pin description (continued)
Pin no. Pin name Application usage Option Configuration
Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.

Evaluation kit board settings UM0671
10/23 Doc ID 15330 Rev 4
Table 2. Daughter/motherboard CN1 and CN5 header connections
Motherboard connector
(STM8/128-EVAL board) Daughterboard connector
(STM8S2Kxxx-TS1)
1 2
3 4
5 6
7 8
9 10
11 12
13 14
15 16
17 18
19 20
21 22
23 24
25 26
27 28
29 30
31 32
33 34
35 36
37 38
39 40
41 42
43 44
45 46
47 48
49 50
+3V3
D5V
PE0
2EP1EP
4EP3EP
PE5
PE6PE7
1GP0GP
3GP2GP
PG4
6GP5GP
PG7
PH4
6HP5HP
PH7
1IP0IP
3IP2IP
5IP4IP
PI6
PI7
PC0
2CP1CP
PC3
5CP4CP
7
CP6CP
CN1 header
1 2
3 4
5 6
7 8
910
11 12
13 14
15 16
17 18
19 20
21 22
23 24
25 26
27 28
29 30
31 32
33 34
35 36
37 38
39 40
41 42
43 44
45 46
47 48
49 50
Header 25X2
PD0
PD2
PD4
PD6
PE5
PB0
PB1
PB3
PB2
PD3
PD5
PD1
D5V
RST R41
J1 header
PB4
PD7
PF4
PB5
R16
820
2ontheleft
1 2
3 4
5 6
7 8
9 10
11 12
13 14
15 16
17 18
19 20
21 22
23 24
25 26
27 28
29 30
31 32
33 34
35 36
37 38
39 40
41 42
43 44
45 46
47 48
49 50
D5V
PF0PF1
PF2PF3
PF4PF5
PF6
PF7
PH0
2HP1HP
PH3
PD0
2DP1DP
4DP3DP
6DP5DP
PD7
PA1PA2
PA3PA4
PA5PA6
PB0
PB1PB2
PB3PB4
PB5
PB6PB7
PA0
RESET#
CN5 header
1 2
3 4
5 6
7 8
910
11 12
13 14
15 16
17 18
19 20
21 22
23 24
25 26
27 28
29 30
31 32
33 34
35 36
37 38
39 40
41 42
43 44
45 46
47 48
49 50
Header 25X2
+3.3V
D5V
PC6
PC3
PC1 PC2
PC5
PC7
PA2
J4 header
PC4
Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.

UM0671 Evaluation kit board settings
Doc ID 15330 Rev 4 11/23
3.1.3 Daughterboard power supply
By default, the daughterboard is powered through the motherboard. The 3.3 V regulator on
the daughterboard supplies the daughterboard MCU.
The MCU current consumption (IDD) can be measured by removing jumper W2.
3.1.4 SWIM connections
The STM8 debug system interface allows a debugging or programming tool to be connected
to the MCU through a single-wire bidirectional communication based on open-drain line.
This single-wire interface module (SWIM) module allows non-intrusive read/write accesses
to be performed on-the-fly to the RAM and peripheral registers, for debug purposes.
The SWIM module can also perform a MCU device software reset and can also be used by
as a standard I/O port with some restrictions.
Jumper W1 is used to configure SWIM settings as described in Table 3.
For more information, please refer to user manual UM0470: STM8 SWIM communication
protocol and debug module.
Figure 6. SWIM connector (top view)
Note: The SWIM connector of the STM8/128-EVAL board cannot be used.
Table 3. W1 jumper description
Configuration Description
Uses STM8S TS daughterboard SWIM connector (default setting)
Connect PD1of STM8S TS daughterboard device to resource of STM8S/128-
EVAL board.
Table 4. SWIM connector pin description
Pin number Description Pin number Description
1VDD 2PD1
3 GND 4 PA0 (RESET)
123
123
1 2 3 4
Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.

Evaluation kit board settings UM0671
12/23 Doc ID 15330 Rev 4
3.1.5 Analysis connectors (J2 and J3)
Application designers can use connectors J2 and J3 to analyze electrode and driven shield
signals on the daughterboard.
Note: The user should take into account possible probe capacitance disturbance and should
consider re-calibrating the device before use.
3.1.6 External supply and communication
Connector J6 provides I2C data and clock signal pins for communication with the
daughterboard microcontroller. The user can use these pins to develop his own
communication protocol.
Resistors R36 and R37 are available as I2C pull-up resistors and can be mounted by the
user if needed.
Note: If the device is supplied by pin 1 and 5, jumper W2 must not be connected.
Pin 2 is connected to PA1 and is available for user implementation. For example, it may be
used for acquisition synchronization.
Table 5. J2 connector pin description
Pin number Description Pin number Description
Shield Slider 1 active shield K3 Key 3 electrode
K1 Key 1 electrode K4 Key 4 electrode
K2 Key 2 electrode K5 Key 5 electrode
Table 6. J3 connector pin description
Pin number Description Pin number Description
S1_1 Slider 1 electrode 1 S1_4 Slider 1 electrode 4
S1_2 Slider 1 electrode 2 S1_5 Slider 1 electrode 5
S1_3 Slider 1 electrode 3 Shield Slider 1 active shield
Table 7. J6 connector pin description
Pin number Description Pin number Description
1 VSS 4 I2CSDA
2PA1 5VDD
3I2CSCL
Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.

UM0671 Evaluation kit board settings
Doc ID 15330 Rev 4 13/23
3.2 STM8S2xx evaluation motherboard settings
Figure 7. TS motherboard overview
When using the STM8S TS daughterboard assembled with the STM8/128-EVAL (mother)
board, the following settings must be implemented:
●To maintain STM8S TS daughterboard MCU functionality, the Reset Source (JP1)
jumper must be set to the “STice” position (Table 8) on the STM8/128-EVAL board.
●To supply power from the supply jack (CN6) to both mother and daughterboards
connected on connectors CN5 and CN1:
– On STM8S TS daughterboard, connect both pins on jumper W2 (Section 3.1.3).
– On STM8/128-EVAL board, set jumper JP3 as shown in Table 8. (STM8S TS
daughterboard must have not its own power supply connected.)
For more information about the STM8/128-EVAL board, please refer to UM0482: STM8/128-
EVAL evaluation board user manual.
CN5 header
Joystick
LCD display
Reset
Jumper JP3
CN1 header
Power supply
Jumper JP1
Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.

Evaluation kit board settings UM0671
14/23 Doc ID 15330 Rev 4
Table 8. STM8/128-EVAL board settings
Jumper Description Configuration
JP1 Set to “STice” to keep motherboard MCU Reset pin low to enable
correct TS daughterboard MCU functionality. (Default configuration)
JP3 Connect both PSU and DTB jumpers to supply power supply the TS
daughterboard. (Default configuration)
123
12
12
DTB PS
U
Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.

UM0671 Advanced evaluation using a debugging environment
Doc ID 15330 Rev 4 15/23
4 Advanced evaluation using a debugging environment
4.1 Running the evaluation firmware in debug mode
Designers can easily run the evaluation firmware in Debug mode using ST debugging and
programming tools.
●Hardware tools to be ordered separately:
– Raisonance RLink debugger/programmer for ST microcontrollers
(www.raisonance.com/)
– STice in-circuit emulation system
●Software tools to be downloaded separately:
– ST MCU Toolset with ST Visual Develop (STVD) IDE and ST Visual Programmer
(STVP) programming interface
– STM8 Cosmic C compiler (www.cosmic-software.com/)
In Debug mode, designers can perform an in-depth evaluation of the firmware and visualize
touch sensing parameters. Designers can even customize the touch sensing library to their
specific needs by creating their own application firmware.
For further information about ST software, STM8 microcontrollers or debugging tools,
please read the associated documentation or ask your local ST support team for a training
session. More information is available at www.st.com/touch-sense-sw-lib
4.2 Entering debug mode using RLink
This section describes the steps necessary to set up a platform for evaluating and
developing TS firmware.
Note: For links to tools and downloads, please refer to ST’s microcontroller web site at
www.st.com/mcu/.
1. Download and install the ST MCU Toolset with ST Visual Develop (STVD) IDE and ST
Visual Programmer (STVP) programming interface (one single download).
2. Download and install the STM8 cosmic C compiler.
3. Install the Rlink USB driver using one of the two following methods:
– Insert the RAISONANCE CD-ROM into your CD drive and exit from Autorun.
Explore the CD-ROM contents and execute the RLinkUSBInstall.exe file in the
D:\Driver\RlinkDrv directory.
– Download the RLinkUSBInstall.exe file from the Raisonance web site and execute
the file.
4. Restart your computer to apply these changes.
5. Install the RLink hardware:
a) Place jumpers on the “SWIM” and “ADAPT” RLink configuration pins of the Rlink
USB adaptor as shown in Figure 8.
b) Connect the SWIM-STM8 adaptor to the RLink USB adaptor.
c) Connect the SWIM cable between the touch sensing daughterboard (J5 SWIM
connector) and the SWIM-STM8 adaptor as shown in Figure 9.
d) Connect the USB cable between your PC and the RLink USB adaptor.
e) Power the TS daughterboard through the STM8S2xx evaluation board.
Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.

Advanced evaluation using a debugging environment UM0671
16/23 Doc ID 15330 Rev 4
Figure 8. RLink configuration jumpers
Figure 9. RLink USB and SWIM configuration
6. Download the STM8 touch sensing library from www.st.com/touch-sense-sw-lib
7. Launch the ST Visual Develop (STVD) integrated development environment.
8. Load the STM8 TS evaluation firmware (Figure 10):
– In the “File” menu, click “Open workspace” and select/open the file
STM8S20xK_TS1_EVAL_FW.stw.
(Default path file @ \STM8S20xK_TS1_EVAL_FW\Project\STVD\Cosmic)
SWIM connector
Configuration jumper location
SWIM cable
SWIM/STM8 adaptor
Daughterboard
SWIM connector
Power supply
RLink USB adaptor
Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.

UM0671 Advanced evaluation using a debugging environment
Doc ID 15330 Rev 4 17/23
Figure 10. Loading the TS evaluation firmware
9. In the “Project” menu, select “Setting” to define the C cosmic location directory
(Figure 11).
Figure 11. Project settings
10. Build the project by compiling and linking all the source code.
a) In the “Build” menu, select “Rebuild all”.
b) When the process is completed, check that there are no errors and no warning
messages in the Output windows.
Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.

Advanced evaluation using a debugging environment UM0671
18/23 Doc ID 15330 Rev 4
Figure 12. Building the project
11. Select RLink as the debugging tool.
– In the “Debug instrument” menu, click “Target setting” and select “SWIM RLink” as
shown in Figure 13.
Figure 13. Debug instrument settings
12. Start the debugging process.
– In the “Debug” menu, select “Start debugging” and click “Run” (or press CTRL-F5)
to start the application in Debug mode.
Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.

UM0671 Advanced evaluation using a debugging environment
Doc ID 15330 Rev 4 19/23
Figure 14. Debug mode
Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.

Advanced evaluation using a debugging environment UM0671
20/23 Doc ID 15330 Rev 4
4.3 Exploring key structures
All key and slider data structures can be monitored through the STVD watch window.
The main “touch sensing” structures are “sSCKeyInfo” and “sMCKeyInfo”.
To learn more about library variables and function descriptions, please refer to the CHM file
available at <installation path>\STM8_TS_LIB\stm8_tsl_um.chm
Figure 15. STVD watch window
Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.Downloaded from Arrow.com.
Other manuals for STM8S
3
This manual suits for next models
1
Table of contents
Other ST Motherboard manuals

ST
ST STEVAL-IPMM10B User manual

ST
ST STM32 Nucleo-32 User manual

ST
ST STM32H743I-EVAL User manual

ST
ST STM32MP157 Series User manual

ST
ST STM32G4 Nucleo-32 User manual

ST
ST SPC584BADPT176S User manual

ST
ST EVAL-IBD002-35W User manual

ST
ST NUCLEO-F031K6 User manual

ST
ST STM8T141-EVAL User manual

ST
ST STEVAL-ISB041V1 User manual

ST
ST M24LR-DISCOVERY User manual

ST
ST STM32MP157D-EV1 User manual

ST
ST EVAL-TDA7803A User manual

ST
ST STUSB02E User manual

ST
ST EVB-LIV3F User manual

ST
ST SPC58XXADPT292S User manual

ST
ST STM32 Nucleo-64-P Series User manual

ST
ST STEVAL-SMARTAG2 User manual

ST
ST SPC572LADPT100S User manual

ST
ST STEVAL-USBPD45H Administrator Guide