FREESCALE MPR121_10

MPR121
Rev 2, 04/2010
Freescale Semiconductor
Technical Data
An Energy Efficient Solution by Freescale
Advanced Information
Proximity Capacitive Touch
Sensor Controller
MPR121
MPR121 OVERVIEW
Capacitive Touch
Sensor Controller
The MPR121 is the second generation sensor controller after the initial
release of the MPR03x series devices. The MPR121 will feature
increased internal intelligence in addition to Freescale’s second
generation capacitance detection engine. Some of the major additions
include an increased electrode count, a hardware configurable I2C
address, an expanded filtering system with debounce, and completely
independent electrodes with auto-configuration built in. The device also
features a 13th simulated electrode that represents the simultaneous
charging of all the electrodes connected together to allow for increased
proximity detection in a touch panel or touch screen array.
Bottom View
20-PIN QFN
CASE 2059-01
Features
ELE8
ELE9
ELE7
SCL
2
14
ELE6
SDA
3
13
ELE5
ADDR
4
12
ELE4
VREG
5
11
ELE3
6
7
8
9
10
ELE2
Switch Replacements
Touch Pads
ELE1
15
ELE0
IRQ
1
Typical Applications
•
•
•
•
•
ELE10
20 19 18 17 16
Implementations
•
•
ELE11
VDD
Top View
REXT
•
•
•
•
1.71 V to 3.6 V operation
29 μA supply current at 16 ms sample period
3 μA shutdown current
12 electrodes
Continuous independent auto-calibration for each electrode input
Separate touch and release trip thresholds for each electrode,
providing hysteresis and electrode independence
I2C interface, with IRQ output to advise electrode status changes
3 mm x 3 mm x 0.65 mm 20 lead QFN package
LED driver functionality with 8 shared LEDs
-40°C to +85°C operating temperature range
VSS
•
•
•
•
•
•
Pin Connections
PC Peripherals
MP3 Players
Remote Controls
Mobile Phones
Lighting Controls
ORDERING INFORMATION
Device Name
Temperature Range
Case Number
Touch Pads
IRC Address
Shipping
MPR121QR2
-40°C to +85°C
2059 (20-Pin QFN)
12-pads
0x5A - 0x5D
Tape & Reel
This document contains a product under development. Freescale Semiconductor reserves the right to change or
discontinue this product without notice.
© Freescale Semiconductor, Inc., 2009, 2010. All rights reserved.
PIN DESCRIPTION
Pin Description
Pin No.
Pin Name
Description
1
IRQ
Open Collector Interrupt pin
2
SCL
I2C Clock
3
SDA
I2C Data
4
ADDR
I2C Address Select
VREG – 0.1 μF cap connect
5
VREG
6
VSS
7
REXT
External Resistor – 75 kΩ
8
ELE0
Electrode 0
Ground
9
ELE1
Electrode 1
10
ELE2
Electrode 2
11
ELE3
Electrode 3
12
ELE4
(LED0)
Electrode 4
13
ELE5
(LED1)
Electrode 5
14
ELE6
(LED2)
Electrode 6
15
ELE7
(LED3)
Electrode 7
16
ELE8
(LED4)
Electrode 8
17
ELE9
(LED5)
Electrode 9
18
ELE10
(LED6)
Electrode 10
19
ELE11
(LED7)
Electrode 11
20
VDD
VDD
MPR121
2
Sensors
Freescale Semiconductor
SCHEMATIC DRAWINGS AND IMPLEMENTATION
VDD
1.71 V to 2.75 V
VDD
1.71 V to 2.75 V
0.1 μF
20
6
5
1
2
3
4
7
VDD
ELE11/LED7
VSS
ELE10/LED6
VREG
ELE9/LED5
IRQ
ELE8/LED4
SCL
ELE7/LED3
SDA
ELE6/LED2
ADDR
ELE5/LED1
REXT
ELE4/LED0
ELE3
ELE2
75 kΩ 1%
ELE1
GND
ELE0
GND
19
18
17
16
15
14
13
12
11
10
9
8
MPR121Q
TOUCH SENSOR
Figure 1. Configuration 1: MPR121 runs from a 1.71 V to 2.75 V supply.
VDD
2.5 V to 3.6 V
VDD
2.5 V to 3.6 V
0.1 μF
20
6
5
1
2
3
4
7
0.1 μF
VDD
ELE11/LED7
VSS
ELE10/LED6
VREG
ELE9/LED5
IRQ
ELE8/LED4
SCL
ELE7/LED3
SDA
ELE6/LED2
ADDR
ELE5/LED1
REXT
ELE4/LED0
ELE3
75 kΩ 1%
ELE2
ELE1
GND
ELE0
GND
GND
19
18
17
16
15
14
13
12
11
10
9
8
MPR121Q
TOUCH SENSOR
Figure 2. Configuration 2: MPR121 runs from a 2.5 V to 3.6 V supply.
Capacitance Sensing
The MPR121 uses a constant current touch sensor system with two primary types of control. It can measure capacitances
ranging from 10 pF to 2000 pF by varying the current and the amount of time supplied to each electrode. The electrodes are
controlled independently allowing for a great deal of flexibility in electrode pattern design. To make setup of the device easier, an
automatic configuration system can be used to set the ideal capacitance of each electrode. For information on how to set up this
system refer to application note AN3889.
Once capacitance is calculated, it runs through a couple of levels of digital filtering allowing for good noise immunity in different
environments without sacrificing response time or power consumption. The MPR121 can be configured for sample rates between
1 ms and 128 ms. For information on how to set up this system refer to application note AN3890.
MPR121
3
Sensors
Freescale Semiconductor
Touch Sensing
Once the capacitance is determined at any given moment, this information must then be translated into intelligent touch
recognition. The MPR121 has a couple of systems that have improved over the previous generation in the MPR03x series
devices. A baseline tracking system allows the system to track the untouched capacitance in the system. For information on how
to set up the baseline capacitance system refer to application note AN3891. The baseline value is then compared with the current
value to determine if a touch has occurred. A designer has the ability to set both the rising and falling thresholds in addition to a
debounce to eliminate jitter and false touches due to noise. These elements are described in application note AN3892.
Proximity Sensing
A new feature of the MPR121 is the use of a proximity sensing system whereby all of a system’s electrodes can be shorted
together internally and create a single large electrode. The capacitance of this electrode is larger and projected capacitance can
be measured. When enabled, this “13th” electrode will be included at the end of a normal detection cycle and will have its own
independent set of configuration registers. This system is described in application note AN3893.
LED Driver
The MPR121 includes eight shared LED driving pins. When these pins are not configured as electrodes, they may be used to
drive LEDs. The system allows for both pull up and pull down LED configurations as well as general GPIO push/pull functionality.
The configuration of the LED driver system is described in application note AN3894.
Serial Communication
The MPR121 is an Inter-Integrated Circuit (I2C) compliant device with an additional interrupt that is triggered any time a touch or
release of a button is detected. The device has a configurable I2C address by connecting the ADDR pin to the VSS, VDD, SDA
or SCL lines. The resulting I2C addresses are 0x5A, 0x5B, 0x5C and 0x5D respectively. The specific details of this system are
described in AN3895. For reference the register map of the MPR121 is included in Table 1.
MPR121
4
Sensors
Freescale Semiconductor
Table 1. Register Map
REGISTER
Fields
ELE0 - ELE7 Touch Status
ELE7
ELE8 - ELE11, ELEPROX Touch Status
OVCF
ELE6
ELE0-7 OOR Status
ELE7
ELE6
ELE8-11, ELEPROX OOR Status
ARFF
ACFF
ELE0 Electrode Filtered Data LSB
ELE5
ELE5
ELE4
ELE3
ELE2
ELE1
ELE0
0x00
0x00
ELE11
ELE10
ELE9
ELE8
0x01
0x00
ELE4
ELE3
ELE2
ELE1
ELE0
0x02
0x00
ELEPROX
ELE11
ELE10
ELE9
ELE8
0x03
0x00
0x04
0x00
0x05
0x00
0x06
0x00
0x07
0x00
0x08
0x00
0x09
0x00
0x0A
0x00
0x0B
0x00
0x0C
0x00
0x0D
0x00
0x0E
0x00
0x0F
0x00
0x10
0x00
0x11
0x00
0x12
0x00
0x13
0x00
0x14
0x00
0x15
0x00
0x16
0x00
0x17
0x00
0x18
0x00
0x19
0x00
0x1A
0x00
0x1B
0x00
0x1C
0x00
0x1D
0x00
EFD0LB
EFD0HB
EFD1LB
ELE1 Electrode Filtered Data MSB
ELE2 Electrode Filtered Data LSB
EFD1HB
EFD2LB
ELE2 Electrode Filtered Data MSB
ELE3 Electrode Filtered Data LSB
EFD2HB
EFD3LB
ELE3 Electrode Filtered Data MSB
ELE4 Electrode Filtered Data LSB
EFD3HB
EFD4LB
ELE4 Electrode Filtered Data MSB
ELE5 Electrode Filtered Data LSB
EFD4HB
EFD5LB
ELE5 Electrode Filtered Data MSB
ELE6 Electrode Filtered Data LSB
EFD5HB
EFD6LB
ELE6 Electrode Filtered Data MSB
ELE7 Electrode Filtered Data LSB
EFD6HB
EFD7LB
ELE7 Electrode Filtered Data MSB
ELE8 Electrode Filtered Data LSB
EFD7HB
EFD8LB
ELE8 Electrode Filtered Data MSB
ELE9 Electrode Filtered Data LSB
EFD8HB
EFD9LB
ELE9 Electrode Filtered Data MSB
ELE10 Electrode Filtered Data LSB
EFD9HB
EFD10LB
ELE10 Electrode Filtered Data MSB
ELE11 Electrode Filtered Data LSB
EFD10HB
EFD11LB
ELE11 Electrode Filtered Data MSB
ELEPROX Electrode Filtered Data LSB
Initial
Value
ELEPROX
ELE0 Electrode Filtered Data MSB
ELE1 Electrode Filtered Data LSB
Register
Address
EFD11HB
EFDPROXLB
ELEPROX Electrode Filtered Data MSB
EFDPROXHB
ELE0 Baseline Value
E0BV
0x1E
0x00
ELE1 Baseline Value
E1BV
0x1F
0x00
ELE2 Baseline Value
E2BV
0x20
0x00
ELE3 Baseline Value
E3BV
0x21
0x00
ELE4 Baseline Value
E4BV
0x22
0x00
ELE5 Baseline Value
E5BV
0x23
0x00
ELE6 Baseline Value
E6BV
0x24
0x00
ELE7 Baseline Value
E7BV
0x25
0x00
ELE8 Baseline Value
E8BV
0x26
0x00
ELE9 Baseline Value
E9BV
0x27
0x00
ELE10 Baseline Value
E10BV
0x28
0x00
ELE11 Baseline Value
E11BV
0x29
0x00
ELEPROX Baseline Value
0x2A
0x00
MHD Rising
EPROXBV
MHDR
0x2B
0x00
NHD Amount Rising
NHDR
0x2C
0x00
0x2D
0x00
NCL Rising
NCLR
FDL Rising
FDLR
0x2E
0x00
MHD Falling
MHDF
0x2F
0x00
NHD Amount Falling
NHDF
0x30
0x00
Auto
Increment
Address
Register
Address + 1
MPR121
Sensors
Freescale Semiconductor
5
Table 1. Register Map
Fields
Register
Address
Initial
Value
NCL Falling
NCLF
0x31
0x00
FDL Falling
FDLF
0x32
0x00
0x33
0x00
REGISTER
NHD Amount Touched
NHDT
NCL Touched
NCLT
0x34
0x00
FDL Touched
FDLT
0x35
0x00
ELEPROX MHD Rising
MHDPROXR
0x36
0x00
ELEPROX NHD Amount Rising
NHDPROXR
0x37
0x00
ELEPROX NCL Rising
NCLPROXR
0x38
0x00
ELEPROX FDL Rising
FDLPROXR
0x39
0x00
ELEPROX MHD Falling
MHDPROXF
0x3A
0x00
ELEPROX NHD Amount Falling
NHDPROXF
0x3B
0x00
ELEPROX NCL Falling
NCLPROXF
0x3C
0x00
ELEPROX FDL Falling
FDLPROXF
0x3D
0x00
ELEPROX NHD Amount Touched
0x3E
0x00
ELEPROX NCL Touched
NCLPROXT
NHDPROXT
0x3F
0x00
ELEPROX FDL Touched
FDLPROXT
0x40
0x00
ELE0 Touch Threshold
E0TTH
0x41
0x00
ELE0 Release Threshold
E0RTH
0x42
0x00
ELE1 Touch Threshold
E1TTH
0x43
0x00
ELE1 Release Threshold
E1RTH
0x44
0x00
ELE2 Touch Threshold
E2TTH
0x45
0x00
ELE2 Release Threshold
E2RTH
0x46
0x00
ELE3 Touch Threshold
E3TTH
0x47
0x00
ELE3 Release Threshold
E3RTH
0x48
0x00
ELE4 Touch Threshold
E4TTH
0x49
0x00
ELE4 Release Threshold
E4RTH
0x4A
0x00
ELE5 Touch Threshold
E5TTH
0x4B
0x00
ELE5 Release Threshold
E5RTH
0x4C
0x00
ELE6 Touch Threshold
E6TTH
0x4D
0x00
ELE6 Release Threshold
E6RTH
0x4E
0x00
ELE7 Touch Threshold
E7TTH
0x4F
0x00
ELE7 Release Threshold
E7RTH
0x50
0x00
ELE8 Touch Threshold
E8TTH
0x51
0x00
ELE8 Release Threshold
E8RTH
0x52
0x00
ELE9 Touch Threshold
E9TTH
0x53
0x00
ELE9 Release Threshold
E9RTH
0x54
0x00
ELE10 Touch Threshold
E10TTH
0x55
0x00
ELE10 Release Threshold
E10RTH
0x56
0x00
ELE11 Touch Threshold
E11TTH
0x57
0x00
ELE11 Release Threshold
E11RTH
0x58
0x00
EPROXTTH
0x59
0x00
0x5A
0x00
0x5B
0x00
0x5C
0x10
0x5D
0x04
ELEPROX Touch Threshold
ELEPROX Release Threshold
EPROXRTH
Debounce Touch & Release
AFE Configuration
DR
FFI
Filter Configuration
Electrode Configuration
DT
CDC
CDT
CL
SFI
ESI
0x5E
0x00
ELE0 Electrode Current
EL
CDC0
EleEn
0x5F
0x00
ELE1 Electrode Current
CDC1
0x60
0x00
ELE2 Electrode Current
CDC2
0x61
0x00
Auto
Increment
Address
Register
Address + 1
MPR121
6
Sensors
Freescale Semiconductor
Table 1. Register Map
REGISTER
Fields
ELE3 Electrode Current
CDC3
Register
Address
Initial
Value
0x62
0x00
ELE4 Electrode Current
CDC4
0x63
0x00
ELE5 Electrode Current
CDC5
0x64
0x00
ELE6 Electrode Current
CDC6
0x65
0x00
ELE7 Electrode Current
CDC7
0x66
0x00
ELE8 Electrode Current
CDC8
0x67
0x00
ELE9 Electrode Current
CDC9
0x68
0x00
ELE10 Electrode Current
CDC10
0x69
0x00
ELE11 Electrode Current
CDC11
0x6A
0x00
ELEPROX Electrode Current
0x6B
0x00
ELE0, ELE1 Charge Time
CDT1
CDCPROX
CDT0
0x6C
0x00
ELE2, ELE3 Charge Time
CDT3
CDT2
0x6D
0x00
ELE4, ELE5 Charge Time
CDT5
CDT4
0x6E
0x00
ELE6, ELE7 Charge Time
CDT7
CDT6
0x6F
0x00
ELE8, ELE9 Charge Time
CDT9
CDT8
0x70
0x00
ELE10, ELE11 Charge Time
CDT11
CDT10
0x71
0x00
CDTPROX
0x72
0x00
ELEPROX Charge Time
GPIO Control Register 0
CTL011
CTL010
CTL09
CTL08
CTL07
CTL06
CTL05
CTL04
0x73
0x00
GPIO Control Register 1
CTL111
CTL110
CTL19
CTL18
CTL17
CTL16
CTL15
CTL14
0x74
0x00
GPIO Data Register
DAT11
DAT10
DAT9
DAT8
DAT7
DAT6
DAT5
DAT4
30x75
0x00
GPIO Direction Register
DIR11
DIR10
DIR9
DIR8
DIR7
DIR6
DIR5
DIR4
0x76
0x00
GPIO Enable Register
EN11
EN10
EN9
EN8
EN7
EN6
EN5
EN4
0x77
0x00
GPIO Data Set Register
SET11
SET10
SET9
SET8
SET7
SET6
SET5
SET4
0x78
0x00
GPIO Data Clear Register
CLR11
CLR10
CLR9
CLR8
7CLR7
CLR6
CLR5
CLR4
0x79
0x00
GPIO Data Toggle Register
TOG11
TOG10
TOG9
TOG8
TOG7
TOG6
TOG5
TOG4
0x7A
0x00
ARE
ACE
0x7B
0x00
OORIE
ARFIE
ACFIE
0x7C
0x00
AUTO-CONFIG Control Register 0
AUTO-CONFIG Control Register 1
AFES
RETRY
BVA
SCTS
AUTO-CONFIG USL Register
USL
0x7D
0x00
AUTO-CONFIG LSL Register
LSL
0x7E
0x00
TL
0x7F
0x00
AUTO-CONFIG Target Level Register
Auto
Increment
Address
Register
Address + 1
0x00
MPR121
Sensors
Freescale Semiconductor
7
ELECTRICAL CHARACTERISTICS
Absolute Maximum Ratings
Absolute maximum ratings are stress ratings only, and functional operation at the maxima is not guaranteed. Stress beyond the
limits specified in Table 2 may affect device reliability or cause permanent damage to the device. For functional operating
conditions, refer to the remaining tables in this section. This device contains circuitry protecting against damage due to high static
voltage or electrical fields; however, it is advised that normal precautions be taken to avoid application of any voltages higher
than maximum-rated voltages to this high-impedance circuit.
Table 2. Absolute Maximum Ratings - Voltage (with respect to VSS)
Rating
Symbol
Value
Unit
Supply Voltage
VDD
-0.3 to +3.6
V
Supply Voltage
VREG
-0.3 to +2.75
V
VIN
VSS - 0.3 to VDD + 0.3
V
TO
-40 to +85
°C
GPIO Source Current per Pin
iGPIO
12
mA
GPIO Sink Current per Pin
iGPIO
1.2
mA
TS
-40 to +125
°C
Input Voltage
SCL, SDA, IRQ
Operating Temperature Range
Storage Temperature Range
ESD AND LATCH-UP PROTECTION CHARACTERISTICS
Normal handling precautions should be used to avoid exposure to static discharge.
Qualification tests are performed to ensure that these devices can withstand exposure to reasonable levels of static without
suffering any permanent damage. During the device qualification ESD stresses were performed for the Human Body Model
(HBM), the Machine Model (MM) and the Charge Device Model (CDM).
A device is defined as a failure if after exposure to ESD pulses the device no longer meets the device specification. Complete
DC parametric and functional testing is performed per the applicable device specification at room temperature followed by hot
temperature, unless specified otherwise in the device specification.
Table 3. ESD and Latch-up Test Conditions
Rating
Symbol
Value
Unit
Human Body Model (HBM)
VESD
±2000
V
Machine Model (MM)
VESD
±200
V
Charge Device Model (CDM)
VESD
±500
V
Latch-up current at TA = 85°C
ILATCH
±100
mA
MPR121
8
Sensors
Freescale Semiconductor
DC CHARACTERISTICS
This section includes information about power supply requirements and I/O pin characteristics.
Table 4. DC Characteristics
(Typical Operating Circuit, VDD and VREG = 1.8 V, TA = 25°C, unless otherwise noted.)
Min
Typ
Max
High Supply Voltage
Parameter
Symbol
VDD
Conditions
2.0
3.3
3.6
Units
V
Low Supply Voltage
VREG
1.71
1.8
2.75
V
Average Supply Current
IDD
Run1 Mode @ 1 ms sample period
393
μA
Average Supply Current
IDD
Run1 Mode @ 2 ms sample period
199
μA
Average Supply Current
IDD
Run1 Mode @ 4 ms sample period
102
μA
Average Supply Current
IDD
Run1 Mode @ 8 ms sample period
54
μA
Average Supply Current
IDD
Run1 Mode @ 16 ms sample period
29
μA
Average Supply Current
IDD
Run1 Mode @ 32 ms sample period
17
μA
Average Supply Current
IDD
Run1 Mode @ 64 ms sample period
11
μA
Average Supply Current
IDD
Run1 Mode @ 128 ms sample period
8
μA
Measurement Supply Current
IDD
Peak of measurement duty cycle
1
mA
Idle Supply Current
IDD
Stop Mode
3
μA
IIH, IIL
Input Leakage Current ELE_
μA
0.025
Input Capacitance ELE_
15
Input High Voltage SDA, SCL
0.7 x VDD
VIH
Input Low Voltage SDA, SCL
V
VIL
IIH, IIL
Input Leakage Current
SDA, SCL
0.025
Input Capacitance
SDA, SCL
Output Low Voltage
SDA, IRQ
VOL
IOL = 6mA
Output High Voltage
ELE4 - ELE11 (GPIO mode)
VOHGPIO
VDD = 2.7 V to 3.6 V: IOHGPIO = -10 mA
VDD = 2.3 V to 2.7 V: IOHGPIO = -6 mA
VDD = 1.8 V to 2.3 V: IOHGPIO = -3 mA
Output Low Voltage
ELE4 - ELE11 (GPIO mode)
VOLGPIO
IOLGPIOD = 1 mA
Power On Reset
pF
0.3 x VDD
V
1
μA
7
pF
0.5V
V
VDD - 0.5
V
0.5
V
VTLH
VDD rising
1.08
1.35
1.62
V
VTHL
VDD falling
0.88
1.15
1.42
V
Min
Typ
Max
Units
AC CHARACTERISTICS
Table 5. AC CHARACTERISTICS
(Typical Operating Circuit, VDD and VREG = 1.8 V, TA = 25°C, unless otherwise noted.)
Parameter
Symbol
Conditions
8 MHz Internal Oscillator
fH
7.44
8
8.56
MHz
1 kHz Internal Oscillator
fL
0.65
1
1.35
kHz
MPR121
Sensors
Freescale Semiconductor
9
I2C AC CHARACTERISTICS
Table 6. I2C AC Characteristics
(Typical Operating Circuit, VDD and VREG = 1.8 V, TA = 25°C, unless otherwise noted.)
Parameter
Symbol
Conditions
Min
Typ
Max
Units
400
kHz
Serial Clock Frequency
fSCL
Bus Free Time Between a STOP and a START Condition
tBUF
1.3
μs
Hold Time, (Repeated) START Condition
tHD, STA
0.6
μs
Repeated START Condition Setup Time
tSU, STA
0.6
μs
STOP Condition Setup Time
tSU, STO
0.6
μs
Data Hold Time
tHD, DAT
Data Setup Time
tSU, DAT
100
ns
SCL Clock Low Period
tLOW
1.3
μs
SCL Clock High Period
tHIGH
0.7
μs
0.9
μs
Rise Time of Both SDA and SCL Signals, Receiving
tR
20+0.1Cb
300
ns
Fall Time of Both SDA and SCL Signals, Receiving
tF
20+0.1Cb
300
ns
tF.TX
20+0.1Cb
250
ns
Pulse Width of Spike Suppressed
tSP
25
Capacitive Load for Each Bus Line
Cb
Fall Time of SDA Transmitting
ns
400
pF
MPR121
10
Sensors
Freescale Semiconductor
AN3889: MPR121 Capacitance Sensing Settings
INTRODUCTION
Touch acquisition takes a few different parts of the system in order to detect touch. The first stage of this process is to capture
the pad capacitance. Freescale’s MPR121 utilizes the principle that a capacitor holds a fixed amount of charge at a specific electric potential. Both the implementation and the configuration will be described in this application note.
AFE AQUISITION
RAW
DATA
1 - 32 μs
1st
FILTER
1 - 128 μs
2nd
FILTER
BASELINE
FILTER
4 - 2048 μs
TOUCH
STATUS REGISTER
IRQ
Figure 3. Data Flow in the MPR121
CAPACITANCE MEASUREMENT
The basic measurement technique used by the MPR121 is to charge up the capacitor C on one electrode input with a DC
current I for a time T (the charge time). Before measurement, the electrode input is grounded, so the electrode voltage starts from
0 V and charges up with a slope, Equation 1, where C is the pad capacitance on the electrode (Figure 4). All of the other electrodes are grounded during this measurement. At the end of time T, the electrode voltage is measured with a 10 bit ADC. The
voltage is inversely proportional to capacitance according to Equation 2.The electrode is then discharged back to ground at the
same rate it was charged.
dV
I------- = --dt
C
Equation 1
I × TV = ---------C
Equation 2
MPR121
Sensors
Freescale Semiconductor
11
Electrode Voltage
Electrode voltage measured here
V
Electrode
Charging
Electrode
Discharging
T
Electrode Charge Time
Electrode Discharge Time
2T
Figure 4. MPR121 Electrode Measurement Charging Pad Capacitance
When measuring capacitance there are some inherent restrictions due to the methodology used. On the MPR121 the voltage
after charging must be in the range that is shown in Figure 5.
Valid ADC Values vs. V DD
900
800
ADChigh
700
ADC Counts
600
ADCmid
500
400
ADClow
300
200
100
0
1.71
1.91
2.11
2.31
2.51
2.71
V DD (V)
Figure 5.
The valid operating range of the electrode charging source is 0.7 V to (VDD - 0.7 V). This means that for a given VDD the valid
ADC (voltage visible to the digital interface) range is given by
0.7
ADC low = ------------ ( 1024 ) ,
V DD
Equation 3
and
V DD – 0.7
ADC high = ------------------------- ( 1024 ) .
V DD
Equation 4
These equations are represented in the graph. In the nominal case of VDD = 1.8 V the ADC range is shown below in Table 7.
Table 7.
VDD
ADChigh
ADClow
ADCmid
1.8
625.7778
398.2222
512
MPR121
12
Sensors
Freescale Semiconductor
Any ADC counts outside of the range shown are invalid and settings must be adjusted to be within this range. If capacitance
variation is of importance for an application after the current output, charge time and supply voltage are determined then the following equations can be used. The valid range for capacitance is calculated by using the minimum and maximum ADC values in
the capacitance equation. Substituting the low and high ADC equations into the capacitance equation yields the equations for
the minimum and maximum capacitance values which are
I × T - and C
I × T- .
C low = ------------------------high = ---------V
– 0.7
0.7
DD
Equation 5
SENSITIVITY
The sensitivity of the MPR121 is relative to the capacitance range being measured. Given the ADC value, current and time
and settings capacitance can be calculated,
I × T × 1024 .
C = ------------------------------V
× ADC
DD
Equation 6
For a given capacitance the sensitivity can be measured by taking the derivative of this equation. The result of this is the
following equation, representing the change in capacitance per one ADC count, where the ADC in the equation represents the
current value.
dC - = ---------------------------------I × T × 1024 --------------dADC
2
V DD × ADC
Equation 7
This relationship is shown in the following graph by taking the midpoints off all possible ranges by varying the current and time
settings. The midpoint is assumed to be 512 for ADC and the nominal supply voltage of 1.8 V is used.
Sensitivity vs. Midpoint Capacitance for VDD = 1.8 V
0
0
500
1000
1500
2000
2500
-0.5
Sensitivity (pF/ADC Count)
-1
dC/dADC @cmid (pF/1 ADC Count)
-1.5
-2
-2.5
-3
-3.5
-4
-4.5
-5
Midpoint Capacitance (pF)
Figure 6.
Smaller amounts of change indicate increased sensitivity for the capacitance sensor. Some sample values are shown in
Table 8.
Table 8.
pF
Sensitivity (pF/ADC count)
10
-0.01953
100
-0.19531
In the previous cases, the capacitance is assumed to be in the middle of the range for specific settings. Within the capacitance
range the equation is nonlinear, thus the sensitivity is best with the lowest capacitance. This graph shows the sensitivity derivative
reading across the valid range of capacitances for a set I, T, and VDD. For simple small electrodes (that are approximately
21 pF) and a nominal 1.8 V supply. Figure 7 is representative of this effect.
MPR121
Sensors
Freescale Semiconductor
13
Sensitivity vs. Capacitance for VDD = 1.8 V and I =36 μA and T = .5 μS
0.1
0.09
Sensitivity (pF/ADC Count)
0.08
0.07
0.06
0.05
C/ADC
0.04
Maximum
0.03
0.02
Minimum
0.01
0
10
12
14
16
18
20
22
24
26
28
30
Capacitance
Figure 7.
CONFIGURATION
From the implementation above, there are two elements that can be configured to yield a wide range of capacitance readings
ranging from 0.455 pF to 2874.39 pF. The two configurable components are the electrode charge current and the electrode
charge time. The electrode charge current can be configured to equal a range of values between 1 μA and 63 μA. This value is
set in the Charge Discharge Current (CDC) in the Analog Front End AFE Configuration register. The electrode charge time can
be configured to equal a range of values between 500 ns and 32 μS. This value is set in the Charge Discharge Time (CDT) in
the Filter Configuration Register.
AFE CONFIGURATION REGISTER
The AFE Configuration Register is used to set both the CDC and the number of samples taken in the lowest level filter. The
address of the AFE Configuration Register is 0x5C.
7
R
5
4
3
FFI
W
Reset:
6
0
2
1
0
0
0
0
CDC
0
0
0
0
= Unimplemented
Figure 8. AFE Configuration Register
Table 9. AFE Configuration Register Field Descriptions
Field
Description
7:6
FFI
First Filter Iterations – The first filter iterations field selects the number of samples
taken as input to the first level of filtering.
00 Encoding 0 – Sets samples taken to 6
01 Encoding 1 – Sets samples taken to 10
10 Encoding 2 – Sets samples taken to 18
11 Encoding 3 – Sets samples taken to 34
5:0
CDC
Charge Discharge Current – The Charge Discharge Current field selects the supply
current to be used when charging and discharging an electrode.
000000 Encoding 0 – Disables Electrode Charging
000001 Encoding 1 – Sets the current to 1μA
~
111111 Encoding 63 – Sets the current to 63 μA
MPR121
14
Sensors
Freescale Semiconductor
FILTER CONFIGURATION REGISTER
7
R
5
4
CDT
W
Reset:
6
0
0
3
2
SFI
0
0
1
0
ESI
0
0
0
0
= Unimplemented
Figure 9. Filter Configuration Register
Table 10. Filter Configuration Register Field Descriptions
Field
Description
7:5
CDT
Charge Discharge Time – The Charge Discharge Time field selects the amount of
time an electrode charges and discharges.
000 Encoding 0 – Invalid
001 Encoding 1 – Time is set to 0.5 μs
010 Encoding 2 – Time is set to 1 μs
~
111 Encoding 7 – Time is set to 32 μs.
4:3
SFI
Second Filter Iterations – The Second Filter Iterations field selects the number of
samples taken for the second level filter.
00 Encoding 0 – Number of samples is set to 4
01 Encoding 1 – Number of samples is set to 6
10 Encoding 2 – Number of samples is set to 10
11 Encoding 3 – Number of samples is set to 18
2:0
ESI
Electrode Sample Interval – The Electrode Sample Interval field selects the period
between samples used for the second level of filtering.
000 Encoding 0 – Period set to 1 ms
001 Encoding 1 – Period set to 2 ms
~
111 Encoding 7 – Period set to 128 ms
The SFI, ESI and FFI are described in AN3890. In addition to these global (same for all electrodes) settings, the MPR121
electrodes can also be independently configured.
ELECTRODE CHARGE CURRENT REGISTER
R
7
6
0
0
0
0
5
4
3
2
1
0
0
0
0
CDC
W
Reset:
0
0
0
= Unimplemented
Figure 10. Electrode Charge Current Register
Table 11. Electrode Charge Current Register Field Descriptions
Field
Description
5:0
CDC
Electrode # Charge Discharge Current – The Charge Discharge Current field
selects the supply current to be used when charging and discharging an electrode.
000000 Encoding 0 – Disables Electrode Charging
000001 Encoding 1 – Sets the current to 1μA
~
111111 Encoding 63 – Sets the current to 63 μA
MPR121
Sensors
Freescale Semiconductor
15
ELECTRODE CHARGE TIME
7
R
6
5
0
0
3
0
2
0
CDT#
W
Reset:
4
0
0
1
0
CDT#
0
0
0
0
= Unimplemented
Figure 11. Electric Charge Time Register
Table 12. Electrode Charge Time Register Field Descriptions
Field
Description
6:4
CDT#
Electrode # Charge Discharge Time – The Charge Discharge Time field selects the
amount of time an electrode charges and discharges.
000 Encoding 0 – Global value is used.
001 Encoding 1 – Time is set to 0.5 μs
010 Encoding 2 – Time is set to 1 μs
~
11 Encoding 7 – Time is set to 32 μs.
2:0
CDT#
Electrode # Charge Discharge Time – The Charge Discharge Time field selects the
amount of time an electrode charges and discharges.
000 Encoding 0 – Global value is used.
001 Encoding 1 – Time is set to 0.5 μs
010 Encoding 2 – Time is set to 1 μs
~
11 Encoding 7 – Time is set to 32 μs.
AUTO-CONFIGURATION
One of the new features added in the MPR121 that was not included in the MPR03X is the ability to automatically configure
the Charge Current the Charge Time. This eliminates much of the guess involved with touch sensors and allows the same settings to properly configure the device for a wide range of application and electrodes. As show earlier in this document, the sensitivity of the sensor is maximized by having the baseline be as high as possible for a specific baseline capacitance. The
restriction on the high side is that a system should not charge above VDD - 0.7 V due to this being a non-linear region. Thus the
target voltage used is approximately VDD - 0.7 V.
Table 13.
Voltage (VDD)
VDD - 0.7 V
ADC
Baseline
1.8 V
1.1 V
625
156
VDD
2.3 V
785
196
This implies that the automatic configuration system should target approximately 156 when VDD is 1.8 V and 196 when VDDis
3.0 V. The following three registers should be set based on the VDD in the system. If the voltage is unregulated, set the values
assuming the lowest voltage necessary for the battery. If the final voltage supply in the system is not known, just use the 1.8 V
values as they represent the worst case. This lower setting will not dramatically affect the performance, thus the 1.8 V could be
considered default and be used in all cases where fine tuning is not required.
MPR121
16
Sensors
Freescale Semiconductor
AUTO-CONFIG USL REGISTER
7
6
5
4
R
2
1
0
0
0
0
0
USL
W
Reset:
3
0
0
0
0
= Unimplemented
Figure 12. AUTO-CONFIG USL Register
Table 14. AUTO-CONFIG USL Register Field Descriptions
Field
Description
7:0
USL
Upper Limit – The Upper Limit for the auto-configuration baseline search is set to
this value.
00000000 – Upper Limit set to 0
00000001 – Upper Limit set to 1
~
11111111 – Upper Limit set to 255
As this register represents the upper limit for the auto-configuration the value can be calculated by:
V DD – 0.7
VSL = -------------------------- ⋅ 256
V DD
Equation 8
For the 1.8 V system, this value is 156 or 0x9C.
AUTO-CONFIG TARGET LEVEL REGISTER
7
6
5
4
R
2
1
0
0
0
0
0
T_L
W
Reset:
3
0
0
0
0
= Unimplemented
Figure 13. AUTO-CONFIG Target Level Register
MPR121
Sensors
Freescale Semiconductor
17
Table 15. AUTO-CONFIG Target Level Register Field Descriptions
Field
Description
7:0
TL
Target Level – The Target Level for the auto-configuration baseline search is set to
this value.
00000000 – Target Level set to 0
00000001 – Target Level set to 1
~
11111111 – Target Level set to 255
This register represents the target level for the auto-configuration. The value can be calculated by:
V DD – 0.7
T arg et = -------------------------- ⋅ 256 ⋅ 0.9
V DD
90% of USL
For a 1.8 V system, this value is 140 or 0x8C.
AUTO-CONFIG LSL REGISTER
7
6
5
4
R
2
1
0
0
0
0
0
LSL
W
Reset:
3
0
0
0
0
= Unimplemented
Figure 14. AUTO-CONFIG LSL Register
Table 16. AUTO-CONFIG LSL Register Field Descriptions
Field
Description
7:0
LSL
Lower Limit – The Lower Limit for the auto-configuration baseline search is set to this value.
00000000 – Lower Limit set to 0
00000001 – Lower Limit set to 1
~
11111111 – Lower Limit set to 255
This register represents the lower limit for the auto-configuration. The value can be calculated by:
V DD – 0.7
T arg et = -------------------------- ⋅ 256 ⋅ 0.65
V DD
65% of USL
For a 1.8 V system, this value is 101 or 0x65.
The last setting required to set up the auto-configuration system is the AUTO e Register.
AUTO-CONFIG CONTROL REGISTER
7
R
5
AFES
W
Reset:
6
0
4
3
RETRY
0
0
2
BVA
0
0
0
1
0
ARE
ACE
0
0
= Unimplemented
Figure 15. AUTO-CONFIG Control Register
MPR121
18
Sensors
Freescale Semiconductor
Table 17. AUTO-CONFIG Control Register Field Descriptions
Field
Description
7:6
AFES
First Filter Iterations – The first filter iterations field selects the number of samples taken
as input to the first level of filtering. This value must match the FFI set in the AFE
Configuration register for proper AUTO-CONFIG functionality.
00 Encoding 0 – Sets samples taken to 6
01 Encoding 1 – Sets samples taken to 10
10 Encoding 2 – Sets samples taken to 18
11 Encoding 3 – Sets samples taken to 34
5:4
RETRY
Retry – The Retry value determines under what circumstances the auto-configuration
system will retry.
00 – Retry disabled
01 – Retry enabled
10 – Retry enabled
11 – Retry enabled
3:2
BVA
Baseline Value Adjust – The baseline value adjust determines the initial value of the
baseline registers after auto-configuration completes.
00 – Baseline is not changed
01 – Baseline is cleared
10 – Baseline is set to the AUTO-CONFIG baseline with the lower 3 bits cleared
11 – Baseline is set to the AUTO-CONFIG baseline
1
ARE
Automatic Reconfiguration Enable – The automatic reconfiguration enable, enables or
disables automatic reconfiguration.
0 – ARE is disabled
1 – ARE is enabled
0
ACE
Automatic Configuration Enable – The automatic configuration enable, enables or
disables automatic configuration.
0 – ACE is disabled
1 – ACE is enabled
The normal setup of the system is to set this register to 0x0B or 0b00001011. This means that the FFI is 00, but if the FFI in
the AFE Configuration Register is different, it must be changed to match. For a description of this register, please refer to AN3890.
The RETRY is disabled because in production systems, this will not be required. The BVA is set to 10 which allows the baseline
to be updated. 10 is used instead of 11 because this guarantees that the baseline will be lower than the data. This is preferable
as it protects against false touches. If somehow the baseline started higher than the data, a touch would be triggered and the
detection system would have to be reset to work correctly. Last, both the automatic configuration and automatic reconfiguration
are enable. Reconfiguration will trigger any time the baseline drifts outside the range set by the USL and the LSL.
There is also a set of flags which show when the automatic configuration has failed. For normal sized touch electrodes, this
cannot occur without the USL, LSL and TSL being incorrectly set. The most likely configuration error is to set the USL (upper
limit) at a lower value than the LSL (lower limit). Thus, as the algorithm searches for settings that work, it would always result in
a fail throwing the OOR (Out Of Range) status flag.
The ARFF and ACFF also tell the user which type of configuration cycle caused the error. If it was triggered during an initial
calibration, the ACFF will trigger. If the fail occurs during a reconfiguration, the ARFF will trigger.
ELE0-7 OUT OF RANGE STATUS REGISTER
R
7
6
5
4
3
2
1
0
E7S
E6S
E5S
E4S
E3S
E2S
E1S
E0S
0
0
0
0
0
0
0
0
W
Reset:
= Unimplemented
Figure 16. ELE0-7 Out Of Range Status Register
MPR121
Sensors
Freescale Semiconductor
19
Table 18. ELE0-7 Out Of Range Status Register Field Descriptions
Field
Description
7
E7S
Electrode 7 OOR Status – The Electrode 7 OOR Status shows if the AUTO-CONFIG has failed.
0 – Auto-configuration Successful
1 – Auto-configuration Failed
6
E6S
Electrode 6 OOR Status – The Electrode 7 OOR Status shows if the AUTO-CONFIG has failed.
0 – Auto-configuration Successful
1 – Auto-configuration Failed
5
E5S
Electrode 5 OOR Status – The Electrode 7 OOR Status shows if the AUTO-CONFIG has failed.
0 – Auto-configuration Successful
1 – Auto-configuration Failed
4
E4S
Electrode 4 OOR Status – The Electrode 7 OOR Status shows if the AUTO-CONFIG has failed.
0 – Auto-configuration Successful
1 – Auto-configuration Failed
3
E3S
Electrode 3 OOR Status – The Electrode 7 OOR Status shows if the AUTO-CONFIG has failed.
0 – Auto-configuration Successful
1 – Auto-configuration Failed
2
E2S
Electrode 2 OOR Status – The Electrode 7 OOR Status shows if the AUTO-CONFIG has failed.
0 – Auto-configuration Successful
1 – Auto-configuration Failed
1
E1S
Electrode 1 OOR Status – The Electrode 7 OOR Status shows if the AUTO-CONFIG has failed.
0 – Auto-configuration Successful
1 – Auto-configuration Failed
0
E0S
Electrode 0 OOR Status – The Electrode 7 OOR Status shows if the AUTO-CONFIG has failed.
0 – Auto-configuration Successful
1 – Auto-configuration Failed
MPR121
20
Sensors
Freescale Semiconductor
ELE8-11, ELEPROX OUT OF RANGE STATUS REGISTER
R
7
6
5
4
3
2
1
0
ARFF
ACFF
0
ELEPROXS
E11S
E10S
E9S
E8S
0
0
0
0
0
0
0
0
W
Reset:
= Unimplemented
Figure 17. ELE8-11, ELEPROX Out Of Range Status Register
Table 19. ELE8-11, ELEPROX Out Of Range Status Register Field Descriptions
Field
Description
7
ARFF
Automatic Reconfiguration Fail Flag – The Automatic Reconfiguration Fail Flag shows is the
OOR was triggered during a reconfiguration cycle.
0 – Auto-reconfiguration did not cause the OOR flag
1 – Auto-reconfiguration did cause the OOR flag
6
ACFF
Automatic Configuration Fail Flag – The Automatic Configuration Fail Flag shows is the OOR
was triggered during an initial configuration cycle.
0 – Auto-configuration did not cause the OOR flag
1 – Auto-configuration did cause the OOR flag
4
ELEPROXS
Electrode PROX OOR Status – The Electrode PROX OOR Status shows if the AUTO-CONFIG
has failed.
0 – Auto-configuration Successful
1 – Auto-configuration Failed
3
E11S
Electrode 11 OOR Status – The Electrode 11 OOR Status shows if the AUTO-CONFIG has
failed.
0 – Auto-configuration Successful
1 – Auto-configuration Failed
2
E10S
Electrode 10 OOR Status – The Electrode 10 OOR Status shows if the AUTO-CONFIG has
failed.
0 – Auto-configuration Successful
1 – Auto-configuration Failed
1
E9S
Electrode 9 OOR Status – The Electrode 9 OOR Status shows if the AUTO-CONFIG has failed.
0 – Auto-configuration Successful
1 – Auto-configuration Failed
0
E8S
Electrode 8 OOR Status – The Electrode 8 OOR Status shows if the AUTO-CONFIG has failed.
0 – Auto-configuration Successful
1 – Auto-configuration Failed
MPR121
Sensors
Freescale Semiconductor
21
AN3890: MPR121 Capacitance Sensing — Filtering and
Timing
INTRODUCTION
The capacitance sensing front end of the MPR121 produces data at extremely high rates, which significantly improves the
capabilities of a filtering system. The capacitance engine described in AN3889 act on a 1 μs - 32 μs per sample data rate. THis
application note will discuss the first and second level filters in the MPR121 and how they impact timing and power consumption.
AFE AQUISITION
RAW
DATA
1st
FILTER
1 - 32 μs
2nd
FILTER
1 - 128 μs
BASELINE
FILTER
4 - 2048 μs
TOUCH
STATUS REGISTER
IRQ
Figure 18. Data Flow in the MPR121
The first level filter is configured through the use of the First Filter Iterations (FFI) and the Charge Discharge Time (CDT).
AFE CONFIGURATION REGISTER
The AFE Configuration Register is used to set both the CDC and the number of samples taken in the lowest level filter. The
address of the AFE Configuration Register is 0x5C.
7
R
5
4
3
FFI
W
Reset:
6
0
2
1
0
0
0
0
CDC
0
0
0
0
= Unimplemented
Figure 19. AFE Configuration Register
MPR121
22
Sensors
Freescale Semiconductor
Table 20. AFE Configuration Register Field Descriptions
Field
Description
7:6
FFI
First Filter Iterations – The first filter iterations field selects the number of samples
taken as input to the first level of filtering.
00 Encoding 0 – Sets samples taken to 6
01 Encoding 1 – Sets samples taken to 10
10 Encoding 2 – Sets samples taken to 18
11 Encoding 3 – Sets samples taken to 34
5:0
CDC
Charge Discharge Current – The Charge Discharge Current field selects the supply
current to be used when charging and discharging an electrode.
000000 Encoding 0 – Disables Electrode Charging
000001 Encoding 1 – Sets the current to 1μA
~
111111 Encoding 63 – Sets the current to 63 μA
The properties of the filter are determined by these two settings, but the CDT is determined by the capacitance being measured, as discussed in AN3889. The FFI sets the number of samples being measured. The result of an FFI setting of 6 or 0x00
would be to take 6 samples, toss the maximum and minimum, then average the remaining 4 samples. The results of an oscilloscope output on an electrode with the setting of FFI = 0x00 and CDT is shown in Figure 20.
VDD - 0.7 V
FFI
2
3
4
5
6
VOLTAGE
1
CDT
1 μs
2 μs
4 μs
6 μs
8 μs
10 μs
12 μs
TIME
Figure 20.
The first level of filtering delivers data to a second filter stage. The second filter stage averages samples over more time, in
this example anywhere from 1 ms to 128 ms. Then a value can be selected for how many samples should be averaged.
FILTER CONFIGURATION REGISTER
7
R
5
4
CDT
W
Reset:
6
0
0
3
2
SFI
0
0
1
0
ESI
0
0
0
0
= Unimplemented
Figure 21. Filter Configuration Register
MPR121
Sensors
Freescale Semiconductor
23
Table 21. Filter Configuration Register Field Descriptions
Field
Description
7:5
CDT
Charge Discharge Time – The Charge Discharge Time field selects the amount of
time an electrode charges and discharges.
000 Encoding 0 – Invalid
001 Encoding 1 – Time is set to 0.5 μs
010 Encoding 2 – Time is set to 1 μs
~
111 Encoding 7 – Time is set to 32 μs.
4:3
SFI
Second Filter Iterations – The Second Filter Iterations field selects the number of
samples taken for the second level filter.
00 Encoding 0 – Number of samples is set to 4
01 Encoding 1 – Number of samples is set to 6
10 Encoding 2 – Number of samples is set to 10
11 Encoding 3 – Number of samples is set to 18
2:0
ESI
Electrode Sample Interval – The Electrode Sample Interval field selects the period
between samples used for the second level of filtering.
000 Encoding 0 – Period set to 1 ms
001 Encoding 1 – Period set to 2 ms
~
111 Encoding 7 – Period set to 128 ms
Note: In most cases the CDT in this register is not used. It will normally be auto-configured as described in AN3889
VOLTAGE
While the 1 ms to 128 ms does affect the filtering, the main purposed of adjusting the sample rate would be to change the
average current consumption of the device. Figure 22 illustrates this adjustment.
First Filter
0
1 ms
2 ms
TIME (ms)
3 ms
Figure 22.
From this, it can be seen that the 12 μs up time from the 1 ms samples results in a very low percent of duty cycle. This results
in a very low average current consumption.
MPR121
24
Sensors
Freescale Semiconductor
AVERAGE CURRENT CONSUMPTION (μA)
400
393 μA
300
199 μA
200
102 μA
100
54 μA
29 μA
10
1
2
4
8
16
17 μA
32
11 μA
64
8 μA
128
SAMPLE RATE (ms)
Figure 23. Average Supply Current
The output data is the Filtered Data High and Low is the data coming out of the second stage filter. This means that the
response time of the output is the SFI times the ESI. This usually results in 16 ms and 4 iterations being used to get 64 ms
response time while still optimizing the power consumption. At each 64 ms, a decision would be made regarding touch by comparing the Baseline with the filtered data output, resulting in a a worst case of the full 64 ms plus half the previous cycle, equalling
96 ms.
MPR121
Sensors
Freescale Semiconductor
25
AN3891: MPR121 Baseline System
INTRODUCTION
Touch acquisition takes a few different parts of the system in order to detect touch. The baseline filter and touch detection are
tightly coupled. The purpose of the baseline filter is to “filter out touches” resulting in a system that is similar to a long term
average but also takes into account that one specific signature. A touch must have different properties than noise and
environmental change with respect to the filter response. This is accomplished through four register types that operate under
different conditions. These are Max Half Delta (MHD), Noise Half Delta (NHD), Noise Count Limit (NCL) and Filter Delay Limit
(FDL).
AFE AQUISITION
RAW
DATA
1st
FILTER
1 - 32 μs
2nd
FILTER
1 - 128 μs
BASELINE
FILTER
4 - 2048 μs
TOUCH
STATUS REGISTER
IRQ
Figure 24. Data Flow in the MPR121
MAX HALF DELTA (NHD)
R
7
6
0
0
0
0
5
4
3
1
0
0
0
0
MHD
W
Reset:
2
0
0
0
= Unimplemented
Table 22. Max Half Delta Register Field Descriptions
Field
5:0
MHD
Description
Max Half Delta – The Max Half Delta determines the largest magnitude of
variation to pass through the third level filter.
000000 DO NOT USE THIS CODE
000001 Encoding 1 – Sets the Max Half Delta to 1
~
111111 Encoding 63 – Sets the Max Half Delta to 63
MPR121
26
Sensors
Freescale Semiconductor
NOISE HALF DELTA (NHD)
R
7
6
0
0
0
0
5
4
3
1
0
0
0
0
NHD
W
Reset:
2
0
0
0
= Unimplemented
Figure 25. Noise Half Delta Register
Table 23. Noise Half Delta Register Field Descriptions
Field
5:0
NHD
Description
Noise Half Delta – The Noise Half Delta determines the incremental change when
non-noise drift is detected.
000000 DO NOT USE THIS CODE
000001 Encoding 1 – Sets the Noise Half Delta to 1
~
111111 Encoding 63 – Sets the Noise Half Delta to 63
NOISE COUNT LIMIT (NCL)
7
6
5
4
R
2
1
0
0
0
0
0
NCL
W
Reset:
3
0
0
0
0
= Unimplemented
Figure 26. Noise Count Limit Register
Table 24. Noise Count Limit Register Field Descriptions
Field
7:0
NCL
Description
Noise Count Limit – The Noise Count Limit determines the number of samples consecutively greater
than the Max Half Delta necessary before it can be determined that it is non-noise.
00000000 Encoding 0 – Sets the Noise Count Limit to 1 (every time over Max Half Delta)
00000001 Encoding 1 – Sets the Noise Count Limit to 2 consecutive samples over Max Half Delta
~
11111111 Encoding 255 – Sets the Noise Count Limit to 255 consecutive samples over Max Half Delta
MPR121
Sensors
Freescale Semiconductor
27
FILTER DELAY LIMIT (FDL)
7
6
5
4
R
2
1
0
0
0
0
0
FDL
W
Reset:
3
0
0
0
0
= Unimplemented
Figure 27. Filter Delay Limit Register
Table 25. Filter Delay Limit Register Field Descriptions
Field
7:0
FDL
Description
Filter Delay Limit – The Filter Delay Limit determines the rate of operation of the
filter. A larger number makes it operate slower.
00000000 Encoding 0 – Sets the Filter Delay Limit to 1
00000001 Encoding 1 – Sets the Filter Delay Limit to 2
~
11111111 Encoding 255 – Sets the Filter Delay Limit to 255
Additionally there are different conditions in the system that affects how these registers operate. These are rising data, falling
data or touched data. When the data changes between these conditions, the current filter process is cancelled and all filter
counters return to zero.
The operation of the filter is in the relationship between the 2nd filter data and the baseline filter value. The occurrence of a
touch will also change the operation of the system. The touch generation process is described in the application note AN3892.
The falling data system is enabled any time the 2nd filter data is less than the baseline filter data. The rising data system is enabled
any time the 2nd filter data is greater than the baseline filter data. The following cases describe the baseline system when it is not
changing between the three states mentioned above.
Case 1
Small incremental changes to the system represent long term slow (environmental) changes in the system. The MHD setting
regulates this case by allowing any data that is less than two times the MHD to pass the filter. Thus, if the baseline is 700 and
the data is 701 with a MHD of one, then the baseline filter would increase to equal the data for the next cycle.
MHD = 1
Baseline
Data
Figure 28. Max Half Delta
MPR121
28
Sensors
Freescale Semiconductor
Case 2
Changes that are larger than double the MHD are regarded as noise and accounted for by the values of the NHD and NCL.
Any data outside the MHD is rejected by the filter however sequential values that fall into this category are counted and if enough
sequential data exists then the baseline will be adjusted.
In this case, the NCL regulates how many sequential data points must be seen before the data is changed. When the count
is reached, the baseline is incremented by the NHD.
MHD = 1
NCL = 3
NHD = 1
Case 1 comes
into effect
Baseline
Data
NHD added to
baseline
3 counts
3 counts
Figure 29.
Case 3
When the data is inconsistent but greater than double than MHD the baseline will not vary. Each time a transition takes place,
the filter counters are reset, thus the fact that the data is oscillating around the baseline means that the noise is rejected and the
baseline will not vary.
MHD = 1
NCL = 3
NHD = 1
2 < NCL
1 < NCL
Baseline
Data
2 < NCL
1 < NCL
Figure 30.
Case 4
Low frequency changes to the data can trick the filter in some instances. The FDL is also available to slow down the overall
system. This is done by taking an average of the specified number of values before running them through the baseline filter.
Data
Averaged
Data
Figure 31.
MPR121
Sensors
Freescale Semiconductor
29
After this averaging the filter reacts to Cases 1, 2, and 3.
MHD = 1
NCL = 3
NHD = 1
FDL = 4
Case 1
Case 2
1
2
3
Case 1
1
2
Baseline
Data
Averaged
Data
3
Figure 32.
ADVANCED CASES
With an understanding of the basic cases, more advanced cases can be discussed. In a touch sensor system, we can take
advantage of some known properties to improve the functionality of the filter. These include direction of change, touch occurrence
and the rate of touch. The first four cases are still utilized but more functionality is added. The following cases described how
different settings are useful as opposed to what exactly the settings do, like cases 1-4.
Case 5
The direction of change for a touch in the system is always negative. Thus the system takes advantage of this by allowing for
varying parameters for different directions of change. Since a touch can only be in the decreasing direction, it is usually best to
set the decreasing filter to be slower that the increasing one. This allows for automatic recovery from a bad baseline reading.
B
C
Baseline
Data
A
A. As the touch occurs, the baseline is decreased slowly due to a non solid touch, but due to the slow
reaction, a touch is still detected.
B. The baseline quickly snaps back to the initial value by having fast filtering in the positive direction
C. The repeated touch is easily handled since the baseline quickly adjusted; if it was slow, the second
touch would have resulted in a possible false negative for a touch detection.
Figure 33.
MPR121
30
Sensors
Freescale Semiconductor
Case 6
The system needs the capability to handle environment changes that appear very similar to actual touches. In Case 5, the
touch was a real touch, but slow enough that initially it is thought better for the baseline not to change at all.
A
C
Baseline
Data
B
A. The decrease is the interface being cleared with a wet rag, causing a relatively slow capacitance
change. The baseline accurately tracks this slow change.
B. The baseline begins to increase as the interface becomes dry.
C. A delta from the new baseline allows a touch to be accurately detected.
Figure 34.
Case 7
This case is when a touch is occurring. While the baseline system does not detect a touch, it is obviously an important part of
the process. The baseline can be set to slowly calibrate a touch from the system preventing keys from becoming stuck. Only the
NHD, NCL and FDL are necessary since the value can never be less than double the MHD.
A
C
Baseline
Data
B
A. The touch is detected which disengages the increasing/decreasing baseline filter but leaves it
enabled with very slow filtering
B. Even though the touch has not been released it times out and is eventually rejected.
C. Normal baseline filter is engaged.
Figure 35.
MPR121
Sensors
Freescale Semiconductor
31
Case 8
This case can also prevent keys from being stuck due to misuse. For example, if a metal pen touches a button, this may initially
engage the button but the pen is calibrated out over time and, normal function resumes. The same applies to water, food humid
environments and other instances that generate capacitance change.
A
B
C
Baseline
Data
A. Valid normal touch
B. False touch filtered out
C. Touch from new adjusted baseline
Figure 36.
MPR121
32
Sensors
Freescale Semiconductor
AN3892: MPR121 Jitter and False Touch Detection
INTRODUCTION
Touch acquisition takes a few different parts of the system in order to detect touch. The baseline filter and touch detection are
tightly coupled. The purpose of the touch detection block is to use the baseline value and the 2nd level filter data to determine
when a user has touched an electrode. The electrodes are independently configured using the Touch Threshold and Release
Threshold registers. The global Debounce register also controls when a touch is detected by adding some minimal delay. The
data is then output through a couple of registers: Filtered Data High, Filtered Data Low, Baseline Data and two touch output registers.
AFE AQUISITION
RAW
DATA
1 - 32 μs
1st
FILTER
1 - 128 μs
2nd
FILTER
BASELINE
FILTER
4 - 2048 μs
TOUCH
STATUS REGISTER
IRQ
Figure 37. Data Flow in the MPR121
First, the MPR121 touch sensor detects touch by the methods in this application note, and the data is output through the first
two registers in the map. The two touch status registers both trigger an interrupt on any change of the data. Thus, as a touch
happens (bit is set) an interrupt will be triggered, and when a touch is released (bit is cleared) it will also trigger. To clear the
interrupt all you must do is initiate a I2C communication, with the intent that you read register 0x00 and 0x01 to determine which
electrodes are touched.
MPR121
Sensors
Freescale Semiconductor
33
TOUCH STATUS REGISTER 0
.
R
7
6
5
4
3
2
1
0
E7S
E6S
E5S
E4S
E3S
E2S
E1S
E0S
0
0
0
0
0
0
0
0
W
Reset:
= Unimplemented
Figure 38. Touch Status Register 0
Table 26. Touch Status Register 0 Field Descriptions
Field
Description
7
E7S
Electrode 7 Status – The Electrode 7 Status bit shows touched or not touched.
0 – Not Touched
1 – Touched
6
E6S
Electrode 6 Status – The Electrode 6 Status bit shows touched or not touched.
0 – Not Touched
1 – Touched
5
E5S
Electrode 5 Status – The Electrode 5 Status bit shows touched or not touched.
0 – Not Touched
1 – Touched
4
E4S
Electrode 4 Status – The Electrode 4 Status bit shows touched or not touched.
0 – Not Touched
1 – Touched
3
E3S
Electrode 3 Status – The Electrode 3 Status bit shows touched or not touched.
0 – Not Touched
1 – Touched
2
E2S
Electrode 2 Status – The Electrode 2 Status bit shows touched or not touched.
0 – Not Touched
1 – Touched
1
E1S
Electrode 1 Status – The Electrode 1 Status bit shows touched or not touched.
0 – Not Touched
1 – Touched
0
E0S
Electrode 0 Status – The Electrode 0 Status bit shows touched or not touched.
0 – Not Touched
1 – Touched
MPR121
34
Sensors
Freescale Semiconductor
TOUCH STATUS REGISTER 1
R
7
6
5
4
3
2
1
0
OVCF
0
0
EPROXS
E11S
E10S
E9S
E8S
0
0
0
0
0
0
0
0
W
Reset:
= Unimplemented
Figure 39. Touch Status Register1
Table 27. Touch Status Register 1 Field Descriptions
Field
Description
7
OVCF
Over Current Flag – The Over Current Flag will be set any time the wrong value of
Rext is connected to the MPR121’s Rext pin. This is to protect the part from high
current that could result from an incorrect resistor value.
0 – Correct Rext resistor value
1 – Incorrect Rext resistor value
4
EPROXS
Electrode PROX Status – The Electrode PROX Status bit shows touched nor not
touched.
0 – Not Touched
1 – Touched
3
E11S
Electrode 11 Status – The Electrode 11 Status bit shows touched or not touched.
0 – Not Touched
1 – Touched
2
E10S
Electrode 10 Status – The Electrode 10 Status bit shows touched or not touched.
0 – Not Touched
1 – Touched
1
E9S
Electrode 9 Status – The Electrode 9 Status bit shows touched or not touched.
0 – Not Touched
1 – Touched
0
E8S
Electrode 8 Status – The Electrode 8 Status bit shows touched or not touched.
0 – Not Touched
1 – Touched
FILTER DATA HIGH
.
R
7
6
5
4
3
2
0
0
0
0
0
0
0
0
0
0
0
0
1
0
FDHB
W
Reset:
0
0
= Unimplemented
Figure 40. Filtered Data High Register
Table 28. Filtered Data High Register Field Descriptions
Field
Description
7:0
FDHB
Filtered Data High Bits – The Filtered Data High Bits displays the higher 2 bits of
the 10 bit filtered A/D reading.
00 Encoding 0
~
11 Encoding 3
MPR121
Sensors
Freescale Semiconductor
35
FILTERED DATA LOW
7
6
5
4
R
3
2
1
0
0
0
0
0
FDLB
W
Reset:
0
0
0
0
= Unimplemented
Figure 41. Filtered Data Low Register
Table 29. Filtered Data Low Register Field Descriptions
Field
Description
7:0
FDLB
Filtered Data Low Byte – The Filtered Data Low Byte displays the lower 8 bits of
the 10 bit filtered A/D reading.
00000000 Encoding 0
~
11111111 Encoding 255
BASELINE VALUE
7
6
5
4
R
3
2
1
0
0
0
0
0
BV
W
Reset:
0
0
0
0
= Unimplemented
Figure 42. Filtered Data High Register
Table 30. Filtered Data High Register Field Descriptions
Field
7:0
BV
Description
Baseline Value – The Baseline Value byte displays the higher 8 bits of the 10 bit
baseline value.
00000000 Encoding 0 – The 10 bit baseline value is between 0 and 3.
~
11111111 Encoding 255 – The 10 bit baseline value is between 1020 and 1023.
In this system, a touch is defined as any time the difference between the Filtered Data and the Baseline Value is greater than
the threshold. Since this calculation is done totally internal to the part, it is unnecessary for the user to actually do this math in
the software. If it were being done, the steps would be to first combine the Filtered Data Low and Filtered Data High values into
a single 10-bit number. Thus,
Data = Filtered Data High • 256 + Filtered Data Low
The baseline is then shifted to the left to make it equal scale to the Data.
Baseline = Baseline Value • 4
Internally to the device, the full 10-bit value is stored, but as this level of precision is not necessary as the low two bits are
disregarded for output. The Touch Threshold is a user defined value. There is both a touch and an un-touch threshold to provide
hysteresis.
MPR121
36
Sensors
Freescale Semiconductor
TOUCH THRESHOLD REGISTER
7
6
5
4
R
2
1
0
0
0
0
0
TTH
W
Reset:
3
0
0
0
0
= Unimplemented
Figure 43. Touch Threshold Register
Table 31. Touch Threshold Register Field Descriptions
Field
Description
7:0
TTH
Touch Threshold – The Touch Threshold Byte sets the trip point for detecting a
touch.
00000000 Encoding 0
~
11111111 Encoding 255
RELEASE THRESHOLD REGISTER
7
6
5
4
R
2
1
0
0
0
0
0
RTH
W
Reset:
3
0
0
0
0
= Unimplemented
Figure 44. Release Threshold Register
Table 32. Release Threshold Register Field Descriptions
Field
Description
7:0
RTH
Release Threshold – The Release Threshold Byte sets the trip point for detecting
a touch.
00000000 Encoding 0
~
11111111 Encoding 255
MPR121
Sensors
Freescale Semiconductor
37
For the system to recognize a touch the delta must be greater than the Touch Threshold.
Delta = Baseline - Data
Trigger Touch → Delta > Touch Threshold
A release is triggered when the Delta falls below the Release Threshold. This can happen for both changes to the Baseline
and actual Data changes. To understand how the Baseline can change, refer to AN3891.
Trigger Release → Delta < Touch Threshold
DEBOUNCE TOUCH AND RELEASE REGISTER
The last register available in this set is the Debounce register. The Debounce register maintains the accuracy of touch and
releases by further improving the performance. The debounce allows two different settings to prevent bounce in the end system.
If the value is set to 0x22, the requirement would be three sequential changes in status before the change would be recognized.
7
R
6
0
0
4
0
0
3
2
0
DR
W
Reset:
5
0
0
1
0
Dt
0
0
0
= Unimplemented
Figure 45. Debounce Touch and Release Register
Table 33. Debounce Touch and Release Register Field Descriptions
Field
Description
6:4
DR
Debounce Release – The Debounce Release determines the number of sequential
release detections before an interrupt is triggered and a release is reported.
000 Encoding 0 - Consecutive releases detection before Status change is 1
001 Encoding 1 - Consecutive releases detection before Status change is 2
~
007 Encoding 7 - Consecutive releases detection before Status change is 8
2:0
DT
Debounce Touch – The Debounce Touch determines the number of sequential touch
detections before an interrupt is triggered and a touch is reported.
000 Encoding 0 - Consecutive touch detection before Status change is 1
001 Encoding 1 - Consecutive touch detection before Status change is 2
~
007 Encoding 7 - Consecutive touch detection before Status change is 8
CONCLUSION
The use of each of the features together can have a great effect of the jitter and false couch rejection. Jitter is prevented by
utilizing the two threshold settings. Thus the provided hysteresis prevent Jitter on the data from going through the to the output
Depending on environmental conditions, the Debounce can be used to eliminate the remainder of dramatic change of the signal
that aren’t really touches.
Additional filtering can be done before the data gets to the touch detection system. Refer to Freescale Application Note
AN3890.
MPR121
38
Sensors
Freescale Semiconductor
AN3893: MPR121 Proximity Detection
INTRODUCTION
MPR121 is a feature rich, second generation touch sensor controller after Freescale’s initial release of the MPR03x series
device. Like MPR03x, MPR121 has a unique feature that all the electrode inputs can be internally connected together so that all
the surface touch sensing area on the inputs are “summed” together to act as a single large electrode pad. This can effectively
increase the total area of the sensing conductor for non-contact near proximity detection for hand approaching.
OVERVIEW
Capacitive proximity detection uses the same principle as capacitive touch sensing. Each MPR121 input sensing channel can
be used as contactless proximity detection as well as finger touch detection if each sensing pad is designed properly and relevant
register are set properly.
Typically a smaller pad size is used for finger touch button detection; while a larger pad size is necessary for contactless near
proximity detection. On the other side, it’s true that in most portable application design there is no dedicated big surface area left
for proximity detection as the touch sensing buttons occupy all the available surface area. To make proximity detection at the
same time of touch detection without additional dedicated large sensing pad, MPR121 has an internal input multiplexor which
can connect all input sensing channels together so that all the touch sensing surface areas on the input pads are “summed”
together effectively acting as a single large sensing pad.
Using this scheme in typical applications, the 12 channels can be used for 12 key buttons touch sensing, and the surface area
of all the pads can also used for proximity detection (e.g., hand approaching).
PROXIMITY DETECTION REGISTER SETTING
Like each independent touch sensing detection, the 13th Proximity Detection electrode also has its own register configurations, other than that, all the concepts applied to the proximity detection are the same as touch sensing detection.
1.0 Enable Proximity Sensing
Proximity detection (a/k/a area detection mode) is enabled by configuring the Electrode Configuration Register (0x5E), see
Table 34. In MPR121, this adds an area detection step (the 13th pseudo Electrode) before all the independent electrodes touch
sensing detect sequence. Once configured, we refer to this area detection as the 13th Proximity Detection electrode.
Table 34. Electrode Configuration Register 0x5E (Reset Default: 0x00)
Bit
Read
Write
Reset
Bit7
Bit6
Bit5
Bit4
Bit3
Bit2
Bit1
Bit0
CL[1]
CL[0]
AD[1]
AD[0]
EC[3]
EC[2]
EC[1]
EC[0]
0
0
0
0
0
0
0
0
AD1
AD0
EC3
EC2
EC1
EC0
Description
0
1
x
x
x
x
Area Detection by connecting ELE0~1.
1
0
x
x
x
x
Area Detection by connecting ELE0~3.
1
1
x
x
x
x
Area Detection by connecting ELE0~11.
2.0 Proximity Data Register and Baseline Register
Eleprox Electrode Registers (0x1C, 0x2D) contain the 10-bit raw data of the capacitance-voltage measurement value for the
13th Proximity Detection electrode.
Table 35. Eleprox Electrode Register 0x1C, 0x2D (Reset Default: 0x00, 0x00)
0x1C
Bit7
D7
Bit6
D6
Bit5
D5
Bit4
D4
Bit3
D3
Bit2
D2
Bit1
D1
Bit0
D0
0x1D
Bit7
—
Bit6
—
Bit5
—
Bit4
—
Bit3
—
Bit2
—
Bit1
D9
Bit0
D8
MPR121
Sensors
Freescale Semiconductor
39
Eleprox Baseline Value Register (0x2A) contains the 8 MSBs of the 10-bit baseline value for the 13th Proximity Detection
electrode. Writing to Baseline Value Register updates the 8 MSBs of baseline value and clears the 2 LSBs to zero. The Baseline
Value Registers can only be written when in Shutdown Mode, but the current values may be read at any time.
Table 36. Eleprox Baseline Value Register 0x2A (Reset Default: 0x00)
0x2A
3.0
Bit7
D9
Bit6
D8
Bit5
D7
Bit4
D6
Bit3
D5
Bit2
D4
Bit1
D3
Bit0
D2
Proximity Sensing Status Indication
MPR121 provides a single proximity sensing status bit (ELE[12] in table below) in the Touch Status Register. This status bit
changes as a result of internal detection algorithm using the proximity raw data with the proximity baseline value and proximity
touch/release threshold setting. When ELE[12] is set, the proximity is deemed as detected, and undetected when ELE[12] is 0.
Table 37. Status Register 0x00, 0x01 (Reset Default: 0x00)
0x00
Bit7
ELE[7]
Bit6
ELE[6]
Bit5
ELE[5]
Bit4
ELE[4]
Bit3
ELE[3]
Bit2
ELE[2]
Bit1
ELE[1]
Bit0
ELE[0]
0x01
Bit7
OVCF
Bit6
0
Bit5
0
Bit4
ELE[12]
Bit3
ELE[11]
Bit2
ELE[10]
Bit1
ELE[9]
Bit0
ELE[8]
The update rate of this status bit will be determined by sampling rate and detection debounce setting. The status bit will not
immediately change if the Debounce Register is non zero. This Debounce Register is globally effective to prevent possible flick
noise for both touch and proximity sensing. The value in the Debounce Register determines how many numbers of sample intervals are needed to pass at the touch/release threshold before the status bit is finally changed.
Table 38. Debounce Register 0x5B (Reset Default: 0x00)
0x5B
Bit7
Bit6
Bit5
Bit4
Bit3
Bit2
Bit1
Bit0
X
DR[2]
DR[1]
DR[0]
X
DT[2]
DT[1]
DT[0]
On ELEPROX status bit change, the interrupt pin will be asserted.
4.0 Proximity Detection Touch/Release Threshold
Similar to the touch/release threshold for touch detection, the proximity detection also has a pair of touch/release threshold
setting registers. The programmable threshold setting range is 0~63 count, representing the delta change below the baseline
value when touched or released. The Threshold should be set according to the system SNR requirement and also provide adequate headroom for mass production variation. For normal application, set Touch Threshold slightly larger than Release Threshold so that there is no flick detection.
Example: Touch Threshold = 0x08, Release Threshold = 0x05.
Table 39. Eleprox Touch Threshold Register 0x59 (Reset Default: 0x00)
0x59
Bit7
Bit6
Bit5
Bit4
Bit3
Bit2
Bit1
Bit0
D7
D6
D5
D4
D3
D2
D1
D0
Table 40. Eleprox Release Threshold Register 0x5A (Reset Default: 0x00)
0x5A
Bit7
Bit6
Bit5
Bit4
Bit3
Bit2
Bit1
Bit0
D7
D6
D5
D4
D3
D2
D1
D0
MPR121
40
Sensors
Freescale Semiconductor
5.0
Proximity Baseline Filter Setting
As with the touch detection, the proximity detection also dedicates register sets for baseline filter control. These include the
maximum half delta for rising/falling, the noise half delta for rising/falling/touched, the noise count limit for rising/falling/touched,
and filter delay for rising/falling/touched. Table 41 shows an example setting for proximity sensing, the concept is to have quickest
response on baseline rising (when hand takes away) and slowest response on baseline falling (when hand approaching). Refer
to Freescale application note AN3891 for detailed description on baseline system.
Table 41. Proximity Baseline Filter Registers 0x36~0x40 (Reset Default: all 0x00)
Register Name
Register Address
Example Setting
ELEPROX Max Half Delta Rising
0x36
0xFF
ELEPROX Noise Half Delta Amount Rising
0x37
0xFF
ELEPROX Noise Count Limit Rising
0x38
0x00
ELEPROX Filter Delay Limit Rising
0x39
0x00
ELEPROX Max Half Delta Falling
0x3A
0x01
ELEPROX Noise Half Delta Amount Falling
0x3B
0x01
ELEPROX Noise Count Limit Falling
0x3C
0xFF
ELEPROX Filter Delay Limit Falling
0x3D
0xFF
ELEPROX Noise Half Delta Amount Touched
0x3E
0x00
ELEPROX Noise Count Limit Touched
0x3F
0x00
ELEPROX Filter Delay Limit Touched
0x40
0x00
6.0
Electrode Configuration for Proximity Sensing
Same as touch sensing, the proximity sensing requires that the charging current and time for the 13th Proximity Detection
electrode to be properly set. This can be done in 3 ways:
1. Globally setting the AFE Configuration Register (0x5B) and Filter Configuration Register if recent current setting and time
setting is zero.
2. Set by using Eleprox Electrode Current Register (0x6B) and Charge Time Register (0x72).
3. Using Auto-Configuration function to automatically set charge current and charge time for this 13th Proximity Detection
electrode.
It’s recommended that Auto-Configuration is used for design efficiency if proximity sensing works properly in this way. Refer
to Freescale application note AN3889 for details of the Auto-Configuration function.
MPR121
Sensors
Freescale Semiconductor
41
7.0 AFE and Filter Configuration Register
The last two registers relevant to proximity detection are the AFE Configuration Register and Filter Configuration Register.
These two registers set the numbers of samples for the 2 level filters and the sampling interval for the second level filter.
Table 42. Filter Configuration Registers 0x5D (Reset Default: 0x24)
0x5D
Bit7
Bit6
Bit5
Bit4
CDT[2:0]
Bit3
Bit2
SFI[1:0]
Bit1
Bit0
ESI[2:0]
Table 43. AFE Configuration Registers 0x5C (Reset Default: 0x10)
0x5C
Bit7
Bit6
FFI[1:0]
Bit5
Bit4
Bit3
Bit2
Bit1
Bit0
CDC[4:0]
The FFI[1:0], SFI[1:0] and ESI[2:0] bits in the registers are those related to the first filter, second filter and sample interval
respectively. These two registers are powered up with default setting of 0x24 and 0x10 respectively. The default setting is already
workable for proximity sensing, but since ESI[2:0] is 100, the sampling interval is at 16 ms. If lower power consumption is desired,
the user can adjust it to the value to find a balance between the proximity detection response time current consumption. For a
detailed explanation on these registers, please refer to Freescale application note AN3890.
OTHER DESIGN CONSIDERATIONS
1. Remember the paralleled plate capacitor model when considering the proximity detection. Larger sensing area (the
effective sensing area formed by the sensing pad and material under detection, e.g. the surface area of hand projected to
the sensing pad) gives longer proximity sensing distance.
2. The electric energy store in the capacitance (thus the strength of the sensing field) is proportional to the square of the
voltage potential applied. Setting the auto-configure target level as high as possible will help extend the proximity sensing
range.
3. Since increasing the sensing pad area also has the problem of making it easier to receive the electric noise. It’s possible
that the original solid sensing pad can be replaced by a series of circles or x hatch patterns.
Refer to Freescale application note AN3863 for more detailed discussion on electrode and layout design considerations.
MPR121
42
Sensors
Freescale Semiconductor
AN3894: MPR121 GPIO and LED Driver Function
INTRODUCTION
MPR121 is a feature rich second generation touch sensor controller after Freescale’s initial release of the MPR03x series device. MPR121 not only has priority unique features like independent electrode auto configuration (refer to AN3889), 13th simulated pseudo electrode for proximity detection (refer to AN3893), it also has 8 GPIO ports with LED driver capability. The GPIO
and LED driver function can be used when not all the 12 input sensing channels are occupied for touch sensing detection, which
is made possible by internal multiplexed pin structure. This increaseS the cost efficiency of the system and makes the MPR121
fit for even wider application.
MULTIFUNCTION PINS
MPR121 has 12 input sensing channels ELE0~ELE11, which occupies pin 8 to pin 19. Among these, pin 12 to pin 19 are multifunction pins. When these multifunction pins are not configured as electrodes, they may be used to drive LED or for general
GPIO purpose.
PIN #
ELECTRODE
GPIO
8
9
10
11
12
13
14
15
16
17
18
19
ELE0
ELE1
ELE2
ELE3
ELE4
ELE5
ELE6
ELE7
ELE8
ELE9
ELE10
ELE11
—
—
—
—
GPIO0
GPIO1
GPIO2
GPIO3
GPIO4
GPIO5
GPIO6
GPIO7
VDD
1.71 V to 2.75 V
VDD
1.71 V to 2.75 V
0.1 μF
20
6
5
1
2
3
4
7
VDD
ELE11/LED7
VSS
ELE10/LED6
VREG
ELE9/LED5
IRQ
ELE8/LED4
SCL
ELE7/LED3
SDA
ELE6/LED2
ADDR
ELE5/LED1
REXT
ELE4/LED0
ELE3
75 kΩ 1%
GND
ELE2
ELE1
ELE0
GND
19
18
17
16
15
14
13
12
11
10
9
8
MPR121Q
TOUCH SENSOR
Figure 46. Configuration 1: MPR121 runs from a 1.71 V to 2.75 V supply.
MPR121
Sensors
Freescale Semiconductor
43
VDD
2.5 V to 3.6 V
VDD
2.5 V to 3.6 V
0.1 μF
20
6
5
1
2
3
4
7
VDD
ELE11/LED7
VSS
ELE10/LED6
VREG
ELE9/LED5
IRQ
ELE8/LED4
SCL
ELE7/LED3
SDA
ELE6/LED2
ADDR
ELE5/LED1
REXT
ELE4/LED0
0.1 μF
ELE3
ELE2
75 kΩ 1%
ELE1
GND
ELE0
GND
GND
19
18
17
16
15
14
13
12
11
10
9
8
MPR121Q
TOUCH SENSOR
Figure 47. Configuration 2: MPR121 runs from a 2.5 V to 3.6 V supply.
These registers control GPIO function. D7~D0 bits corresponds GPIO7~GPIO0 pins respectively. The GPIO control registers
can write always regardless Shutdown and Run mode.
Table 44. GPIO Control Registers
Name
Address
D7
D6
D5
D4
D3
D2
D1
D0
GPIO Control 0
0x73
CTL0[7]
CTL0[6]
CTL0[5]
CTL0[4]
CTL0[3]
CTL0[2]
CTL0[1]
CTL0[0]
GPIO Control 1
0x74
CTL1[7]
CTL1[6]
CTL1[5]
CTL1[4]
CTL1[3]
CTL1[2]
CTL1[1]
CTL1[0]
GPIO Data
0x75
DAT[7]
DAT[6]
DAT[5]
DAT[4]
DAT[3]
DAT[2]
DAT[1]
DAT[0]
GPIO Direction
0x76
DIR[7]
DIR[6]
DIR[5]
DIR[4]
DIR[3]
DIR[2]
DIR[1]
DIR[0]
GPIO Enable
0x77
EN[7]
EN[6]
EN[5]
EN[4]
EN[3]
EN[2]
EN[1]
EN[0]
GPIO Data Set
0x78
SET[7]
SET[6]
SET[5]
SET[4]
SET[3]
SET[2]
SET[1]
SET[0]
GPIO Data Clear
0x79
CLR[7]
CLR[6]
CLR[5]
CLR[4]
CLR[3]
CLR[2]
CLR[1]
CLR[0]
GPIO Data Toggle
0x7A
TOG[7]
TOG[6]
TOG[5]
TOG[4]
TOG[3]
TOG[2]
TOG[1]
TOG[0]
EN[7:0], DIR[7:0], CTL0[7:0], CTL1[7:0]: Configuration Register
The number of touch sensing electrodes (and therefore the number of GPIO ports available) is configured by the Electrode
Configuration register (0x5E) and GPIO Enable Register (0x77), but electrode configuration has higher priority than GPIO feature. When a pin is enabled as GPIO but is also selected as electrode by Electrode Configuration Register, the GPIO function is
disabled immediately and it becomes an electrode during Run mode. But all 8 ports automatically become GPIO ports in Shutdown mode because none of the ports are being enabled as touch electrodes in Shutdown mode.
During the shutdown mode just after power on reset, all 8 GPIO ports are in high impedance as all the GPIO ports are default
disabled. Take care to program unused ports which are not going to be used as either touch electrodes or GPIO to avoid floating
inputs or outputs shorted to a rail. One approach is to enable unused ports to be GPIO inputs with internal pull-up or pull-down.
MPR121
44
Sensors
Freescale Semiconductor
The GPIO system allows the GPIO pins to be set as input or output. When an EN bit sets, the corresponding GPIO pin is
enabled and the function is configured by CTL0, CTL1 and DIR bits. When the port is used as input, it can be configured as normal
input or with additional internal pull-down or pull-up for input port. For output configuration, it can be push/pull or open drain.
EN
DIR
CTL[0:1]
DESCRIPTION
0
X
XX
GPIO function is disabled. Port is high-z state.
1
0
00
GPIO port becomes input port.
1
0
10
GPIO port becomes input port with internal pull-down.
1
0
11
GPIO port becomes input port with internal pull-up.
1
0
01
Not defined yet (as same as CTL = 00).
1
1
00
GPIO port becomes CMOS output port.
1
1
11
GPIO port becomes high side only open drain output port for LED driver.
1
1
10
GPIO port becomes low side only open drain output port.
1
1
01
Not defined yet (as same as CTL = 00).
DAT[7:0]: Data Register
When a GPIO is as output, the GPIO port outputs the bit level of this register. The output level toggle holds on any electrode
charging and AD conversion and the level transition will be occurred after the AD conversion. Reading this register returns the
content of the DAT register (not a level of the port).
When a GPIO is as input, reading this register returns latched input level of the corresponding port (not contents of the DAT
register). A write changes content of the register, but not affect to the input function.
SET[7:0]: Set Data Register
Writing a “1” to bits in this register will set them in the Data Register.
CLR[7:0]: Clear Data Register
Writing a “1” to bits in this register will clear them in the Data Register.
TOG[7:0]: Toggle Data Register
Write a bit with “1” to the GPIO Data Set Register, GPIO Data Clear Register, and GPIO Toggle Register set/clear/toggle contents of the corresponding DAT bit. Write “0” has no meaning. Using of those registers allows any individual port(s) to be able
individually set, cleared, or toggled without affecting other ports. Reading those register returns as same as DAT register reading.
LED DRIVER
Each GPIO pin has LED driver capability which can source up to 12 mA. When GPIO is used to driver LED, connect the GPIO
output to an LED forward biased with its cathode to GND so that GPIO output high lights the LED. Place a current limiting resistor
is series with LED to limit the current below 12 mA (refer to the typical application circuit).
When LED dimming control is needed, the PWM control register can be set to get the desired dimming control. Alternatively,
the PWM can also be used to drive the beeper.
Table 45. PWM_[3:0}: PWM Duty Control Registers
Name
Address
D7
D6
D5
D4
D3
D2
D1
D0
PWM 0
0x81
PWM1[3]
PWM1[2]
PWM1[1]
PWM1[0]
PWM0[3]
PWM0[2]
PWM0[1]
PWM0[0]
PWM 1
0x82
PWM3[3]
PWM3[2]
PWM3[1]
PWM3[0]
PWM2[3]
PWM2[2]
PWM2[1]
PWM2[0]
PWM 2
0x83
PWM5[3]
PWM5[2]
PWM5[1]
PWM5[0]
PWM4[3]
PWM4[2]
PWM4[1]
PWM4[0]
PWM 3
0x84
PWM7[3]
PWM7[2]
PWM7[1]
PWM7[0]
PWM6[3]
PWM6[2]
PWM6[1]
PWM6[0]
MPR121
Sensors
Freescale Semiconductor
45
PWM0[3:0] ~ PWM7[3:0] is used to set the PWM duty of GPIO0 ~ GPIO7 respectively. The power up reset default setting for
these four register is 0x00. When a GPIO is programmed as output and the DAT register is “1” and if the corresponding PWM_
[3:0] register is not zero, the GPIO pin outputs PWM waveform. The PWM period is fixed 8ms (1/256 of 32 KHz OSC) and PWM_
[3:0] register decides duty of the waveform.
PWM_ [3:0]
Description (_ is 0~7)
0
PWM is off, GPIO outputs stable high when DAT register is “1”
1
GPIO output duty is 1:15 (mostly output low)
2
GPIO output duty is 2:14 (mostly output low)
—
—
15
GPIO output duty is 15:1 (mostly output high)
These register can be read/write any time, even if MPR121 is in Run Mode. When the register changes during PWM enables,
a mixed duty cycle would be possible to occur.
The PWM duty is not so much accurate, because GPIO output transition (include PWM) inhibits during measurement state.
Therefore, when interval time (=Touch Detection Sample Interval) is close to measurement time (depends on charge time, AFE
Samples and number of measurement electrodes), the PWM operation is disturbed and the waveform couldn’t keep programmed
duty.
MPR121
46
Sensors
Freescale Semiconductor
AN3895: MPR121 Serial Communication
INTRODUCTION
The MPR121 uses an I2C Serial Interface. The I2C protocol implementation and the specifics of communicating with the Touch
Sensor Controller are detailed in this application note.
SERIAL-ADDRESSING
The MPR121 operates as a slave that sends and receives data through an I2C 2-wire interface. The interface uses a Serial
Data Line (SDA) and a Serial Clock Line (SCL) to achieve bi-directional communication between master(s) and slave(s). A
master (typically a microcontroller) initiates all data transfers to and from the MPR121, and it generates the SCL clock that
synchronizes the data transfer.
The MPR121 SDA line operates as both an input and an open-drain output. A pull-up resistor, typically 4.7 kΩ, is required on
SDA. The MPR121 SCL line operates only as an input. A pull-up resistor, typically 4.7 kΩ, is required on SCL if there are multiple
masters on the 2-wire interface, or if the master in a single-master system has an open-drain SCL output.
Each transmission consists of a START condition (Figure 48) sent by a master, followed by the MPR121’s 7-bit slave address
plus R/W bit, a register address byte, one or more data bytes, and finally a STOP condition.
SDA
tBUF
tSU DAT
tHD DAT
tLOW
SCL
tSU STA
tHD STA
tSU STO
tHIGH
tHD STA
tR
tF
ST ART
CONDIT ION
REPEAT ED ST ART
CONDIT ION
ST OP
CONDIT ION
ST ART
CONDIT ION
Figure 48. Wire Serial Interface Timing Details
START AND STOP CONDITIONS
Both SCL and SDA remain high when the interface is not busy. A master signals the beginning of a transmission with a
START (S) condition by transitioning SDA from high to low while SCL is high. When the master has finished communicating with
the slave, it issues a STOP (P) condition by transitioning SDA from low to high while SCL is high. The bus is then free for another
transmission.
SDA
SCL
DATA LINE STABLE
DATA VALID
CHANGE OF
DATA ALLOWED
Figure 49. Start and Stop Conditions
MPR121
Sensors
Freescale Semiconductor
47
BIT TRANSFER
One data bit is transferred during each clock pulse (Figure 50). The data on SDA must remain stable while SCL is high.
SDA
SCL
S
P
START
CONDITION
STOP
CONDITION
Figure 50. Bit Transfer
ACKNOWLEDGE
The acknowledge bit is a clocked 9th bit (Figure 51) which the recipient uses to handshake receipt of each byte of data. Thus
each byte transferred effectively requires 9 bits. The master generates the 9th clock pulse, and the recipient pulls down SDA
during the acknowledge clock pulse, such that the SDA line is stable low during the high period of the clock pulse. When the
master is transmitting to the MPR121, the MPR121 generates the acknowledge bit, since the MPR121 is the recipient. When the
MPR121 is transmitting to the master, the master generates the acknowledge bit, since the master is the recipient.
START
CONDITION
CLOCK PULSE FOR
ACKNOWLEDGEMENT
SCL
1
2
8
9
SDA
BY TRANSMITTER
SDA
S
BY RECEIVER
Figure 51. Acknowledge
THE SLAVE ADDRESS
The MPR121 has a 7-bit long slave address (Figure 52). The bit following the 7-bit slave address (bit eight) is the R/W bit, which
is low for a write command and high for a read command.
SDA
1
MSB
0
0
1
0
1
0
R/W
ACK
SCL
Figure 52. Slave Address
The MPR121 monitors the bus continuously, waiting for a START condition followed by its slave address. When a MPR121
recognizes its slave address, it acknowledges and is then ready for continued communication.
The MPR121 slave addresses are show in Table 46.
Table 46.
ADDR Pin Connection
I2C Address
VDD
0x4C
VSS
0x4D
SDA
0x4E
SCL
0x4F
MPR121
48
Sensors
Freescale Semiconductor
MESSAGE FORMAT FOR WRITING THE MPR121
A write to the MPR121 comprises the transmission of the MPR121’s keyscan slave address with the R/W bit set to 0, followed
by at least one byte of information. The first byte of information is the command byte. The command byte determines which
register of the MPR121 is to be written by the next byte, if received. If a STOP condition is detected after the command byte is
received, the MPR121 takes no further action (Figure 53) beyond storing the command byte. Any bytes received after the
command byte are data bytes.
Command byte is stored on receipt ofSTOP condition
D15
D14
D13
D12
D11
D10
D9
D8
Acknowledge from MPR121
SLAVE ADDRESS
S
0
COMMAND BYTE
A
R/W
A
P
Acknowledge from MPR121
Figure 53. Command Byte Received
Any bytes received after the command byte are data bytes. The first data byte goes into the internal register of the MPR121
selected by the command byte (Figure 54).
Acknowledge from
MPR121
How command byte and data byte
map into MPR121's registers
D15 D14 D13 D12 D11 D10 D9
Acknowledge from
MPR121
D8
D7
D6
D5
D4
D3
D2
D1
D0
Acknowledge from MPR121
S
SLAVE ADDRESS
0
A
COMMAND BYTE
A
A
DATA BYTE
P
1 byte
R/W
Auto-increment memory
word address
Figure 54. Command and Single Data Byte Received
If multiple data bytes are transmitted before a STOP condition is detected, these bytes are generally stored in subsequent
MPR121 internal registers because the command byte address generally auto-increments.
MESSAGE FORMAT FOR READING THE MPR121
MPR121 is read using MPR121's internally stored register address as address pointer, the same way the stored register address
is used as address pointer for a write. The pointer generally auto-increments after each data byte is read using the same rules
as for a write. Thus, a read is initiated by first configuring MPR121's register address by performing a write (Figure 53) followed
by a repeated start. The master can now read 'n' consecutive bytes from MPR121, with first data byte being read from the register
addressed by the initialized register address.
Acknowledge from master
Command byte is stored on receipt ofSTOP condition
D15 D14 D13 D12 D11 D10 D9
Repeated Start
D8
SLAVE ADDRESS
0
R/W
Stop
Acknowledge from MPR121
Acknowledge from MPR121
S
D7 D6 D5 D4 D3 D2 D1 D0
A
COMMAND BYTE
A
S
SLAVE ADDRESS
Acknowledge from MPR121
R/W
1
A
DATA BYTE
A
P
n bytes
auto-increment memory
word address
Figure 55. Reading MPR121
OPERATION WITH MULTIPLE MASTER
The application should use repeated starts to address the MPR121 to avoid bus confusion between I2C masters.On a I2C bus,
once a master issues a start/repeated start condition, that master owns the bus until a stop condition occurs. If a master that does
not own the bus attempts to take control of that bus, then improper addressing may occur. An address may always be rewritten
to fix this problem. Follow I2C protocol for multiple master configurations.
MPR121
Sensors
Freescale Semiconductor
49
AN3944: MPR121 Quick Start Guide
INTRODUCTION
The MPR121 is Freescale Semiconductor’s top of the line touch sensor and can fit into a wide range of applications. These
applications can all be accommodated by having a device a with a very large range of flexibility. While all of these added features
can allow for a wide range of flexibility, they can also add an unnecessary layer of complication. For advanced users who want
to do more than basic touch detection, additional information can be found in other application notes.
To start, the device is configured through an I2C serial interface. The following table lists the registers that are initialized. The
order they are written in is not significant except that register 0x05E, the Electrode Configuration Register must be written last.
Register Address
Register Name
Value
Application Note
Section
0x2B
MHD Rising
0x01
AN3891
A
0x2C
NHD Amount Rising
0x01
AN3891
A
0x2D
NCL Rising
0x00
AN3891
A
0x2E
FDL Rising
0x00
AN3891
A
0x2F
MHD Falling
0x01
AN3891
B
0x30
NHD Amount Falling
0x01
AN3891
B
0x31
NCL Falling
0xFF
AN3891
B
0x32
FDL Falling
0x02
AN3891
B
0x41
ELE0 Touch Threshold
0x0F
AN3892
C
0x42
ELE0 Release Threshold
0x0A
AN3892
C
0x43
ELE1 Touch Threshold
0x0F
AN3892
C
0x44
ELE1 Release Threshold
0x0A
AN3892
C
0x45
ELE2 Touch Threshold
0x0F
AN3892
C
0x46
ELE2 Release Threshold
0x0A
AN3892
C
0x47
ELE3 Touch Threshold
0x0F
AN3892
C
0x48
ELE3 Release Threshold
0x0A
AN3892
C
0x49
ELE4 Touch Threshold
0x0F
AN3892
C
0x4A
ELE4 Release Threshold
0x0A
AN3892
C
0x4B
ELE5 Touch Threshold
0x0F
AN3892
C
0x4C
ELE5 Release Threshold
0x0A
AN3892
C
0x4D
ELE6 Touch Threshold
0x0F
AN3892
C
0x4E
ELE6 Release Threshold
0x0A
AN3892
C
0x4F
ELE7 Touch Threshold
0x0F
AN3892
C
0x50
ELE7 Release Threshold
0x0A
AN3892
C
0x51
ELE8 Touch Threshold
0x0F
AN3892
C
0x52
ELE8 Release Threshold
0x0A
AN3892
C
0x53
ELE9 Touch Threshold
0x0F
AN3892
C
0x54
ELE9 Release Threshold
0x0A
AN3892
C
0x55
ELE10 Touch Threshold
0x0F
AN3892
C
0x56
ELE10 Release Threshold
0x0A
AN3892
C
0x57
ELE11 Touch Threshold
0x0F
AN3892
C
0x58
ELE11 Release Threshold
0x0A
AN3892
C
0x5D
Filter Configuration
0x04
AN3890
D
0x5E
Electrode Configuration
0x0C
AN3890
E
0x7B
AUTO-CONFIG Control Register 0
0x0B
AN3889
F
MPR121
50
Sensors
Freescale Semiconductor
Register Address
Register Name
Value
Application Note
Section
0x7D
AUTO-CONFIG USL Register
0x9C
AN3889
F
0x7E
AUTO-CONFIG LSL Register
0x65
AN3889
F
0x7F
AUTO-CONFIG Target Level Register
0x8C
AN3889
F
The following sections describe what each of the defaults do and recommendations for variations.
Section A
Register Address
Register Name
Value
Application Note
0x2B
MHD Rising
0x01
AN3891
0x2C
NHD Amount Rising
0x01
AN3891
0x2D
NCL Rising
0x00
AN3891
0x2E
FDL Rising
0x00
AN3891
Description: This group of setting controls the filtering of the system when the data is greater than the baseline.
The setting used allow the filter to act quickly and adjust for environmental changes. Additionally, if
calibration happens to take place while a touch occurs, the value will self adjust very quickly. This
auto-recovery or snap back prevents repeated false negative for a touch detection.
Variation: As the filter is sensitive to setting changes, it is recommended that users read AN3891 before
changing the values. In most cases these default values will work
Section B
Register Address
Register Name
Value
Application Note
0x2F
MHD Falling
0x01
AN3891
0x30
NHD Amount Falling
0x01
AN3891
0x31
NCL Falling
0xFF
AN3891
0x32
FDL Falling
0x02
AN3891
Description: This group of setting controls the filtering of the system, when the data is less than the baseline. The
settings slow down the filter as the negative charge is in the same direction as a touch. By slowing
down the filter, touch signals are “rejected” by the baseline filter. While at the same time lon term
environmental change that occur slower than at a touch are accepted. This low pass filter both allows
for touches to be detected properly while preventing false positive by passing environmental change
through the filter.
Variation: As the filter is sensitive to setting changes, it is recommended that users read AN3891 before
changing the values. In most cases these default values will work
MPR121
Sensors
Freescale Semiconductor
51
Section C
Register Address
Value
Application Note
ELE0 Touch Threshold
0x0F
AN3892
0x42
ELE0 Release Threshold
0x0A
AN3892
0x43
ELE1 Touch Threshold
0x0F
AN3892
0x44
ELE1 Release Threshold
0x0A
AN3892
0x45
ELE2 Touch Threshold
0x0F
AN3892
0x46
ELE2 Release Threshold
0x0A
AN3892
0x47
ELE3 Touch Threshold
0x0F
AN3892
0x48
ELE3 Release Threshold
0x0A
AN3892
0x49
ELE4 Touch Threshold
0x0F
AN3892
0x4A
ELE4 Release Threshold
0x0A
AN3892
0x4B
ELE5 Touch Threshold
0x0F
AN3892
0x4C
ELE5 Release Threshold
0x0A
AN3892
0x4D
ELE6 Touch Threshold
0x0F
AN3892
0x4E
ELE6 Release Threshold
0x0A
AN3892
0x4F
ELE7 Touch Threshold
0x0F
AN3892
0x50
ELE7 Release Threshold
0x0A
AN3892
0x51
ELE8 Touch Threshold
0x0F
AN3892
0x52
ELE8 Release Threshold
0x0A
AN3892
0x53
ELE9 Touch Threshold
0x0F
AN3892
0x54
ELE9 Release Threshold
0x0A
AN3892
0x55
ELE10 Touch Threshold
0x0F
AN3892
0x56
ELE10 Release Threshold
0x0A
AN3892
0x57
ELE11 Touch Threshold
0x0F
AN3892
0x58
ELE11 Release Threshold
0x0A
AN3892
0x41
Register Name
Description: The touch threshold registers set the minimum delta from the baseline when a touch is detected
0x0F or 15 in decimal is an estimate of the minimum value for touch. Most electrodes will work with
this value even if they vary greatly in size and shape. The value of 0x0A or 10 is the release threshold
register allowed for hysteresis in the touch detection.
Variation: For very small electrodes, smaller values can be used and for very large electrodes the reverse is
true. One easy method is to view the deltas actually seen in a system and set the touch at 80% and
release at 70% of delta for good performance.
Section D
Register Address
0x5D
Register Name
Filter Configuration
Value
Application Note
0x04
AN3890
Description: There are three settings embedded in this register so it is only necessary to pay attention to one.
The ESI controls the sample rate of the device. In the default, the setting used is 0x00 for 1 ms
sample rate. Since the SFI is set to 00, resulting in 4 samples averaged, the response time will be
4 ms.
Variation: To save power, the 1 ms can be increased to 128 ms by increasing the setting to 0x07. The values
are base 2 exponential thus 0x01 = 2 ms; 0x02 = 4 ms; and so on to 0x07 = 128 ms. Most of the
time, 0x04 results in the best compromise between power consumption and response time.
MPR121
52
Sensors
Freescale Semiconductor
Section E
Register Address
0x5E
Register Name
Electrode Configuration
Value
Application Note
0x0C
AN3890
Description: This register controls the number of electrodes being enabled and the mode the device is in. There
are only two modes, Standby (when the value is 0x00) and Run (when the value of the lower bit is
non-zero). The default value shown enables all 12 electrodes by writing decimal 12 or hex 0x0C to
the register. Typically other registers cannot be changed while the part is running so this register
should always be written last.
Variation: During debug of a system, this register will change between the number of electrodes and 0x00
every time a register needs to change. In a production system, this register will only need to be
written when the mode is changed from Standby to Run or vise versa.
Section F
Register Address
Register Name
Value
Application Note
0x7B
AUTO-CONFIG Control Register 0
0x0B
AN3889
0x7D
AUTO-CONFIG USL Register
0x9C
AN3889
0x7E
AUTO-CONFIG LSL Register
0x65
AN3889
0x7F
AUTO-CONFIG Target Level Register
0x8C
AN3889
Description: These are the settings used for the Auto Configuration. They enable AUTO-CONFIG and
AUTO_RECONFIG. In addition they set the target range for the baseline. The upper limit is set to
190, the target is set to 180 and the lower limit is set to 140.
Variation: In most cases these values will never need to be change, but if a case arises, a full description is
found in application note AN3889.
CONCLUSION
In many applications for the MPR121, the default settings presented in this document will be sufficient for both design time
activities as well as in the production implementation.
MPR121
Sensors
Freescale Semiconductor
53
PACKAGE DIMENSIONS
PAGE 1 OF 3
MPR121
54
Sensors
Freescale Semiconductor
PAGE 2 OF 3
MPR121
Sensors
Freescale Semiconductor
55
PACKAGE DIMENSIONS
PAGE 3 OF 3
MPR121
56
Sensors
Freescale Semiconductor
How to Reach Us:
Home Page:
www.freescale.com
Web Support:
http://www.freescale.com/support
USA/Europe or Locations Not Listed:
Freescale Semiconductor, Inc.
Technical Information Center, EL516
2100 East Elliot Road
Tempe, Arizona 85284
1-800-521-6274 or +1-480-768-2130
www.freescale.com/support
Europe, Middle East, and Africa:
Freescale Halbleiter Deutschland GmbH
Technical Information Center
Schatzbogen 7
81829 Muenchen, Germany
+44 1296 380 456 (English)
+46 8 52200080 (English)
+49 89 92103 559 (German)
+33 1 69 35 48 48 (French)
www.freescale.com/support
Japan:
Freescale Semiconductor Japan Ltd.
Headquarters
ARCO Tower 15F
1-8-1, Shimo-Meguro, Meguro-ku,
Tokyo 153-0064
Japan
0120 191014 or +81 3 5437 9125
[email protected]
Asia/Pacific:
Freescale Semiconductor China Ltd.
Exchange Building 23F
No. 118 Jianguo Road
Chaoyang District
Beijing 100022
China
+86 010 5879 8000
[email protected]
For Literature Requests Only:
Freescale Semiconductor Literature Distribution Center
1-800-441-2447 or +1-303-675-2140
Fax: +1-303-675-2150
[email protected]
Information in this document is provided solely to enable system and software
implementers to use Freescale Semiconductor products. There are no express or
implied copyright licenses granted hereunder to design or fabricate any integrated
circuits or integrated circuits based on the information in this document.
Freescale Semiconductor reserves the right to make changes without further notice to
any products herein. Freescale Semiconductor makes no warranty, representation or
guarantee regarding the suitability of its products for any particular purpose, nor does
Freescale Semiconductor assume any liability arising out of the application or use of any
product or circuit, and specifically disclaims any and all liability, including without
limitation consequential or incidental damages. “Typical” parameters that may be
provided in Freescale Semiconductor data sheets and/or specifications can and do vary
in different applications and actual performance may vary over time. All operating
parameters, including “Typicals”, must be validated for each customer application by
customer’s technical experts. Freescale Semiconductor does not convey any license
under its patent rights nor the rights of others. Freescale Semiconductor products are
not designed, intended, or authorized for use as components in systems intended for
surgical implant into the body, or other applications intended to support or sustain life,
or for any other application in which the failure of the Freescale Semiconductor product
could create a situation where personal injury or death may occur. Should Buyer
purchase or use Freescale Semiconductor products for any such unintended or
unauthorized application, Buyer shall indemnify and hold Freescale Semiconductor and
its officers, employees, subsidiaries, affiliates, and distributors harmless against all
claims, costs, damages, and expenses, and reasonable attorney fees arising out of,
directly or indirectly, any claim of personal injury or death associated with such
unintended or unauthorized use, even if such claim alleges that Freescale
Semiconductor was negligent regarding the design or manufacture of the part.
Freescale and the Freescale logo are trademarks of Freescale Semiconductor, Inc.
All other product or service names are the property of their respective owners.
© Freescale Semiconductor, Inc. 2010. All rights reserved.
RoHS-compliant and/or Pb-free versions of Freescale products have the functionality and electrical
characteristics of their non-RoHS-compliant and/or non-Pb-free counterparts. For further
information, see http:/www.freescale.com or contact your Freescale sales representative.
For information on Freescale’s Environmental Products program, go to http://www.freescale.com/epp.
MPR121
Rev. 2
03/2010