CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

MPR121 For Proximity
Goto page Previous  1, 2, 3
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
ressas



Joined: 15 Nov 2019
Posts: 135

View user's profile Send private message

PostPosted: Tue May 05, 2020 3:33 am     Reply with quote

Thank you for your patience. I will try this.

and I will report the result
ressas



Joined: 15 Nov 2019
Posts: 135

View user's profile Send private message

PostPosted: Sun May 10, 2020 11:48 pm     Reply with quote

Hello.
I applied what you said.
However, the shift continues,
I think I made the other settings correctly. Because I applied the code in the link I gave one to one.
I had a new integrated: FDC1004.
I also tested it. But its values are shifting too. :( Sad
I have also tried other integration that I have run with your help before (FDC2114).
But its values are shifting too. :( Sad
So this problem stems from a different place.
Maybe that is why wet washing the circuits may be a problem. How can I solve this?
Do you have any other suggestions? Question
Ttelmah



Joined: 11 Mar 2010
Posts: 19215

View user's profile Send private message

PostPosted: Mon May 11, 2020 4:11 am     Reply with quote

No.
The issue is that you are not configuring the baseline filter values.
These are registers 0x2B to 0x40.
The setting for the ELEPROX baseline, is separate to the ones for the
other twelve readings. The example code you have used, is not setting
up the ELEPROX baseline filter. Hence it won't adjust....
These are the registers starting at MHDPROXR. Note nothing put into
these in the settings you are using.
Look at the document I pointed to earlier about how to setup these
values. You could start by just trying the values used for the other
channels.
ressas



Joined: 15 Nov 2019
Posts: 135

View user's profile Send private message

PostPosted: Mon May 11, 2020 5:11 am     Reply with quote

Yeah. The parts you acquire are not configured. But this does not explain why other sensors shift value. I work for the right configuration, I will return to you.
Code:

   MPR121_write(0x80, 0x63); // Soft Reset Reg.
   //
   MPR121_write(0x2B, 0x01);
   MPR121_write(0x2C, 0x01);
   MPR121_write(0x2D, 0x00);
   MPR121_write(0x2E, 0x00);
   
   MPR121_write(0x2F, 0x01);
   MPR121_write(0x30, 0x01);
   MPR121_write(0x31, 0xFF);
   MPR121_write(0x32, 0x00);
   //   
   MPR121_write(0x33, 0x00);
   MPR121_write(0x34, 0x00);
   MPR121_write(0x35, 0x00);
   //
   MPR121_write(0x36, 0x0F); //0x36 //0x01 0xff
   MPR121_write(0x37, 0x0F); //0x37 //0x01 0xff               
   MPR121_write(0x38, 0x00); //0x38 //0x00 0x00
   MPR121_write(0x39, 0x00); //0x39 //0x00 0x00
   
   MPR121_write(0x3A, 0x01); //0x3A //0x01 0x01
   MPR121_write(0x3B, 0x01); //0x3B //0x01 0x01               
   MPR121_write(0x3C, 0xFF); //0x3C //0xff 0xff
   MPR121_write(0x3D, 0xFF); //0x3D //0x02 0xff

   MPR121_write(0x3E, 0x00); //0x3E
   MPR121_write(0x3F, 0x00); //0x3F     
   MPR121_write(0x40, 0x00); //0x40
   //
   MPR121_write(ELE0_T, TouchThre); //0x41
   MPR121_write(ELE0_R, ReleaThre); //0x42 
   MPR121_write(ELE1_T, TouchThre); //0x41
   MPR121_write(ELE1_R, ReleaThre); //0x42     
   MPR121_write(ELE2_T, TouchThre); //0x41
   MPR121_write(ELE2_R, ReleaThre); //0x42 
   MPR121_write(ELE3_T, TouchThre); //0x41
   MPR121_write(ELE3_R, ReleaThre); //0x42 
   MPR121_write(ELE4_T, TouchThre); //0x41
   MPR121_write(ELE4_R, ReleaThre); //0x42 
   MPR121_write(ELE5_T, TouchThre); //0x41
   MPR121_write(ELE5_R, ReleaThre); //0x42 
   MPR121_write(ELE6_T, TouchThre); //0x41
   MPR121_write(ELE6_R, ReleaThre); //0x42 
   MPR121_write(ELE7_T, TouchThre); //0x41
   MPR121_write(ELE7_R, ReleaThre); //0x42 
   MPR121_write(ELE8_T, TouchThre); //0x41
   MPR121_write(ELE8_R, ReleaThre); //0x42 
   MPR121_write(ELE9_T, TouchThre); //0x41
   MPR121_write(ELE9_R, ReleaThre); //0x42
   MPR121_write(ELE10_T, TouchThre); //0x41
   MPR121_write(ELE10_R, ReleaThre); //0x42
   MPR121_write(ELE11_T, TouchThre); //0x57
   MPR121_write(ELE11_R, ReleaThre); //0x58
   //
   MPR121_write(EPROXTTH,Prox_TouchThre); //0x59  // 0x06 TOUCH relase dokun bırak 0x59
   MPR121_write(EPROXRTH,Prox_ReleaThre); //0x5A  // 0x05 RELEASE

   MPR121_write(DEBOUNCE,0x00); //0x5B
 
   MPR121_write(FIL_CFG1,0x3f); // 0x5c //0x24 0010 0100                           // [3:cdt][2:SFI][3:ESI]
   MPR121_write(FIL_CFG2,0x64); // 0x5d   0x10 0001 0000
   MPR121_write(ELE_CFG, 0x90); //0x5E //çalışan
 
   MPR121_write(AUTO_CFG0, 0x0B);       //7B          0x01
  // MPR121_write(AUTO_CFG_CTRL, 0xC9); //7C
   MPR121_write(AUTO_CFGU, 0xC8);       //0x7D //USL 0x9c
   MPR121_write(AUTO_CFGL, 0x82);       //0x7E //LSl 0x8c
   MPR121_write(AUTO_CFGT, 0xb4);       //0x7F //TL  0x65
 
   MPR121_write(ELE_CFG, 0x90); //0x5E //çalışan bc


         c_L = MPR121_read(EFDPROX_L); // 0x1c
         c_H = MPR121_read(EFDPROX_H);
         data=make16(c_H,c_L);
         
         baseline =  MPR121_read(EPROXBV);
         baseline_new = baseline * 4;
         
         value = data - baseline;
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2, 3
Page 3 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group