Page 1
It indicates where the key aspects of touch sensing are documented. It also explains how to build touch sensing applications on STM32L0538-DISCO and STM32F072B-DISCO discovery boards using the STM32CubeMx graphical interface. AN5105 - Rev 1 - September 2018 www.st.com For further information contact your local STMicroelectronics sales office.
AN5105 General information General information ® This document applies to Arm -based devices. Note: Arm is a registered trademark of Arm Limited (or its subsidiaries) in the US and/or elsewhere. AN5105 - Rev 1 page 2/52...
AN5105 Terminology and principle Terminology and principle Terminology The touch sensing most relevant acronyms are described below: • Acquisition mode – CT: Charge-Transfer acquisition principle. This mode is used on STM32 microcontrollers. • Touch sensing STM32 peripheral – TSC: touch sensing controller peripheral –...
Sampling capacitor selection guide for MCU based AN4310 Charge transfert acquisition principle overview touch sensing applications Guidelines for designing touch sensing applications AN4312 Capacitive sensing technology in ST with surface sensors AN4316 Tuning a STMTouch-based application Charge transfer periode tuning STM32L4 On Line Training...
AN5105 Document reference Document reference Figure 2. Main documentation tree shows the main documentation tree related to TSC and TSL. Figure 2. Main documentation tree Application Note overview (AN5105) Getting Started STM32 On-line Tuning with TSL Training (AN4316) (UM1913) Sampling Sensors Conducted Noise Capacitor...
STM32L4 touch sensing controller online presentation STM32L4 touch sensing controller online presentation An online training is available under our website www.st.com. Insert the STM32L4 Online Training” string in the "Search" fuction and press enter. To find it use the function "Search" and insert the strings “STM32L4 Online Training”.
AN5105 Main characteristics Main characteristics Description The following Figure 5. TSC characteristics shows all touch sensing controller (TSC) characteristics and their correlation. The TSC main characteristics are described in the following pages. Figure 5. TSC characteristics Signal Charge Noise Sensitivity Sensor threshold transfer...
AN5105 Signal threshold Figure 6. STMStudio outputs • On software side: – Relevant information are located in tsl_conf.h and tscl_user.c files. – Threshold (xx_TH) can be adjust in tsl_conf_tsc.h file.: See below an example: #define TSLPRM_TKEY_DETECT_IN_TH (64) #define TSLPRM_TKEY_DETECT_OUT_TH (60) #define TSLPRM_TKEY_CALIB_TH (56) #define TSLPRM_LINROT_DETECT_IN_TH (50) #define TSLPRM_LINROT_DETECT_OUT_TH (40)
AN5105 Charge transfer Table 3. Signal threshold usage documentation Title Chapters Developing applications on STM32Cube with UM1913 Debug with STMStudio STMTouch® touch sensing library Monitoring STMTouch driver variables using STMStudio Tuning of the Thresholds AN4316 Tuning a STMTouch-based application Touchkeys thersholds Linear and Rotary touch sensors thresholds Charge transfer The acquisition is based on the measurement of the sensor channel capacitance.
AN5105 Sensitivity Sensitivity Sensitivity is a key point in touch sensing applications. The sensitivity can be improved by: • Reduce air gap • Reduce panel thickness • Choose dielectric with higher ε • GND plane must not too close from shield and sensors •...
AN5105 Sensors Sensors • It is recommended to use the same shape for all electrodes. • The touchkeys can be customized by the drawing on the panel. TSL compensates capacitance differences. • Acquisition time and processing parameters can be optimized when electrodes have similar capacitance. Sensor size example Figure 8.
AN5105 Sensors 5.5.2 Linear or slider A linear is a set of contiguous capacitive electrodes. Figure 9. Interlaced linear touch sensor with 3 channels / 4 electrodes (half-ended electrodes design) shows a slider used on a discovery board. Figure 9. Interlaced linear touch sensor with 3 channels / 4 electrodes (half-ended electrodes design) Up to 60 mm Full band width 3.6 mm...
AN5105 Sensors 5.5.3 Rotary or wheel A rotary is a set of contiguous capacitive electrodes. Figure 10. Interlaced patterned rotary sensor with 3 channels / 3 electrodes Full band width 2.0 - 4.0 mm Tooth pitch 2.0 - 4.0 mm 0.2 - 0.3 mm 2 mm LEGEND:...
AN5105 Sensors 5.5.4 Active shield or driven shield Active shield or driven shield. (this name is used in some application notes) drives the shield plane with the same signal as the electrode. There are several advantages using Active Shield instead of a grounded shield: •...
AN5105 Layout and PCB Layout and PCB Rules to follow to improve TSC systems 5.6.1 Led rules Figure 12. Led layout example Figure 13. Example of cases where a LED bypass capacitor is required Table 11. Led rules documentation gives a list of documents containing information about led rules. Table 11.
AN5105 Layout and PCB 5.6.2 Electrode not located on PCB It is possible but it is not recommended, because when the electrode it isn't located on PCB, the sensitivity decreases and additional extra parasitic capacitances are added. Figure 14. Electrode not located on PCB example Spring Spacer (cylinder Flex PCB...
AN5105 Layout and PCB 5.6.3 Ground, shield and sensors Table 13 gives a list of documents containing information about the layout . Table 13. Layout documentation Title Chapters • PCB and Layout Guidelines for designing touch sensing applications AN4312 • Ground considerations with surface sensors •...
AN5105 Layout and PCB Figure 17. Track routing Figure 18. Track routing recommendation At least 2 mm (4 - 5 mm is recommended) At least Ground plane or twice the ground track Any application track track width (LED, power, Com.) As thin as At least twice the panel thickness...
AN5105 Layout and PCB Figure 19. Shield Top layer Bottom layer Ground plane Track width (W) ~ 0.21 3 x W 3-4 mm Active shield Sense plate AN5105 - Rev 1 page 19/52...
AN5105 Layout and PCB 5.6.4 System keys points: • Direct connection between earth and board ground is required to avoid conducted noise issues. • Conductive painting on the front panel must be avoid. • Robust mechanical assembly is required. Layout keys points: •...
AN5105 Noise Noise Noise is a key point for touch sensing applications. Noise can come from Power supply. 5.7.1 Power supply Main rules to follow: • Place Buzzer and LED before LDO. • Place LDO close to MCU. Figure 20. Typical power supply schematic LEDs Touch sensing...
AN5105 Noise 5.7.3 Noise immunity Noise filtering can be done on hardware and software (TSL) sides. Table 16. Noise immunity documentation gives a list of documents containing information about the noise immunity. Table 16. Noise immunity documentation Title Chapters Developing applications on STM32Cube with UM1913 Noise filters STMTouch®...
AN5105 Tuning Tuning For tuning purpose dedicated application note are available. Sensors Table 18. Sensors documentation gives a list of documents containing information about the sensor. Table 18. Sensors documentation Title Chapters Guidelines for designing touch sensing applications AN4312 All chapters with surface sensors Table 19.
AN5105 Getting started TSC with STM32CubeMX Uses cases How to set-up an TSC application based on TSL is esplained in the following two examples. These examples describe the way to set-up TLS on STM32F072B-DISCO and STM32L0538-DISCO discovery boards. This description can be used as example to set-up others TSC series such us L4, F3, L0, L1 and L4. An STM32CubeMX new feature is available from version 4.24.0.
The STM32F072 Discovery kit helps the user to discover the STM32F072, which has the full set of features available in the STM32F0 Series, and to develop his applications easily. It includes everything required for beginners and experienced users to get started quickly.
AN5105 Discovery board: STM32F072B-DISCO 7.2.2 STM32F072B-DISCO TSC group and sensor activation To activate the TSC group, sampling capacitors and sensor channels follows the below steps: • activate TSC according schematics information. • desactivate unrelevant peripheral like USB, SPI, NCF(L0), EPaper(L0), MFX(L0) SWD peripheral must be set according to Figure 24 Figure 24.
AN5105 Discovery board: STM32F072B-DISCO 7.2.4 STM32F072B-DISCO touchsensing library To activate the TLS usage, switch on TOUCHSENSING box configuration. Figure 28. TOUCHSENSING box configuration Select three channels Linear slider and assign dedicated Gx_IOy (see previous chapter or schematics for details). • For training purpose, we can used three channels Linear slider as three keys sensors.
AN5105 Discovery board: STM32F072B-DISCO 7.2.5 STM32F072B-DISCO software project generation Now, it is possible to generate the complete software project based on TSC HAL and TSL. Figure 34 Figure 37 show all these steps. Figure 34. STM32F072B-DISCO software generation step1 Figure 35. STM32F072B-DISCO software generation step2 AN5105 - Rev 1 page 32/52...
AN5105 Discovery board: STM32F072B-DISCO Figure 38. STM32F072B-DISCO setup Now the system is functional and ready to be used. Led will blink according finger position on slider. AN5105 - Rev 1 page 35/52...
It offers everything required for beginners and experienced users to get started quickly and develop applications easily. Based on an STM32L053C8T6, it includes an ST-LINK/V2-1 embedded debug tool interface, linear touch sensor, IDD current measurement, 2.04” E-paper display, NFC connector for PLUG-CR95HF-B board, LEDs, pushbuttons and a USB Mini-B connector.
AN5105 Discovery board: STM32L0538-DISCO 7.3.2 STM32L0538-DISCO TSC group and sensor activation To activate the TSC group, sampling capacitors and sensor channels follows the below steps: • Activate TSC according schematics information. • You can deactivate unrelevant peripheral like USB, SPI, NCF(L0), EPaper(L0), MFX(L0) SWD peripheral must be set according to Figure Figure 41.
AN5105 Discovery board: STM32L0538-DISCO 7.3.4 STM32L0538-DISCO touchsensing library To activate the TLS usage, switch on TOUCHSENSING box configuration. Figure 45. TOUCHSENSING box configuration Select 3 channels Linear slider and assign dedicated Gx_IOy (see previous chapter or schematics for details). For training purpose, the user can: •...
AN5105 Discovery board: STM32L0538-DISCO 7.3.5 STM32L0538-DISCO software project generation Now, it is possible to generate the complete software project based on TSC HAL and TSL. See details in Figure 51 Figure Figure 51. STM32L0538-DISCO software generation step1 Figure 52. STM32L0538-DISCO software generation step2 AN5105 - Rev 1 page 43/52...
AN5105 Discovery board: STM32L0538-DISCO 7.3.6 STM32L0538-DISCO software basic algorithm Below is showed an example to show keys usage instead of slider usage. • Open your IDE and in main.c file add the following lines: /* USER CODE BEGIN 3 */ extern TSL_TouchKey_T MyTKeys[];...
Page 49
AN5105 List of tables List of tables Table 1. Change transfer principle documentation ........... 4 Table 2.
Page 50
AN5105 List of figures List of figures Figure 1. Change transfer principle ............. 4 Figure 2.
Page 51
AN5105 List of figures Figure 53. STM32L0538-DISCO complete project overview..........44 Figure 54.
Page 52
ST’s terms and conditions of sale in place at the time of order acknowledgement. Purchasers are solely responsible for the choice, selection, and use of ST products and ST assumes no liability for application assistance or the design of Purchasers’...
Need help?
Do you have a question about the STM32F0 Series and is the answer not in the manual?
Questions and answers