Вы находитесь на странице: 1из 48

STM8T141 product training

Rev. 2

STM8T141 overview
Single-channel capacitive sensor for touch or proximity detection Based on charge transfer acquisition principle (ProxSense) Detection range up to a few centimeters 8-pin device in SO8 narrow or UFDFPN8 (2 x 3 mm) packages 1 configurable output to report touch or proximity detection Configurable sensitivity levels (2 for touch + 2 for proximity) On-chip voltage regulator and power-on reset (POR) Built-in driven shield function: Enhances proximity detection and protects sensing electrode from noise 4 selectable power modes: 11 A in extreme low power mode, 30 A in run mode 2.0 to 5.5 V voltage range Environment compensation filter and automatic calibration
UFDFPN 8 2 x 3 x 0.65 mm SO8 5 x 6 x 1.75 mm

STM8T141 block diagram


VDD

Cvdd

Regulator VDD
Comparator Analog switch

Creg VREG

CS Out Processing and control unit


RC 500 kHz

CS

VTRIP

Option byte

CX

Electrode

Shield Shield out Follower Shield in

STM8T141 bill of material


Components
C1 C2 + C2 C3 R1 R2

Function
Sampling capacitor VREG capacitor VDD capacitor ESD protection resistor Shield pull-up resistor

Typical value
33 nF 1 F + 100 nF 1 F 2 k 100 k

Comment
COG or NPO recommended

Only if shield feature is used

VIN GND

VSS C1 R1 Cs Cx SHLDIN

OUT VDD SHLDOUT VREG C2 C2 C3

Shield Sensing electrode

R2 LD Optional LED indicator

STM8T141 general description

Equivalent capacitances schematic


Electrode STM8T141 CX CT

CS

CS sampling capacitor CX parasitic capacitance of the electrode/track/Cx pin CT capacitance created by a finger touch, source of the useful signal

CX parasitic capacitance
CX is the sum of all the parasitic capacitances
It includes the STM8T141 pin capacitance and the capacitance between the electrode and ground. It has many components and is difficult to evaluate. In most cases, it is impossible to calculate.

Electric field

Electrode track PCB

Ground track

Battery

Electric field

Any electric field can be a cause of parasitic capacitance

Charge transfer principle


The principle uses the electrical properties of the capacitor charge, Q It uses a reference capacitor to which the electrode charge is transferred The operation is repeated several times until the voltage on the reference capacitor reaches a given threshold

Switched capacitor: equivalent to a resistor


S
fs

1
In

2
Out In

Requ
Out

CX

The switching frequency fs is the charge transfer cycle frequency

Requ =

1 CX.fS
9

STM8T141 switched capacitor equivalent


Regulator Electrode

CS CX

CT The electrode and the parasitic capacitance are switched between VREG and the sampling capacitor. They act as a resistor of value: Requ = 1 when touched fS.(CX+CT) or Requ = 1 when not touched fS.CX
12

Linear approximation
For each acquisition, the STM8T141 charges the CS capacitor through the Requ resistor until the voltage on CS reaches Vtrip The acquisition result is the number of periods 1/fs required to reach Vtrip As Vtrip ~ VREG/3, we can simplify and consider we are still on the linear part of the curve VCs
Linear section

Slope:

VREG VREG .CX.fS = CS.Requ CS

or

VREG .(CX+ CT).fS CS

VREG

Vtrip

time With the above approximation, the time to reach Vtrip is:
tBURST

tBURST

BC is measured by counting the number of pulses at frequency fS:

Vtrip CS or Vtrip . =V = V C REG X.fS REG

. CS

(CX+ CT).fS
or

BC = tBURST /TS = tBURST.fS = Vtrip .CS

VREG CX

Vtrip . CS VREG (CX+ CT)


13

Environmental compensation filter


Power supply voltage, temperature and air humidity may induce a slow variation in the signal The environmental compensation filter (ECF) forces the reference to follow slow evolutions of the signal It behaves like an RC filter with a time constant of 1.25 s or 2.5 s depending on the sampling frequency (for 10 ms and 20 ms respectively)
Time constant Reference Signal Threshold

14

Environmental compensation system (1)


Number of counts

Reference count Signal Reference count - Dth

Detection

Environment is changing
Zone Detection ECF Reference Zone 1 No detection Active Adapting Zone 2 Zone 3 Detection Frozen No change Zone 4 No detection Active Adapting

15

Environmental compensation system (2)


Number of counts Reference count Signal Reference count - Dth
Detection

Event description Detection ECF Reference

Zone 1

Zone 2

Zone 3 Detection Frozen Frozen

Zone 4

Zone 3

No detection Active No change Adapting

No detection Active Adapting No change

16

STM8T141 driven shield function (1)


Shielding is required in some applications to:
Protect the touch electrodes from a noise source Remove touch sensitivity to the cables or tracks between the electrode and sensing device Shield from the effect of a moving metal part close to the sensing device

Grounding the shield reduces the sensitivity of the keys


It may render the system unusable A solution exists: the driven shield
17

STM8T141 driven shield function (2)


The principle of the driven shield is to drive the shield with the same signal as the electrodes
The parasitic capacitance between the electrode and the shield sees no voltage change It is no longer charged Its negative effect on the sensitivity is cancelled

STM8T Shield

Shield
~1 V, DC

Key

Same variations

Parasitic capacitance

Key electrode

18

STM8T141 option bytes

STM8T141 option bytes


STM8T141 functionality can be configured using a set of option bytes The option bits are one-time programmable (OTP), meaning they can be changed only once During device evaluation and development, each bit may be set one after the other to evaluate several configurations with the same device For production, some preprogrammed configurations are already available with a dedicated part number other configurations can be created provided the volumes are sufficient The options available are:
4 POUT/TOUT output configurations 4 power modes 2 sampling periods 2 charge transfer frequencies 3 reference freeze timeout configurations 4 sensitivity thresholds

20

STM8T141 TOUT/POUT output modes


Touch/proximity detection
Detection No detection High Low

Touch/proximity detection
Detection

No detection High

TOUT/POUT

TOUT/POUT

Low

Active mode: standard output


The output follows detection

Toggle mode: the state toggles at each detection


Use this mode to control a light switch, for example Touch/proximity detection
Detection

Touch/proximity detection
Detection No detection High Low

t
Extended to the duration of the touch

No detection High

TOUT/POUT

TOUT/POUT

3s

3s

Low

3s

30 s

t
30 s 30 s

be at least 3 s long

3 s latch mode: each output pulse is extended to 30 s latch mode: each output pulse is extended
30 s from the end of the detection

21

STM8T141 power modes


4 output modes
Normal

Low power with zoom

Extreme low power with zoom

Extreme low power

4 power modes allow the right consumption/reaction time compromise to be found for each application

Mode Normal power mode Low power with zoom mode Extreme low power with zoom mode Extreme low power mode

tSAMPLING= 10ms
Min 30 30 30 510 Max 63 125 263 863

tSAMPLING=2 0ms
Min 60 60 60 1020 Max 125 225 525 1725

Unit
ms

22

Charge transfer frequency and sampling rate


2 selectable charge transfer frequencies
125 kHz: for large electrode capacitance and/or serial resistance 250 kHz: for small electrode capacitance and/or serial resistance

Charge transfer frequency

2 selectable sampling rates


Fast: 10 ms (100 Hz) Slow: 20 ms (50 Hz)
Sampling period Electrode waveform
23

STM8T141 reference freeze timeout (1)


In some applications, the environment of the sensing element may change considerably This is the case, for example, when a portable application is brought within proximity detection distance of a large conductive object In this condition, the device may detect it as a touch or proximity and remain locked in the detected state In order to exit this locked state, it may be necessary to restart the device Another solution is to use the reference freeze timeout The reference freeze timeout allows recovery from such an event after a programmable delay:
15 s freeze 45 s freeze Infinite timeout (timeout disabled)

24

STM8T141 reference freeze timeout (2)


Burst count

No detection

Detection

No detection

No detection

Reference Signal Reference - Dth

Reference frozen

ECF active

ECF active

Reference freeze timeout

Masked detection window

25

STM8T141 sensitivity thresholds


Measured count
reference Sensitive proximity: reference-2 Standard proximity: reference-8
0.01% 0.5% Very small capacitance Small change capacitance change

5%

10% 3.125%

Sensitive touch: reference-reference/32

Standard touch: reference-reference/16

Standard capacitance change


6.5%

Large capacitance change


(more than 10%)

The STM8T141 has 4 programmable sensitivity thresholds 2 absolute thresholds for proximity detection 2 touch thresholds relative to the reference
26

Acquisition gain
The acquisition gain is the ratio CS/CX The absolute sensitivity is proportional to the gain
Proximity thresholds are absolute The proximity sensitivity is impacted by the size of the Cs capacitor

The relative sensitivity is not impacted by the gain


Relative sensitivity is the ratio CT/CX Touch thresholds are relative The touch sensitivity is not impacted by the size of Cs

The acquisition duration is proportional to the gain


Increasing the gain too much may increase the acquisition duration over the 10/20 ms sampling period if this happens, the sampling rate becomes the acquisition frequency Reducing the gain may reduce the consumption in normal mode

Sensitivity to noise and temperature is also proportional to the gain


The more sensitive the proximity detection, the lower is the system stability
27

STM8T141 design recommendations and tips

Design recommendations and tips


Influence of VDD ripple What CS value to choose? How to measure the burst count How to measure the electrode capacitance Checking the electrode charging waveform Electrode design recommendations for proximity

29

Influence of VDD ripple on the device


A large ripple on VDD impacts the measurement of burst count (BC) VDD variations VDD induce a variation in the measured burst count BC respecting the following rule: BC (VTRIP/VREG) CS CS VDD VDD

CX

CX

The parameter = (VTRIP/VREG)/ VDD depends on the voltage range because of the regulator performances From 3.5 V to VDDMAX, is equal to 0.5 count/kV (0.0005 count/V) From 2.0 to 3.0 V, is equal to 0.025 count/V Between 3.0 and 3.5 V, the parameter evolves between the two values

30

Evaluating the impact of VDD ripple


The impact of VDD ripple on the measurement depends on two factors: The detection gain Cs/Cx
Cs is known as it is an element of the BOM, usually in the range of 10 to 200 nF Cx is more difficult to evaluate as it is a small parasitic capacitor (see following slides)

The detection threshold selected


BC must be small compared to the detection threshold in order to avoid detection generated by the noise The available thresholds are 2 or 8 for proximity and reference/16 or reference/32 for touch

31

Example 1: touch configuration


CS on the board is 15 nF CX is measured and is 23 pF The application uses the sensitive touch threshold: reference/16 = BC/16 = VTRIP/VREG . CS/CX.1/16 = 0.33 x 15.10-9/23.10-12 x 1/16 = 13 BC = . CS/CX . VDD = 0.5.10-3 x 15.10-9/23.10-12 . VDD = 0.326 . VDD Therefore, BC < 13 gives VDD < 3 V This ripple is large enough to cover the whole operating range of the device In touch mode the device is not sensitive to VDD ripple

32

Example 2: proximity configuration


CS on the board is 100 nF CX is measured and is 23 pF The application uses the sensitive proximity threshold: 2 BC = . CS/CX . VDD = 0.5 10-3 x 100.10-9/23.10-12 . VDD = 2.17 . VDD Therefore, BC < 2 gives VDD < 920 mV An ample safety margin is recommended, but in this example, 100 mV should be acceptable In proximity mode, the ripple on VDD may induce false detection, which must be evaluated case by case

33

What CS to choose?
The capacitor type used for CS must be the best grade available to avoid poor system behavior with environmental change. This is even more critical:
in proximity configuration because the gain is very high when zoom mode is chosen The capacitor must be NPO or COG type

The capacitor value depends on the application and the selected detection level
A large CS tends to filter more noise as the acquisition acts as an integrator over a higher number of pulses A small CS capacitor reduces the acquisition duration, and as a consequence the average power consumption For proximity configuration, the sensitivity is proportional to CS, so the minimum CS value depends on the expected detection range Higher grade capacitors are usually available only for lower farad values, so choosing a capacitor in this range is a very good choice

34

Minimum CS/CX ratio for touch sensitivity


For touch sensitivity, the threshold is relative and the sensitivity is not dependant on the sensing capacitor
A burst count of 32 is mandatory internally for the device to be able to calculate a threshold other than 0 The minimum recommended threshold is 2 to avoid digital noise: a threshold of 2 has been found to work correctly in most proximity sensing applications A minimum threshold of 2 means the minimum recommended burst count should be 64 in normal touch or 32 in sensitive touch modes

As

BC

V C = Vtrip . CS REG X

This gives around 200 in normal touch and 100 in sensitive touch modes A safety margin is recommended as the electrode capacitance is imprecise and may change depending on the surroundings
CS CX VREG = BC . min min Vtrip

35

Maximum CS/CX ratio


The maximum CS value is determined by the size of the internal burst counter: 14 bits, which is an absolute maximum Applications with a large CS have a longer acquisition time, and if this is larger than the sampling period, the acquisition time becomes the effective sampling period
This happens when tBURST > Tsampling therefore when
BC > fTRANSFER .Tsampling
BC > 5000 with fTRANSFER = 250 kHz and Tsampling = 20 ms BC > 1250 with fTRANSFER = 125 kHz and Tsampling = 10 ms

tBURST < Tsampling

tBURST > Tsampling

Tsampling TBURST Low power

TBURST Tsampling No low-power phase


36

How to measure the burst count


Measure precisely the charge transfer frequency using a probe on the electrode
The devices pulse frequency precision is not sufficient to find the real value, which really must be known precisely

Pulses at the charge transfer frequency fTRANSFER = 1/TTRANSFER


Measure the length of the CS charging waveform: this is the burst cycle duration Make sure you remove the scope probe from the CX pin as it impacts the measurement

Burst cycle duration (tBURST)


Multiply the charge transfer frequency by the burst cycle duration (tBURST) to get the burst count (BC) tBURST BC = T = tBURST . fTRANSFER
TRANSFER

37

How to measure CX/CT


The formula BC =
Vtrip CS VREGCX

can be used to calculate CX knowing BC:


CX

Vtrip CS VREG BC

Disconnect the CX pin from the board the only remaining CX is the pin capacitance
Measure the burst count BC0 in this conditions Calculate the CX0 in this conditions It should be close to 5 pF

Reconnect the CX pin to the PCB and electrode do not touch the sensor
Measure the burst count BCX in this conditions Calculate the CX1 in this conditions The electrode capacitance is CX1 CX0

Repeat the operation while touching the electrode


Measure the burst count BCT in this conditions Calculate the CXT in this conditions The touch capacitance is CT = CXT CX1
38

Electrode charging waveform


Cx is too large Cx is correct

The charge/discharge is not complete

The charge/discharge is complete

The top is not flat

If Cx is too large, this can be corrected by:


The top is perfectly flat

Decreasing the IC transfer rate (from 250 kHz to 125 kHz) Decreasing Rx
39

Antenna shape for proximity


Antenna size seems to have little influence on the proximity sensing distance from the sensor
No change in sensing distance

The bigger the area enclosed by the electrode, the greater the sensing distance
Increased sensing distance

The minimum size we recommend would be either: - A track at least 2 cm long and 2 mm wide - A round or square pad with an area of about 40 mm
2 mm 2 cm 40 mm

40

Antenna size for proximity


The size can be increased to change the sensing volume shape for the application If no ground, shield or conducting object is present, the sensing volume is bounded by a shape equidistant from the electrode Ground, metal objects or active shield tend to reduce the sensitivity
Example on a TV set

(hidden behind the panel)

Proximity electrode

Keys
Keys are lit when the users hand is in the sensing volume

Sensing volume
41

Proximity directivity (1)


Some directivity can be obtained using driven shield
Top layer: antenna

Top view

PCB
Bottom layer: driven shield
Cut view

The effect of the shield on directivity is limited for very sensitive implementations
Top layer: antenna
PCB Sensing volume

No shield

Bottom layer: driven shield


Electric field goes around the shield Only a small dip in sensitivity is observed behind the shield
42

Proximity directivity (2)


When the driven shield is not sufficient to achieve the expected directivity, then a combination of driven shield and ground may be used at the cost of a reduced sensing distance
Top layer: antenna Intermediate layer: driven shield Bottom layer: ground

Top view

Cut view

No shield, no ground

Active shield, no ground

Active shield and ground


43

STM8T141 development tools

Development tools
Tools include:
A touch/proximity evaluation board
To plug in a module

Small application modules


Only require a power supply and an electrode

A programming dongle: ST-TSLink A socket board


For SO8, UFDFPN8 packages or DIL14 modules

45

STM8T141 evaluation board


Low-cost and easy-to-use tool to demonstrate STM8T141 touch/proximity features Included modules are pre-programmed to operate with the evaluation board USB or battery powered

46

STM8T141 programming tools


STVP standard programming software for product configuration Specific USB dongle: ST-TSLINK Socket board for SO8, UFDFPN8 packages and DIP14 modules STVP

Programming dongle ST-TSLINK

Production programming solutions are also available from generic programmer manufacturer contact your programmer manufacturer for availability

47

STM8T141 modules box


Box of 10 blank modules Can be used with the evaluation board or alone The module only needs an electrode and the power supply to operate Modules can be programmed on the socket board

48

STM8T141 ordering information

Part number
Blank STM8T141 in SO8 Blank STM8T141 in DFN8 Evaluation board STM8T141 modules box Socket board Programming dongle
STM8T141 STM8T141 STM8T141-EVAL STM8T-MOD STM8T14X-SB ST-TSLINK

Order codes
STM8T141AM61T STM8T141AU61T STM8T141-EVAL STM8T141AM-MOD STM8T14X-SB ST-TSLINK

Product datasheet and application notes available at:


http://www.st.com/internet/mcu/product/243687.jsp

49

Document history
Rev. 1
First public release

Rev. 2
Wording and formatting improved through the document tVtrip changed to tBURST on slide 13 Linear Approximation Charge transfer frequency description corrected on slide 23 Charge Transfer Frequency and Sampling Rate Correct the meaning of last sentence of slide 27 Acquisition Gain Erroneous VREG/VTRIP changed to VTRIP/VREG on slide 30 Influence of VDD Ripple on the Device Changed the internet link on slide 49 STM8T141 Ordering Information to comply with new ST web site

50

Вам также может понравиться