MPR121
Sensors
16 Freescale Semiconductor, Inc.
5.11 Electrode Configuration Register (ECR, 0x5E)
The Electrode Configuration Register (ECR) determines if the MPR121 is in Run Mode or Stop Mode, controls the baseline
tracking operation and specifies the input configurations of the 13 channels.
The ECR reset default value is 0x00, which means MPR121 is in Stop Mode without capacitance measurement on all
13 channels. Setting ELEPROX_EN and/or ELE_EN control bits to non-zero data will put the MPR121 into Run Mode. This will
cause the MPR121 to operate immediately on its own. Clearing the ELEPROX_EN and ELE_EN all to zeros will set the MPR121
into Stop Mode (which is its lowest power state). The MPR121 can be switched between Stop Mode and Run Mode at anytime
by configuring the ECR.
If all channels including the13th proximity detection channel are enabled, the proximity sensing channel is scanned first, followed
by ELE0, ELE1..., and ELE11 respectively. The scan runs periodically at the sampling rate specified by the ESI in the Filter/CDT
Configuration Register (0x5D). Refer to the table above for configuration of the different channels. Enabling specific channels will
save the scan time and sensing field power spent on the unused channels.
In a typical touch detection application, baseline tracking is enabled. This is to compensate for the environment and background
induced slow capacitance change to the input sensing channels. The CL bits can enable/disable the baseline tracking and specify
how to load the baseline initial values. Since the baseline tracking filtering system has a very large time constant and the initial
Electrode Configuration Register (0x5E)
Bit D7 D6 D5 D4 D3 D2 D1 D0
Read
CL ELEPROX_EN ELE_EN
Write
Table 9. Bit Descriptions
Field Description
CL
Calibration Lock - Controls the baseline tracking and how the baseline initial value is loaded
00 - Baseline tracking enabled, initial baseline value is current value in baseline value register
(Default)
01 - Baseline tracking is disabled
10 - Baseline tracking enabled, initial baseline value is loaded with the 5 high bits of the first
10-bit electrode data value
11 - Baseline tracking enabled, initial baseline value is loaded with all 10 bits of the first
electrode data value
ELEPROX_EN
Proximity Enable - Controls the operation of 13th Proximity Detection
00 - Proximity Detection is disabled (Default)
01 - Run Mode with ELE0~ELE1 combined for proximity detection enabled
10 - Run Mode with ELE0~ELE3 combined for proximity detection enabled
11 - Run Mode with ELE0~ELE11combined for proximity detection enabled
ELE_EN
Electrode Enable - Controls the operation of 12 electrodes detection
0000 - Electrode detection is disabled (Default)
0001 - Run Mode with ELE0 for electrode detection enabled
0010 - Run Mode with ELE0~ ELE1 for electrode detection enabled
0011 - Run Mode with ELE0~ ELE2 for electrode detection enabled
0100 - Run Mode with ELE0~ ELE3 for electrode detection enabled
0101 - Run Mode with ELE0~ ELE4 for electrode detection enabled
0110 - Run Mode with ELE0~ ELE5 for electrode detection enabled
0111 - Run Mode with ELE0~ ELE6 for electrode detection enabled
1000 - Run Mode with ELE0~ ELE7 for electrode detection enabled
1001 - Run Mode with ELE0~ ELE8 for electrode detection enabled
1010 - Run Mode with ELE0~ ELE9 for electrode detection enabled
1011 - Run Mode with ELE0~ ELE10 for electrode detection enabled
11xx - Run Mode with ELE0~ ELE11 for electrode detection enabled
MPR121
Sensors
Freescale Semiconductor, Inc. 17
baseline value starts from zero, it will require a very long time for the baseline to ramp up. This results in a short period of no
response to touch after the MPR121 is first set to Run Mode. Setting the CL = 2b10 will command the MPR121 to load the initial
baseline value at the beginning of the Run Mode. This shortens the initial baseline ramp-up time so that user will not notice any
delay on touch detection. The MPR121 uses the five high bits of the first measured 10 bit electrode data.
Auto-Configuration Registers (0x7B~0x7F)
For each enabled channel, both the charge time and charge current must be set properly. This is so that a specified amount of
charge field can be built on the sensing pad and that the capacitance can be measured using the internal ADC. When all 13
channels are used, there are total 13 CDCx and 13 CDTx values which need to be configured.
The MPR121 provides an auto-configuration function which is able to automatically search and set the charging parameters.
When autoconfiguration is run, specific CDCx and CDTx combinations for the enabled channels can be obtained automatically.
This eliminates test trials on the prototype device and for further verification on final products. A key task for the design engineer
is to verify if the parameter settings generated by the MPR121 are acceptable. This verification ensures that the settings are
optimized each time MPR121 powers on and that the equipment can operate in many different environments.
The autoconfiguration finds the optimized CDCx and CDTx combination for each channel so that the charge level
(I x T = V) on the each channel is as close as possible to the target setting specified by the designer. An upper and lower setting
limit are used to provide the boundaries necessary to verify if the system is setup to operate correctly. If the autoconfiguration
can not find the proper CDCx and CDTx value, an Out Of Range (OOR) status will be set for that channel.
Autoconfiguration operates each time the MPR121 transitions from Stop Mode to Run Mode. After autoconfiguration is
completed, a set of CDCx and CDTx values for each channel are calculated and automatically loaded into the corresponding
register fields.
If autoconfiguration fails, the MPR121 has an auto-reconfiguration function. Autoreconfiguration runs at each sampling interval
if a channel has OOR status from a failed autoconfiguration. Autoreconfiguration will run until the OOR status is cleared or until
it is disabled.
There are five registers used to control the MPR121 auto-configuration feature. Registers 0x7B and 0x7C are used as the control
registers and registers 0x07D to 0x7F are used to hold the configuration target settings. Refer to application note AN3889 for
more information.
FFI: The FFI bits are the same as the FFI bits in register 0x5C for correct auto-configuration and reconfiguration operations.
ACE: Auto-Configuration Enable. 1: Enable, 0: Disable. When Enabled, the autoconfiguration will operate once at the beginning
of the transition from Stop Mode to Run Mode. This includes search and update of the CDCx and CDTx for each enabled channel
(if SCTS = 0).
ARE: Auto-Reconfiguration Enable. 1: Enable, 0: Disable. When enabled, if the OOR is set for a channel after autoconfiguration,
autoreconfiguration will operate on that channel on each sampling interval until the OOR is cleared.
BVA: Fill the BVA bits same as the CL bits in ECR (0x5E) register.
RETRY: Specifies the number of retries for autoconfiguration and autoreconfiguration if the configuration fails before setting
OOR.
Auto-Configure Control Register 0 (0x7B)
Bit D7 D6 D5 D4 D3 D2 D1 D0
Read
FFI RETRY BVA ARE ACE
Write
Auto-Configure Control Register 1 (0x7C)
Bit D7 D6 D5 D4 D3 D2 D1 D0
Read
SCTS
OORIE ARFIE ACFIE
Write
00 - No retry
01 - retry 2 times
10 - retry 4 times
11 - retry 8 times
MPR121
Sensors
18 Freescale Semiconductor, Inc.
SCTS: Skip Charge Time Search.
1: Skip CDTx search and update when autoconfiguration or autoreconfiguration, and current global CDT or CDTx are used
for respective channels. CDT or CDTx needs to be specified by the designer manually before operation. Setting the SCTS
to “1” results in a shorter time to complete autoconfiguration. This is useful for when the designer has obtained the correct
CDTx / CDT, and is confident that the current CDT and CDTx settings work in all conditions.
0: Both CDTx and CDCx will be searched and set by autoconfiguration and/or autoreconfiguration.
ACFIE: Auto-configuration fail interrupt enable. 1: Enable, 0: Disable
ARFIE: Auto-reconfiguration fail interrupt enable. 1: Enable, 0: Disable
OORIE: Out-of-range interrupt enable. 1: Enable, 0: Disable
USL: Up-Side Limit. This value sets the electrode data level up limit for the boundary check in autoconfiguration and
autoreconfiguration operation.
LSL: Low-Side Limit. This value sets the electrode data level low limit for the boundary check in autoconfiguration and
autoreconfiguration operation.
TL: Target Level. This value is the expected target electrode data level for autoconfiguration and autoreconfiguration, that is, after
successful autoconfiguration and autoreconfiguration, the measured electrode data level when untouched shall be close to the
TL value. TL shall be in between of USL and LSL.
The three parameters, USL, LSL and TL, are in the format similar to the baseline value; only the eight high bits are accessible
by user and the two low bits are set to zero automatically. The USL/LSL/TL data needs to be shifted left two bits before comparing
with the electrode data or the 10-bit baseline value.
In order to have a valid auto-configuration result, USL/LSL/TL values should follow the relation that 255 > USL > TL > LSL > 0.
For example, USL = 200, TL = USL*0.9 = 180, LSL = USL*0.5 = 100.
It is possible that in a end user environment, the channel differences may be significant. This is because the same set of USL/
LS/TL data is being used for all channels. It is important that the parameters not be set too close together. This makes it difficult
for the autoconfiguration to find a suitable charge setting for a specific channel. In this case, the electrode data might easily go
out of USL and LSL setting limits. Since the data is out-of-range, the channel status becomes OOR. If the channel is still OOR
after the autoconfiguration has been run, it may indicate that the settings for this channel have not yet been optimized. One
solution to this problem is to manually review the USL/LSL/TL settings. Another possible reason why the channel status could
be OOR is a problem with the channel itself. This could be caused by a short to ground, short to the power rail, or short to the
pad of the other channel.
For the TL setting, a good practice is to try to set it close to the USL. This so the charge field can be set to detect a weak touch.
On the other hand, the TL should not be set too close to the USL so that it is constantly exceeding the limit. For example, the
electrode data from the end user’s environment might have a much wider variance of readings. Some of the readings might
exceed the USL, causing the auto-configuration to fail. For this reason, if the amount of capacitance change in the end user
environment is significant, it is suggested that the USL and TL be set low enough to give some headroom for possible capacitance
variations.
Up-Side Limit Register (0x7D)
Bit D7 D6 D5 D4 D3 D2 D1 D0
Read
USL
Write
Low-Side Limit Register (0x7E)
Bit D7 D6 D5 D4 D3 D2 D1 D0
Read
LSL
Write
Target Level Register (0x7F)
Bit D7 D6 D5 D4 D3 D2 D1 D0
Read
TL
Write

MPR121QR2

Mfr. #:
Manufacturer:
NXP / Freescale
Description:
Capacitive Touch Sensors Low Voltage Touch Pad
Lifecycle:
New from this manufacturer.
Delivery:
DHL FedEx Ups TNT EMS
Payment:
T/T Paypal Visa MoneyGram Western Union

Products related to this Datasheet