Open-source touch sensing library
To help engineers implement touch-sensitive controls with minimum additional effort, cost and size, STMicroelectronics has made available an open-source capacitive touch sensing software library for its 8-bit STM8 MCU platform.
The software library transforms any 8-bit STM8 MCU into a capacitive
touch-key controller. Designers can combine touch sensing functions
through multiple configurations, such as touch keys, wheels or sliders,
while preserving the traditional STM8 MCU features for the application
firmware, including communication, LED control, beeper and LCD control.
The software is provided as royalty-free C source code and offers
engineers the flexibility to configure, adapt or accommodate the
library according to application needs.
Human touch is detected
by monitoring the charge and the discharge timing cycle of an RC
network formed by a single resistor and the touch electrode
capacitance. Depending on which STM8 variant is used, as many as 24
individual touch pads can be supported. The touch sensing library only
uses a small amount of the chip’s memory and processing capability,
allowing designers to combine other application tasks in a single
device. To optimise power consumption, the software also takes
advantage of the STM8’s low-power modes.
The touch sensing
library embeds advanced tools to help define keys, slider controls or
rotary sensors, and to optimise touch sensitivity by adjusting
parameters such as the touch detection threshold and the resolution of
sliders or rotary controls. There are also innovative programmable
features to optimise measurement accuracy and make the final
application immune to noise.
An embedded automatic calibration
software layer saves final adjustment during manufacturing and enables
faster time to market. To maximise long-term reliability the library
contains an environmental change system (ECS), which compensates for
natural fluctuations in operating voltage and capacitance, as well as
environmental effects such as temperature and humidity.
As well
as source code for the touch-sensing software library, full supporting
documentation includes the API description, a user manual for the
software library, application notes and board layout recommendations,
as well as code examples.
