MXP121 keyboard programmed no keys depressed, power off, "some keys" pressed with power up and original data that was written is overridden with the "some keys" data. Need help with registers, filters, read, write?

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

MXP121 keyboard programmed no keys depressed, power off, "some keys" pressed with power up and original data that was written is overridden with the "some keys" data. Need help with registers, filters, read, write?

587 Views
tripptucker
Contributor I

MXP121 keyboard programmed no keys depressed, power off, "some keys" pressed with power up and original data that was written is overridden with the "some keys" data. Need help with registers, filters, read, write?

0 Kudos
2 Replies

291 Views
reyes
NXP TechSupport
NXP TechSupport

Hi Tripp,

 

I recommend you to test it using our suggested initialization code:

#define TouchThre 10   //15//30//10

#define ReleaThre 6   //8//25//8

void MPR121_init(void)

{

  //Reset MPR121 if not reset correctly

  IIC_ByteWrite(0x80,0x63);  //Soft reset 

  IIC_ByteWrite(0x5E,0x00);  //Stop mode  

  //touch pad baseline filter

  //rising                                    

  IIC_ByteWrite(0x2B,0x01); // MAX HALF DELTA Rising

  IIC_ByteWrite(0x2C,0x01); // NOISE HALF DELTA Rising

  IIC_ByteWrite(0x2D,0x0E); // NOISE COUNT LIMIT Rising

  IIC_ByteWrite(0x2E,0x00); // DELAY LIMIT Rising

  //falling

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

  IIC_ByteWrite(0x30,0x05); // NOISE HALF DELTA Falling

  IIC_ByteWrite(0x31,0x01); // NOISE COUNT LIMIT Falling

  IIC_ByteWrite(0x32,0x00); // DELAY LIMIT Falling

  //touched

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

  IIC_ByteWrite(0x34,0x00); // Noise counts touched

  IIC_ByteWrite(0x35,0x00); // Filter delay touched

  //Touch pad threshold

  IIC_ByteWrite(0x41,TouchThre); // ELE0 TOUCH THRESHOLD

  IIC_ByteWrite(0x42,ReleaThre); // ELE0 RELEASE THRESHOLD

  IIC_ByteWrite(0x43,TouchThre); // ELE1 TOUCH THRESHOLD

  IIC_ByteWrite(0x44,ReleaThre); // ELE1 RELEASE THRESHOLD

  IIC_ByteWrite(0x45,TouchThre); // ELE2 TOUCH THRESHOLD

  IIC_ByteWrite(0x46,ReleaThre); // ELE2 RELEASE THRESHOLD

  IIC_ByteWrite(0x47,TouchThre); // ELE3 TOUCH THRESHOLD

  IIC_ByteWrite(0x48,ReleaThre); // ELE3 RELEASE THRESHOLD

  IIC_ByteWrite(0x49,TouchThre); // ELE4 TOUCH THRESHOLD

  IIC_ByteWrite(0x4A,ReleaThre); // ELE4 RELEASE THRESHOLD

  IIC_ByteWrite(0x4B,TouchThre); // ELE5 TOUCH THRESHOLD

  IIC_ByteWrite(0x4C,ReleaThre); // ELE5 RELEASE THRESHOLD

  IIC_ByteWrite(0x4D,TouchThre); // ELE6 TOUCH THRESHOLD

  IIC_ByteWrite(0x4E,ReleaThre); // ELE6 RELEASE THRESHOLD

  IIC_ByteWrite(0x4F,TouchThre); // ELE7 TOUCH THRESHOLD

  IIC_ByteWrite(0x50,ReleaThre); // ELE7 RELEASE THRESHOLD

  IIC_ByteWrite(0x51,TouchThre); // ELE8 TOUCH THRESHOLD

  IIC_ByteWrite(0x52,ReleaThre); // ELE8 RELEASE THRESHOLD

  IIC_ByteWrite(0x53,TouchThre); // ELE9 TOUCH THRESHOLD

  IIC_ByteWrite(0x54,ReleaThre); // ELE9 RELEASE THRESHOLD

  IIC_ByteWrite(0x55,TouchThre); // ELE10 TOUCH THRESHOLD

  IIC_ByteWrite(0x56,ReleaThre); // ELE10 RELEASE THRESHOLD

  IIC_ByteWrite(0x57,TouchThre); // ELE11 TOUCH THRESHOLD

  IIC_ByteWrite(0x58,ReleaThre); // ELE11 RELEASE THRESHOLD

  //touch /release debounce

  IIC_ByteWrite(0x5B,0x00);

  // response time = SFI(10) X ESI(8ms) = 80ms

  IIC_ByteWrite(0x5D,0x13);    

  //FFI=18 

  IIC_ByteWrite(0x5C,0x80);  

  //Auto configuration

  IIC_ByteWrite(0x7B,0x8F); 

  // charge to 70% of Vdd , high sensitivity 

  IIC_ByteWrite(0x7D,0xE4);

  IIC_ByteWrite(0x7E,0x94);

  IIC_ByteWrite(0x7F,0xCD);

  // 12 electrodes enabled    

  IIC_ByteWrite(0x5E,0xCC);  

}

 

 

Regarding the communication I recommend you to check the application note AN3895 from the following link: https://www.nxp.com/docs/en/application-note/AN3895.pdf

 

And also recommend you to read the application note AN3890 which includes information about how to improve the capability of a filtering system for the MPR121: https://www.nxp.com/docs/en/application-note/AN3890.pdf

 

Regards,

Jose

NXP Semiconductor

0 Kudos

291 Views
tripptucker
Contributor I

MPR121 is the controller in question.

0 Kudos