mpr121 auto adjust baseline values

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

mpr121 auto adjust baseline values

1,208 Views
maximadelman
Contributor I

My system consists of a touchpad that can be used either free-hanging or attached to

glass.  I would like the keypad to be able to move from free-hanging to attached

state and back without explicit recalibration performed by the application.

The values in the filtered electrode data registers in free-hanging mode are ~ 0x3D0.

In attached mode, they are ~0x360.  I am having the following problem - no matter what I try, I

can only get the baseline registers to auto-adjust from the smaller to the larger

values.   I.e. if I calibrate attached to the glass, baseline register will contain 0x360;

subsequently removing the touchpad from the glass, I see baseline registers change to

0x3D0.  However, the opposite is not true - if I calibrate in free-hanging mode and then

attach to the glass, then the baseline registers will not adjust from 0x3D0 to 0x360 no

matter how long I wait.

The values I program into baseline control registers are:

MHD_R = MHD_F = 0x3F

NHD_R  = NHD_F = 0x4

NCL_R   = NCL_F = 0x2

FDL_R   = FDL_F = 0x2


Any help would be appreciated.  It is a given that the device will not be operated multiple seconds around the change of state from attached to free-standing and back.

Labels (1)
0 Kudos
2 Replies

513 Views
TomasVaverka
NXP TechSupport
NXP TechSupport

Maxim,

The MPR121 is not supposed to work as you require.

When glass suddenly attached, the cap increase, cause electrode data quickly decrease to 0x360, the delta = 0x3D0 - 0x360 >  touch threshold, this has the same effect as finger touch, so baseline locked to previous 0x360 and a touch is detected.

I do not think there is a good solution for this, unless there is a way to know when the glass is attached. You cannot distinguish  a  glasss attached or something like finger touched.  

While if knowing the glass attached,  actually recalibration is very easy by auto configuration after software reset.

Regards,

Tomas

513 Views
maximadelman
Contributor I

Tomas - thanks for the reply.  If I understand correctly, the control registers above are used to configure the operation for adjusting the baseline registers both up and down.  Are you saying that in my case the adjustment cannot be done in one direction because the jump is larger than the threshold used to establish a touch?  (It is ok if the touch gets detected in my case during the adjustment, as long as baseline eventually moves).

I suppose I can add something in SW to detect a continuous touch, and if that persists for more than some duration of time, to cause auto-recaliibration. 

0 Kudos