AnsweredAssumed Answered

MPR121 slow response after configuration change

Question asked by yosi greenbeerg on Feb 8, 2016
Latest reply on Feb 9, 2016 by David Diaz Marin

Hi all,

 

We are using the MPR121 in two configurations, Regular (12 keys) and Low energy (2 keys).

To switch between configuration we use the MPR121_init(config)  function with argument 0 or 1 respectively.

After switching from 2 keys config into 12 keys, we have a delay of about 4 seconds before we can see response of the Interrupt signal on the scope.

This slow response is not acceptable in our system.

The configuration of the registers are taken from application note.

 

Are we doing something wrong?

Can we improve the configuration to a chive a faster response of MPR121 after config change?

 

Regards,

Yosi.

 

 

void MPR121_init(uint8_t config)

{

  //Reset MPR121 if not reset correctly

  MPR_ByteWrite(Slave_Addr,0x80,0x63); //Soft reset

  MPR_ByteWrite(Slave_Addr,0x5E,0x00); //Stop mode

  //touch pad baseline filter

  //rising

  MPR_ByteWrite(Slave_Addr,0x2B,0x01); //0xFF// MAX HALF DELTA Rising

  MPR_ByteWrite(Slave_Addr,0x2C,0x01); //0xFF// NOISE HALF DELTA Rising

  MPR_ByteWrite(Slave_Addr,0x2D,0x00); // //0 NOISE COUNT LIMIT Rising

  MPR_ByteWrite(Slave_Addr,0x2E,0x00); // DELAY LIMIT Rising

  //falling

  MPR_ByteWrite(Slave_Addr,0x2F,0x01); // MAX HALF DELTA Falling

  MPR_ByteWrite(Slave_Addr,0x30,0x01); // NOISE HALF DELTA Falling

  MPR_ByteWrite(Slave_Addr,0x31,0xFF); // NOISE COUNT LIMIT Falling

  MPR_ByteWrite(Slave_Addr,0x32,0x02); // //2//DELAY LIMIT Falling

  //touched

  MPR_ByteWrite(Slave_Addr,0x33,0x00); // Noise half delta touched

  MPR_ByteWrite(Slave_Addr,0x34,0x00); // Noise counts touched

  MPR_ByteWrite(Slave_Addr,0x35,0x00); //Filter delay touched

  //Touch pad threshold

  MPR_ByteWrite(Slave_Addr,0x41,TOUCH_THRESHOLD);   // ELE0 TOUCH THRESHOLD

  MPR_ByteWrite(Slave_Addr,0x42,RELEASE_THRESHOLD); // ELE0 RELEASE THRESHOLD

  MPR_ByteWrite(Slave_Addr,0x43,TOUCH_THRESHOLD);   // ELE1 TOUCH THRESHOLD

  MPR_ByteWrite(Slave_Addr,0x44,RELEASE_THRESHOLD); // ELE1 RELEASE THRESHOLD

  MPR_ByteWrite(Slave_Addr,0x45,TOUCH_THRESHOLD);   // ELE2 TOUCH THRESHOLD

  MPR_ByteWrite(Slave_Addr,0x46,RELEASE_THRESHOLD); // ELE2 RELEASE THRESHOLD

  MPR_ByteWrite(Slave_Addr,0x47,TOUCH_THRESHOLD);   // ELE3 TOUCH THRESHOLD

  MPR_ByteWrite(Slave_Addr,0x48,RELEASE_THRESHOLD); // ELE3 RELEASE THRESHOLD

  MPR_ByteWrite(Slave_Addr,0x49,TOUCH_THRESHOLD);   // ELE4 TOUCH THRESHOLD

  MPR_ByteWrite(Slave_Addr,0x4A,RELEASE_THRESHOLD); // ELE4 RELEASE THRESHOLD

  MPR_ByteWrite(Slave_Addr,0x4B,TOUCH_THRESHOLD);   // ELE5 TOUCH THRESHOLD

  MPR_ByteWrite(Slave_Addr,0x4C,RELEASE_THRESHOLD); // ELE5 RELEASE THRESHOLD

  MPR_ByteWrite(Slave_Addr,0x4D,TOUCH_THRESHOLD);   // ELE6 TOUCH THRESHOLD

  MPR_ByteWrite(Slave_Addr,0x4E,RELEASE_THRESHOLD); // ELE6 RELEASE THRESHOLD

  MPR_ByteWrite(Slave_Addr,0x4F,TOUCH_THRESHOLD);   // ELE7 TOUCH THRESHOLD

  MPR_ByteWrite(Slave_Addr,0x50,RELEASE_THRESHOLD); // ELE7 RELEASE THRESHOLD

  MPR_ByteWrite(Slave_Addr,0x51,TOUCH_THRESHOLD);   // ELE8 TOUCH THRESHOLD

  MPR_ByteWrite(Slave_Addr,0x52,RELEASE_THRESHOLD); // ELE8 RELEASE THRESHOLD

  MPR_ByteWrite(Slave_Addr,0x53,TOUCH_THRESHOLD);   // ELE9 TOUCH THRESHOLD

  MPR_ByteWrite(Slave_Addr,0x54,RELEASE_THRESHOLD); // ELE9 RELEASE THRESHOLD

  MPR_ByteWrite(Slave_Addr,0x55,TOUCH_THRESHOLD);   // ELE10 TOUCH THRESHOLD

  MPR_ByteWrite(Slave_Addr,0x56,RELEASE_THRESHOLD); // ELE10 RELEASE THRESHOLD

  MPR_ByteWrite(Slave_Addr,0x57,TOUCH_THRESHOLD);   // ELE11 TOUCH THRESHOLD

  MPR_ByteWrite(Slave_Addr,0x58,RELEASE_THRESHOLD); // ELE11 RELEASE THRESHOLD

  //AFE configuration

  MPR_ByteWrite(Slave_Addr,0x5D,0x00); //0x00 (SFI = 4, ESI = 1 ms, so the response time is 4 ms)

  MPR_ByteWrite(Slave_Addr,0x5C,0xC0); //0xC0 (take 34 samples, which is good for interference immunity)

  //Auto configuration

  MPR_ByteWrite(Slave_Addr,0x7B,0xCB);

  MPR_ByteWrite(Slave_Addr,0x7D,0xE4);

  MPR_ByteWrite(Slave_Addr,0x7E,0x94);

  MPR_ByteWrite(Slave_Addr,0x7F,0xCD);

  if( config == 0 ){

    MPR_ByteWrite(Slave_Addr,0x5E,0x0C); //Start mode; (0x5E) = 0x0C (for 12 electrodes)

  }else{

    MPR_ByteWrite(Slave_Addr,0x5E,0x02); // low energy mode; (0x5E) = 0x02 (for 2 electrodes)

  }

Outcomes