AnsweredAssumed Answered

MPR121 - wrong touch detection

Question asked by Dmitri Poverenov on Sep 11, 2016
Latest reply on Sep 13, 2016 by Jose Alberto Reyes Morales

Hi ,

 

We are using the MPR121 for proximity sensor. One big electrode is connected to ELE0 of MPR121 for touch sensing.

The configuration works good but sometimes (usually 5-6 times during a day) we get wrong touch detection (touch detection occurs without touching the electrode).

 

The configurations of the registers are taken from application note AN3893.

 

Are we doing something wrong?

 

Thank you for your help

 

Regards,

 

Dima.

 

void ProxInit()
{
//Reset MPR121 if not reset correctly
I2C_ByteWrite(PROX_I2C_COMPONENT_ADDR,0x80,0x63); //Soft reset
I2C_ByteWrite(PROX_I2C_COMPONENT_ADDR,0x5E,0x00); //Stop mode

//touch pad baseline filter
//rising
I2C_ByteWrite(PROX_I2C_COMPONENT_ADDR,0x2B,0x01); //0xFF// MAX HALF DELTA Rising
I2C_ByteWrite(PROX_I2C_COMPONENT_ADDR,0x2C,0x01); //0xFF// NOISE HALF DELTA Rising
I2C_ByteWrite(PROX_I2C_COMPONENT_ADDR,0x2D,0x00); // NOISE COUNT LIMIT Rising
I2C_ByteWrite(PROX_I2C_COMPONENT_ADDR,0x2E,0x00); // DELAY LIMIT Rising
//falling
I2C_ByteWrite(PROX_I2C_COMPONENT_ADDR,0x2F,0x01); // MAX HALF DELTA Falling
I2C_ByteWrite(PROX_I2C_COMPONENT_ADDR,0x30,0x01); // NOISE HALF DELTA Falling
I2C_ByteWrite(PROX_I2C_COMPONENT_ADDR,0x31,0xFF); // NOISE COUNT LIMIT Falling
I2C_ByteWrite(PROX_I2C_COMPONENT_ADDR,0x32,0x02); // DELAY LIMIT Falling

 

//touched
I2C_ByteWrite(PROX_I2C_COMPONENT_ADDR,0x33,0x00); // Noise half delta touched
I2C_ByteWrite(PROX_I2C_COMPONENT_ADDR,0x34,0x00); // Noise counts touched
I2C_ByteWrite(PROX_I2C_COMPONENT_ADDR,0x35,0x00); //Filter delay touched

//Touch pad threshold
I2C_ByteWrite(PROX_I2C_COMPONENT_ADDR,0x41,200); // ELE0 TOUCH THRESHOLD
I2C_ByteWrite(PROX_I2C_COMPONENT_ADDR,0x42,190); // ELE0 RELEASE THRESHOLD

 

// Debounce Register
DebounceNumberTouch = 0;
I2C_ByteWrite(PROX_I2C_COMPONENT_ADDR,0x5B,DebounceNumberTouch);


//AFE configuration
I2C_ByteWrite(PROX_I2C_COMPONENT_ADDR,0x5D,0x04);
I2C_ByteWrite(PROX_I2C_COMPONENT_ADDR,0x5C,0xC0); 

//Auto configuration
I2C_ByteWrite(PROX_I2C_COMPONENT_ADDR,0x7B,0xCB);
I2C_ByteWrite(PROX_I2C_COMPONENT_ADDR,0x7D,0xE4);
I2C_ByteWrite(PROX_I2C_COMPONENT_ADDR,0x7E,0x94);
I2C_ByteWrite(PROX_I2C_COMPONENT_ADDR,0x7F,0xCD);

//GPIO for LED's configuration
I2C_ByteWrite(PROX_I2C_COMPONENT_ADDR,0x73,0x0F); //GPIO Control 0
I2C_ByteWrite(PROX_I2C_COMPONENT_ADDR,0x74,0x0F); //GPIO Control 1

I2C_ByteWrite(PROX_I2C_COMPONENT_ADDR,0x76,0x0F); //GPIO Direction
I2C_ByteWrite(PROX_I2C_COMPONENT_ADDR,0x77,0x0F); //GPIO Enable


Elec_Config_Prox_Reg = 0x91;
I2C_ByteWrite(PROX_I2C_COMPONENT_ADDR,0x5E,Elec_Config_Prox_Reg); 

}

Outcomes