STM8S Touch Sensing Evaluation Kit User Manual

June 5, 2024
ST

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 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 touch key 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

Overview

This solution enables designers, comfortable with the use of standard microcontrollers, to create higher-end “look and feel” user interfaces by replacing conventional electromechanical 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

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 main 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

User interface
The joystick is the main user interface used to display keys values and states 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
Menu entry point

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 ().

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.

Evaluation kit board settings

3.1 STM8S touch sensing daughterboard
Figure 4. STM8S TS daughterboard overview

STM8S MCU
This board uses an STM8S microcontroller (STM8S207K6T6C) in a 32-pin LQFP package. Keys The 5 touchkeys (electrodes) are made of a simple copper surface.
Evaluation kit board settings
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.
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

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.
Table 1. Daughterboard MCU pin description

Pin no.

| Pin name| Application usage| Option|

Configuration

---|---|---|---|---
1| RST| | |
2| PA1| LED4| Disconnect| R17
3| PA2| Backlight| |

Pin no.

| Pin name| Application usage| Option|

Configuration

---|---|---|---|---
4| VSS| | |
5| VCAP| | |
6| VDD| | |
7| VDDIO_1| | |
8| PF4| Load| |
9| VDDA| | |
10| VSS| | |
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 2. Daughter/motherboard CN1 and CN5 header connections

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.
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 an 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 debugging purposes.
The SWIM module can also perform an MCU device software reset and can also be used as a standard I/O port with some restrictions.
Jumper W1 is used to configure SWIM settings as described in Table 3.
Table 3. W1 jumper description Configuration

Configuration

|

Description

---|---
| Uses STM8S TS daughterboard SWIM connector (default setting)
| Connect PD1of STM8S TS daughterboard device to the resource of STM8S/128- EVAL board.

For more information, please refer to user manual UM0470: STM8 SWIM communication protocol and debug module.
Figure 6. SWIM connector (top view) 1

Table 4. SWIM connector pin description

Pin number

| Description| Pin number|

Description

---|---|---|---
1| VDD| 2| PD1
3| GND| 4| PA0 (RESET)

The SWIM connector of the STM8/128-EVAL board cannot be used.

Analysis connectors (J2 and J3)
Application designers can use connectors J2 and J3 to analyze electrode and driven shield signals on the daughterboard.
The user should take into account possible probe capacitance disturbance and should consider re-calibrating the device before use.
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

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 pins 1 and 5, jumper W2 must not be connected.|
Table 7. J6 connector pin description

Pin number

| Description| Pin number|

Description

---|---|---|---
1| VSS| 4| I2C SDA
2| PA1| 5| VDD
3| I2C SCL|

Pin 2 is connected to PA1 and is available for user implementation. For example, it may be used for acquisition synchronization.

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 (Ta bl e 8 ) on the STM8/128-EVAL board.
  • To supply power from the supplied jack (CN6) to both mother and daughterboards connected on connectors CN5 and CN1:

– On the STM8S TS daughterboard, connect both pins on jumper W2 (Section 3.1.3).
– On STM8/128-EVAL board, set jumper JP3 as shown in Ta bl e 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/128EVAL evaluation board user manual.
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 the power supply to the TS
daughterboard. (Default configuration)

Advanced evaluation using a debugging environment
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
Entering debug mode using RLink
This section describes the steps necessary to set up a platform for evaluating and developing TS firmware.
For links to tools and downloads, please refer to ST’s microcontroller website 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 Ralink 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.
    Advanced evaluation using a debugging environment
    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)
    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.
    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.
    Figure 14. Debug mode

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 \STM8_TS_LIB\stm8_tsl_um.chm
Figure 15. STVD watch window

Appendix A STM8Sxxx-TS1 daughterboard schematics
Figure 16. STM8Sxxx-TS1 daughterboard schematic diagram R45

Revision history
Table 9. Document revision history

Date Revision Changes
04-Feb-2009 1 Initial release.
09-Mar-2009 2 Updated Figure 3: Navigation scheme on page 5 and Display

options on page 6.
20-Mar-2009| 3| Corrected reference to STM8S touch sensing evaluation kit from “STM8/128-EVAL/TS” to “STM8/128-EV/TS”.
26-Feb-2010| 4| Updated values of C3 and C9 in Figure 16 on page 21.

Please Read Carefully:

Information in this document is provided solely in connection with ST products. STMicroelectronics NV and its subsidiaries (“ST”) reserve the right to make changes, corrections, modifications, or improvements, to this document, and the products and services described herein at any time, without notice.
All ST products are sold pursuant to ST’s terms and conditions of sale. Purchasers are solely responsible for the choice, selection, and use of the ST products and services described herein, and ST assumes no liability whatsoever relating to the choice, selection or use of the ST products and services described herein.
No license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted under this document. If any part of this document refers to any third party products or services it shall not be deemed a license grant by ST for the use of such third party products or services, or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoever of such third party products or services or any intellectual property contained therein.
UNLESS OTHERWISE SET FORTH IN ST’S TERMS AND CONDITIONS OF SALE ST DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY WITH RESPECT TO THE USE AND/OR SALE OF ST PRODUCTS INCLUDING WITHOUT LIMITATION IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE (AND THEIR EQUIVALENTS UNDER THE LAWS OF ANY JURISDICTION), OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT. UNLESS EXPRESSLY APPROVED IN WRITING BY AN AUTHORIZED ST REPRESENTATIVE, ST PRODUCTS ARE NOT RECOMMENDED, AUTHORIZED, OR WARRANTED FOR USE IN MILITARY, AIRCRAFT, SPACE, LIFE-SAVING, OR LIFE-SUSTAINING APPLICATIONS, NOR IN PRODUCTS OR SYSTEMS WHERE FAILURE OR MALFUNCTION MAY RESULT IN PERSONAL INJURY, DEATH, OR SEVERE PROPERTY OR ENVIRONMENTAL DAMAGE. ST PRODUCTS THAT ARE NOT SPECIFIED AS “AUTOMOTIVE-GRADE” MAY ONLY BE USED IN AUTOMOTIVE APPLICATIONS AT THE USER’S OWN RISK.
Resale of ST products with provisions different from the statements and/or technical features set forth in this document shall immediately void any warranty granted by ST for the ST product or service described herein and shall not create or extend in any manner whatsoever, any liability of ST.
ST and the ST logo are trademarks or registered trademarks of ST in various countries.
Information in this document supersedes and replaces all information previously supplied.
The ST logo is a registered trademark of STMicroelectronics. All other names are the property of their respective owners.
© 2010 STMicroelectronics – All rights reserved
STMicroelectronics group of companies
Australia – Belgium – Brazil – Canada – China – Czech Republic – Finland – France – Germany – Hong Kong – India – Israel – Italy – Japan -Malaysia – Malta – Morocco – Philippines – Singapore – Spain – Sweden – Switzerland – United Kingdom – United States of America
www.st.com

Doc ID 15330 Rev 4
Downloaded from Arrow.com.

References

Read User Manual Online (PDF format)

Read User Manual Online (PDF format)  >>

Download This Manual (PDF format)

Download this manual  >>

Related Manuals