Quick start guide to “charge transfer” technology used on STM32 and STM8 for touch sensing applications

For create a touch sensing there are three possibility that are:

  • Full Software Acquisition
  • Acquisition Using HW assist (2 GPIO + Timers)
  • Full HW Acquisition Dedicated Touch Sensing Controller IP (Charge Transfer) (TSC)
    The STM8/32 implement the HW touch inside that use the TSC technology.

Using STM8 and STM32, is possible use all the touch system topology explained before.

Charge transfer acquisition principle (TSC)

  • The surface charge transfer acquisition is a proven, robust and efficient way to measure a capacitance. It’s “equivalent touch sensing capacitance”.
    (see the image below)
  • It uses a minimum number of external components to operate with a single ended electrode type.
  • This acquisition is designed around an analog I/O group which is composed of four GPIOs.
  • Several analog I/O groups are available to allow the acquisition of several capacitive sensing channels simultaneously and to support a larger number of capacitive sensing channels.
  • Within a same analog I/O group, the acquisition of the capacitive sensing channels is sequential.
  • One of the GPIOs is dedicated to the sampling capacitor (CS).
  • Only one sampling capacitor I/O per analog I/O group must be enabled at a time.
  • The remaining GPIOs are dedicated to the electrodes and are commonly called channels.

CX is the parasitic capacitance of the electrode.
CX is composed of two capacitances:  the first one refers to earth, which is not significant and can be ignored, and the second one refers to the application ground, which is dependent on the PCB or the board layout.
This latter parasitic capacitance includes the GPIO pad capacitance and the coupling between the electrode tracks and the application ground.
The PCB and board layout must be designed to minimize this parasitic capacitance.

CF is the feedback capacitance between earth and the application.
Its influence is important in surface capacitance touch sensing applications, especially for applications which do not feature a direct connection to earth.

CT is the capacitance created by a finger touch and it is the source of the useful signal. Its reference is earth and not the application ground.

The total capacitance measured is a combination of CX, CF and CT where only CT is meaningful for the application.

So we measure CX plus CT in parallel with CF, which is given by the formula:

An example:
STM32F091VC, Cortex-M0, 256KB Flash in LQFP100 manages more than 10 touch keys.

Below a list of STM32F0 that show the number of touch that manage.

For more details see the documentation listed below

  • AN4312 – Guidelines for designing touch sensing applications with surface sensors
  • AN4299 – Guidelines to improve conducted noise robustness on STM32F0/F3, STM32L0/L4 series touch sensing applications
  • STM32L4 Touch Sensing Controller (TSC)
  • UM1913 – Developing applications on STM32 Cube with STMTouch® touch sensing library
  • AN3960ESD considerations for touch sensing applications on MCUs
  • AN4310Sampling capacitor selection guide for MCU based touch sensing
  • AN2927 – Resistor-Capacitor (RC) acquisition principle for STM8S touch sensing applications – See an example here.

For obtain the best performances for touch implementations (TSC), we suggest to use this STM32 families: