STMPE321 Capacitance compensation
Doc ID 15791 Rev 3 7/40
2.1 Calibration algorithm
The STMPE321 maintains 2 parameters for each touch channel: TVR and CALIBRATED
IMPEDANCE. CALIBRATED IMPEDANCE is an internal reference which, if the currently
measured IMPEDANCE exceeds the CALIBRATED IMPEDANCE by a magnitude of TVR, is
considered a “TOUCH”.
If the IMPEDANCE is higher than the CALIBRATED IMPEDANCE, but the magnitude does
not exceed CALIBRATED IMPEDANCE by TVR, it is not considered a TOUCH. In this case,
2 scenarios are possible:
1. Environmental changes have caused the IMPEDANCE to increase
2. Finger is near the sensing pad, but not near enough
In case 1, the change in IMPEDANCE is expected to be small, as environmental changes
are normally gradual. A value "EVR" is maintained to specify the maximum IMPEDANCE
change that is still considered an environmental change.
‘IMP’ and ‘CALIBRATED IMP’ used in this table is not the direct register read-out.
IMP = 127 - impedance register readout
CALIBRATED IMP = 127 - calibrated impedance register readout.
The ETC WAIT register states a period of time for which all TOUCH inputs must remain "NO
TOUCH" for the next calibration to be carried out.
The CAL INTERVAL states the period of time between successive calibrations when there
are prolonged NO TOUCH conditions.
Table 3. Calibration action under different scenarios
Scenario Touch sensing and calibration action
IMP>CALIBRATED IMP + TVR
TOUCH,
no calibration
IMP<CALIBRATED IMP + TVR
IMP>CALIBRATED IMP + EVR
NO TOUCH,
no calibration
IMP<CALIBRATED IMP + TVR
IMP<CALIBRATED IMP + EVR
IMP>CALIBRATED IMP
NO TOUCH,
new CALIBRATED IMP = previous CALIBRATED
IMP + change in IMP
IMP>CALIBRATED IMP CALIBRATED IMP + change in IMP
IMP<CALIBRATED IMP
NO TOUCH,
new CALIBRATED IMP = new IMP
Capacitance compensation STMPE321
8/40 Doc ID 15791 Rev 3
2.1.1 Noise filtering
When the STMPE321 is operating in the vicinity of highly emissive circuits (DC-DC
converters, PWM controllers/drives etc.), the sensor inputs can be affected by high-
frequency noise. In this situation, the time-integrating function can be used to distinguish
between a real touch, or an emission-related false touch.
The INTEGRATION TIME and STRENGTH THRES registers are used to configure the time-
integrating function of the STMPE321.
2.1.2 Data filtering
The output from the calibration unit provides an instantaneous TOUCH or NO TOUCH
status. This output is directed to the filtering stage where the TOUCH is integrated across a
programmable period of time. The output of the integration stage is a “STRENGTH" (in the
STRENGTH register) that indicates the number of times a TOUCH is detected across the
integration period.
The STRENGTH is then compared to the value in STRENGTH THRESHOLD register. If
STRENGTH exceeds the STRENGTH THRESHOLD, it is considered a final, filtered
TOUCH status.
In the data filtering stage, 3 modes of operation are supported:
Mode 1: Only the touch channel with highest STRENGTH is taken
Mode 2: All touch channels with STRENGTH > STRENGTH THRESHOLD are taken
Mode 3: The 2 touch channels with the highest STRENGTH are taken.
These modes are selected using the FEATURE SELECTOR register. The final, filtered data
is accessible through the Touch Byte register.
STMPE321 Capacitance compensation
Doc ID 15791 Rev 3 9/40
2.2 Power management
The STMPE321 operates in 3 states, as described below:
Figure 5. STMPE321 operating states
On RESET, the STMPE321 enters the ACTIVE state immediately.
Upon a fixed period of inactivity, the device enters a SLEEP state. Any touch activity
occurring during a SLEEP state causes the device to return to an ACTIVE state.
In SLEEP mode:
-Calibration continues if the F2A bit is set in the CONTROL register
-Calibration stops if the F2A bit is NOT set in the CONTROL register
If no touch activity is expected, the host may set the device to a HIBERNATE state to save
power.
If any key is touched and held, the I
2
C command to enter SLEEP or HIBERNATE is put on
hold until the key is released.
!#4)6%
-(Z
()"%2.!4%
3,%%0
+(Z
2%3%4
(OSTCOMMAND 
4OUCHHOTKEY
INTERRUPTAND
HOSTCOMMAND
(OSTCOMMAND 
!-6
(OTKEY
(OSTCOMMAND

STMPE321QTR

Mfr. #:
Manufacturer:
STMicroelectronics
Description:
IC CTLR TOUCH KEY 3CH 12-QFN
Lifecycle:
New from this manufacturer.
Delivery:
DHL FedEx Ups TNT EMS
Payment:
T/T Paypal Visa MoneyGram Western Union

Products related to this Datasheet