dm00085385

AN4299
Application note
Guidelines to improve conducted noise robustness on
STM32F0/F3, STM32L0/L4 series touch sensing applications
Introduction
Immunity of touch sensing systems to conducted RF voltage is required at different level
depending on applications (home appliances, automotive, health care, …). Moreover, touch
sensing systems are often designed with the requirement to meet industry standards,
especially in the EMC compliance domain.
It is important to understand the environment in which the touch application will be used,
and apply adapted techniques to address the effects of unwanted noise disturbances.
This application note provides basic overview of conducted immunity testing and some
guidelines to keep the system reliable when it is exposed to conducted noise.
Note:
STMicroelectronics is providing free STMTouch touch sensing firmware libraries which are
available either as standalone packages (32F0-TOUCH-LIB) or directly integrated into the
corresponding STM32Cube package (STM32CubeL0, STM32CubeF0, …).
Table 1. Applicable products
Type
Microcontrollers
December 2015
Applicable products
STM32F0 series, STM32F3 series, STM32L0 series, STM32L4 series.
DocID024663 Rev 3
1/20
www.st.com
Contents
AN4299
Contents
1
Conducted noise immunity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.1
Signal to Noise ratio (SNR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2
IEC61000-4-6 standard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2.1
Test setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2.2
Injected signal characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.2.3
Noise immunity evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.2.4
IEC61000-4-6 standard limitation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2
Surface charge transfer acquisition principle overview . . . . . . . . . . . . 8
3
Test set up proposal to detect worst case . . . . . . . . . . . . . . . . . . . . . . . 9
4
5
3.1
Test setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.2
Generator settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.3
Data logging and data processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
How to improve noise immunity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
4.1
Proposed improvement techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
4.2
Active Shield . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.3
Spread Spectrum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.4
Threshold adjustment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4.5
SW filter (debounce) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
STM32303C-EVAL board example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
5.1
Firmware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
5.2
Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
5.3
Conducted noise evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
6
Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
7
Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2/20
DocID024663 Rev 3
AN4299
List of tables
List of tables
Table 1.
Table 2.
Table 3.
Table 4.
Applicable products . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Test levels. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
User configuration settings related to immunity improvements . . . . . . . . . . . . . . . . . . . . . 17
Document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
DocID024663 Rev 3
3/20
3
List of figures
AN4299
List of figures
Figure 1.
Figure 2.
Figure 3.
Figure 4.
Figure 5.
Figure 6.
Figure 7.
Figure 8.
4/20
Standard IEC61000-4-6 test setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Injected signal. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Charge transfer equivalent capacitance model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Test condition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Data processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Active Shield . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Electrode and Active Shield Waveforms. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Waveform detail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
DocID024663 Rev 3
AN4299
Conducted noise immunity
1
Conducted noise immunity
1.1
Signal to Noise ratio (SNR)
Signal to noise ratio (SNR) is an important characteristic in the evaluation of a touch sensing
system.
SNR measurement results are only valid for a specified board and for the noise environment
at the moment of the measure. This is why the noise immunity is better evaluated by
referring to a standard like IEC61000-4-6 where the noise level and the test conditions are
specified.
1.2
IEC61000-4-6 standard
The IEC61000-4-6 standard specifies the test procedure to evaluate the noise immunity of
an EUT (equipment under test).
1.2.1
Test setup
The test consists in using a noise generator to inject modulated noise signals into the EUT
power supply lines as shown in Figure 1.
Figure 1. Standard IEC61000-4-6 test setup
9''
'&
SRZHU
VXSSO\
(87
HTXLSPHQWXQGHU
WHVW
966
P
(DUWK
*HQHUDWRU
QRLVHVRXUFH
5
5
069
Touch sensing systems are based on capacitor variation measurements. The system must
be able to detect capacitive variations as low as few picofarads on the sensor electrodes.
Therefore such systems may be sensitive to conducted noise.
In a real touch sensing system, the main source of perturbation is introduced by the finger of
the user. This is because the user is in the electric path between the system and the earth.
In the test setup shown in Figure 1, the injected signal simulates the noise perturbations to
which a system may be exposed. By varying the frequency and the level of the injected
signal, the test setup allows to characterize the situations where the touch system becomes
unreliable.
DocID024663 Rev 3
5/20
19
Conducted noise immunity
1.2.2
AN4299
Injected signal characteristics
The injected signal is a swept modulated noise source with a sine wave envelope as shown
in Figure 2:

The noise generator frequency range is swept from 150 kHz to 80 MHz. The frequency
is swept incrementally, the step size shall not exceed 1 % of the preceding frequency
value.

The signal is 80 % amplitude modulated with a 1 kHz sine wave.
Figure 2. Injected signal
The modulated noise signal amplitude may be expressed either in Vrms or Vpp. Here is the
formula to convert values from Vrms to Vpp:
Vpp value = Vrms  2  1.8  2
6/20
DocID024663 Rev 3
AN4299
1.2.3
Conducted noise immunity
Noise immunity evaluation
The EUT noise immunity is evaluated by testing the ability of the EUT to behave according
the definition of a given Class when it is submitted to a given noise level. The Table 2 below
summarizes the different noise levels and Classes.
Table 2. Test levels
Level 1
1 Vrms
Level 2
3 Vrms
Level 3
10 Vrms
Class A: system work normally
Pass/fail
Pass/fail
Pass/fail
Class B: Some degradation in operation may
occur (false touch detection or touch masking),
but the product recovers once the stress is
removed without any operator intervention
Pass/fail
Pass/fail
Pass/fail
Class C: same as class B but need external
action (such as reset or power off/on) to return
to normal state
Pass/fail
Pass/fail
Pass/fail
Class D: system that losses function or
degradation of performance which is not
recoverable
Pass/fail
Pass/fail
Pass/fail
Standard class \ noise level
1.2.4
IEC61000-4-6 standard limitation
As mentioned above, the minimum frequency step recommended by the standard to sweep
the injected signal from 150 kHz to 80 MHz is 1 % of the preceding frequency value. At
500 kHz this represents a 5 kHz step. On most touch sensing systems, these steps are too
large to be able to isolate the worst case situations. Some applications with narrow critical
wave band can pass 3Vrms if the critical frequency falls just in the middle between tested
frequencies, whereas the same application does not pass 1 Vrms if you set the test exactly
on the critical frequency.
This is why it is important to set smaller steps around the critical frequencies. Sometime the
standard bench is not able to do the appropriate step (for example 100Hz). Section 3
proposes a method to detect the worst case.
DocID024663 Rev 3
7/20
19
Surface charge transfer acquisition principle overview
2
AN4299
Surface charge transfer acquisition principle
overview
STM32F0, STM32F3 and STM32L0 series use a surface charge transfer acquisition
principle. This principle is briefly described below.
The surface charge transfer acquisition principle consists in charging a sensor capacitance
(Cx) and transferring a part of the accumulated charge into a sampling capacitor (Cs). This
sequence is repeated until the voltage across Cs reaches a given threshold (VIH in our
case). The number of charge transfers required to reach the threshold is a direct
representation of the size of the electrode capacitance.
When the sensor is touched, the sensor capacitance to the earth is increased so the Cs
voltage reaches the threshold with less count and the measurement value decreases. When
the measurement value falls below a defined threshold, a detection is reported.
Noise injection disturbs the measurement proportionally to its amplitude and depending on
its frequency. Worst case is generally found at a noise frequency close to the charge
transfer frequency (assuming no techniques are used to spread this frequency).
Figure 3. Charge transfer equivalent capacitance model
9''
8VHUILQJHU
6HQVRUFDSDFLWRU
&[
670
0&8
3DUDVLWLF
FDSDFLWRU
&S
966
6DPSOLQJ
FDSDFLWRU
&V
WRXFKNH\
VHQVRU
HOHWURGH
+XPDQ
ERG\
FRXSOLQJ
WRHDUWK
&RQGXFWHGQRLVHSDWK
,QMHFWHG
QRLVH
069
8/20
DocID024663 Rev 3
AN4299
3
Test set up proposal to detect worst case
Test set up proposal to detect worst case
Most of the IEC61000-4-6 compliant generators do not offer the ability to generate a step
smaller than 1 kHz. As previously indicated, to determine the most critical noise frequency, it
is generally required to use 100 Hz steps or even 10 Hz steps. The following setup is an
alternative to find out the most critical noise frequencies and to evaluate the robustness of
the EUT at these frequencies.
Note:
The noise frequencies impacting the equipment are generally around the charge transfer
frequency and up to 40MHz. Higher noise frequency does not have an impact on the
equipment operation.
3.1
Test setup
In order to simulate a human finger, a copper coin (from10 to16 mm diameter) with a 500 Ω
serial resistor connected to GND can be used.
The CDN adaptor is the same as the one used in IEC61000-4-6.
Figure 4. Test condition
6LQH
JHQHUDWRU
5
5
5
&RLQ
&'1
86%WR3&
),/7(5
6HQVRU
3DQHO
3&%
86%
%RDUGXQGHUWHVW
069
DocID024663 Rev 3
9/20
19
Test set up proposal to detect worst case
3.2
AN4299
Generator settings
1.
Select “sine wave” and “sweep” mode.
2.
Sweep menu: time = 300 sec, return time = 0, linear, interval = 1 ms
3.
Set Vpp value on the generator to obtain the corresponding voltage injected on the
EUT in case of standard test.
Example: to test in the same condition as the standard at 3 Vrms, you must adjust the
generator voltage to inject 15 Vpp measured on the board with oscilloscope.
Note:
On AFG3102 TEKTRONIX generator, the modulation is not available in sweep mode.
4.
Set the start and end frequencies such that the sweep range does not exceed 60 kHz
for a 300 seconds duration. This recommendation allows to detect worst case level
with sufficient accuracy (typically less than 5 % error).
Note:
An external amplifier might be needed in case the generator would not able to reach the
appropriate injection level.
3.3
Data logging and data processing
Data logging
The STMStudio(a) tool log function can be used to collect data from variable.
Example: “MyChannels_Data[x].Delta” and “MyTKeys[(x)].p_Data->StateId”
Data processing
A graphical tool is recommended for analysis of the results. For example with Microsoft®
Excel® 2D you can obtain the chart shown in Figure 5.
In this example frequency sweep starts at 500 kHz and ends at 550 kHz. Noise level is set
on the generator to 4.6 Vpp (no modulation). Detect out threshold is set to 50, the sensor is
touched and the detection is valid if measured delta is upper 50 else the touch detection is
lost (error is reported). It means that 4.6 Vpp is the limit to avoid detection loss (4.5 Vpp
pass)
As a comparison, IEC61000-4-6 standard recommendation to use 1 % frequency steps
would have lead to explore only ten frequencies in this range, so the chances to detect
worst case would have been very low!
a.
10/20
STMStudio: order code STM6STUDIO
DocID024663 Rev 3
AN4299
Test set up proposal to detect worst case
Figure 5. Data processing
9LDWR9''
9LDWR966
9''
966
670/[[
069
DocID024663 Rev 3
11/20
19
How to improve noise immunity
4
AN4299
How to improve noise immunity
Two directions can be followed to improve noise immunity:

decrease noise level

increase signal (measurement sensitivity).
Note:
In order to obtain a real benefit on the SNR, the noise reduction should not degrade the
sensitivity and vice versa.
4.1
Proposed improvement techniques
Several improvement techniques are introduced below:

Active Shield:
This feature increases measurement sensitivity.

Spread Spectrum:
When activated, Spread Spectrum creates several acquisition frequencies. This feature
is particularly appropriate for reducing overall noise level inside the measurement when
the noise is concentrated on certain frequencies (as opposed to a white noise).

Detection thresholds:
Adjusting these parameters allows to optimize the reported detection witch is a
compromise between false detection and detection loss.

SW filter:
SW filter such as debounce filter can be used to remove short and unwanted
detections.

Frequency hopping:
Upon detection of excessive noise on a dedicated channel, the firmware is able to
change the acquisition frequency in order to move out of the disturbed frequency
range. There may be some situations where frequency hopping and Spread Spectrum
cannot be activated both at the same time. This is useful to get a Class B operation
with no false touch detections which is generally preferable than having some false
touch detections.

Channel blocking:
It consists in using an additional channel to detect noise and cancel touchkey detection
if noise reach a determined threshold.

Impedance path to earth:
Decreasing the impedance path to earth is also a good way to cancel the conducted
noise effect (use of a metallic chassis, system ground and earth connected
together, ...). For instance, an application offering a direct connection between the
earth and the system ground is not impacted by the conducted noise.
Note:
12/20
Such an approach does not improve the system performances when performing the
conducted noise test according to the IEC61000-4-6 standard.
DocID024663 Rev 3
AN4299
4.2
How to improve noise immunity
Active Shield
The Active Shield is an electrode which wraps around the sensor. The goal is to minimize
the parasitic capacitance between the sensor and the ground. To drive the shield electrode,
a channel of a dedicated group with its own Cs can be used.
Figure 6. Active Shield
5VNH\
,2
7RXFKNH\
JURXS;
,2
,2
,2
&VNH\
5VVKLHOG
,2
6KLHOG
JURXS<
,2
,2
,2
&VVKLHOG
069
It is important to check the shied electrode waveform. Cs shield capacitance value and Rs
shield serial resistor value must be adjusted in order to obtain the same signal shape as
sensor electrode waveform (same amplitude, same response time).
Figure 7 below shows the electrode sensor waveform in green and shield electrode
waveform in yellow. Cs shield is adjusted to obtain approximately the same charge level at
the end of the acquisition.
DocID024663 Rev 3
13/20
19
How to improve noise immunity
AN4299
Figure 7. Electrode and Active Shield Waveforms
(QGDFTXLVLWLRQ&V
VKLHOGOHYHO
(QGDFTXLVLWLRQ&V
NH\VHQVRUOHYHO
14/20
DocID024663 Rev 3
AN4299
How to improve noise immunity
Figure 8 below is a zoom of Figure 7 at the beginning of acquisition: Rs and Cs shields are
adjusted to obtain approximately the same rise and fall time on the shield electrode as
sensor electrode waveform.
Figure 8. Waveform detail
When Active Shield is properly implemented the count value is about twice as much as the
count value without Active Shield. Since the noise level is not increased, the SNR is
improved by a factor of 2 and noise immunity as well.
The negative impact of this feature is the requirement to dedicate two more IOs and one
more touch sensing group.
4.3
Spread Spectrum
Without Spread Spectrum the main noise susceptibility is found at the acquisition frequency
and its value is 1/TCD (TCD = transfer cycle duration):
The main frequency (HCLK) in our STM32 comes from PLL output. Preferably we use the
highest frequency recommended by specification (for STM32F0 series it is 48 MHz) to offer
an optimum response time.
This frequency is divided in the TSC cell by programmable prescaler (PGCLK). This
frequency determines the basic timing units for CTPH, CTPL:
Transfer cycle duration =
 1   PGCLK     CTPH + 1  +  CTPL + 1    +  dead time = 2  1   HCLK  
DocID024663 Rev 3
15/20
19
How to improve noise immunity
AN4299
By enabling the Spread Spectrum feature (TSLPRM_TSC_USE_SS to 1), the noise
susceptibility is distributed on multiple frequencies.
This is done by adding HCLK timing units (period) to CTPH.
TSLPRM_TSC_SSD allows to set the number of distributed frequencies:
0 = 1  t SSCLK to 127 = 128  t SSCLK
It is recommended to set TSLPRM_TSC_SSD to 127. In this case the number of distributed
frequencies is 27 = 128. The results is a noise immunity improved by approximately a factor
of 7.
The negative impact of this feature is the degradation of the acquisition speed and thus the
response time.
TSLPRM_TSC_SSD set to 127 adds an average of 64 x (1/ 48 MHz) = 1.33 µs to each
count. For a 2000 counts acquisition duration, 2.6 ms will be added due to Spread Spectrum
activation.
Usually end users need a response time in less than 60 ms. Assuming the application uses
3 banks, that means individual acquisition must be reported in less than 20 ms. If moreover
a debounce filter is used (set to 2), this time constraint must be divided further by a factor of
3. This leads to a maximum target time for one acquisition equal to 6.6 ms.
One acquisition time = count number x transfer cycle duration (see “transfer cycle duration”
formula above)
4.4
Threshold adjustment
Two thresholds can be adjusted:

DETECT_IN is the threshold to set a detection, it is recommended to set it to 2/3 of
delta signal while touched with a normalized finger.

DETECT_OUT is the threshold to reset a detection, this thresholds is set to 1/3 of delta
signal.
Example: if delta when there is a touch is 150 counts: set TSLPRM_TKEY_DETECT_IN_TH
to 100 and TSLPRM_TKEY_DETECT_OUT_TH to 50.
Those value can be adjusted knowing they are a compromise between these 2
requirements:
4.5

avoid false detection on untouched adjacent key sensors

avoid detection loss.
SW filter (debounce)
The SW filter allows to reduce the false detections or detection losses. It is configured with
parameters: TSLPRM_DEBOUNCE_DETECT and TSLPRM_DEBOUNCE_RELEASE.
Setting the parameter TSLPRM_DEBOUNCE_DETECT to 2 means that 3 consecutive
acquisitions with a touch detected are needed to report a touch detection.
There is a trade-off. Increasing this parameter results in a longer response time between
when a user touch change occurs and when it is actually reported to the system.
16/20
DocID024663 Rev 3
AN4299
STM32303C-EVAL board example
5
STM32303C-EVAL board example
5.1
Firmware
The firmware used with the STM32303C-EVAL is the STM32F303_Ex01_2TKeys_EVAL
and it belongs to the STM32F3xx STMTouch Library. The results provided in this section are
obtained with the configuration values presented in Table 3:
Table 3. User configuration settings related to immunity improvements
Parameter
HCLK
48 MHz
TSLPRM_TKEY_DETECT_IN_TH
100
TSLPRM_TKEY_DETECT_OUT_TH
50
TSLPRM_DEBOUNCE_DETECT
2
TSLPRM_TSC_CTPH
1
TSLPRM_TSC_CTPL
1
TSLPRM_TSC_PGPSC
5
TSLPRM_TSC_USE_SS
1
TSLPRM_TSC_SSD
5.2
configuration value
127
Performance
Here are the performances of an STM32303C-EVAL board, with the configuration
described above:
5.3

Acquisition is performed in 1200 counts

Acquisition duration: 4.7 ms (target < 6.6 ms)
Conducted noise evaluation
Here are the conducted noise evaluation results performed on STM32303C-EVAL board
according to IEC61000-4-6 standard:

Pass 3 Vrms class A
The test conditions for the above result are:

Frequency range from 150 kHz to 80 MHz

1 % frequency steps

Dwell time 0.5 s
Here are more accurate test results on worst case bandwidth: no false detection or loss
observed up to 4 Vrms, from 200 to 400 kHz with 100 Hz steps.
DocID024663 Rev 3
17/20
19
Conclusion
6
AN4299
Conclusion
On STM32F0, STM32F3, STM32L4 and STM32L0 series of microcontrollers, the touch
sensing controller peripheral shows a high noise immunity level in compliance with
IEC61000-4-6 standard (above 3 Vrms class A). These results can easily be reached by
putting in practice the following recommendations:
18/20

Implement an Active Shield electrode and enable the Active Shield feature in the
firmware.

Enable the Spread Spectrum feature in the firmware.

Optimize the detection thresholds.

Use the debounce filter.
DocID024663 Rev 3
AN4299
7
Revision history
Revision history
Table 4. Document revision history
Date
Revision
Changes
03-Jul-2013
1
Initial release.
11-Jun-2014
2
Added support for STM32L0 series.
Updated last bullet in Section 4.1: Proposed
improvement techniques.
18-Dec-2015
3
Added support for STM32L4 series.
DocID024663 Rev 3
19/20
19
AN4299
IMPORTANT NOTICE – PLEASE READ CAREFULLY
STMicroelectronics NV and its subsidiaries (“ST”) reserve the right to make changes, corrections, enhancements, modifications, and
improvements to ST products and/or to this document at any time without notice. Purchasers should obtain the latest relevant information on
ST products before placing orders. ST products are sold pursuant to 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’ products.
No license, express or implied, to any intellectual property right is granted by ST herein.
Resale of ST products with provisions different from the information set forth herein shall void any warranty granted by ST for such product.
ST and the ST logo are trademarks of ST. All other product or service names are the property of their respective owners.
Information in this document supersedes and replaces information previously supplied in any prior versions of this document.
© 2015 STMicroelectronics – All rights reserved
20/20
DocID024663 Rev 3