CapSense_SetParam not changing the value permamnently

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
bilal247
Level 1
Level 1
First reply posted First question asked Welcome!

HI.

I am working on PSoC 4 project. i have an issue with CapSense_SetParam

i changed the value for finger threshold through this API

CapSense_SetParam(CapSense_DONUT_FINGER_TH_PARAM_ID, FINGER_TH);
CapSense_Start();

 

and then i read it with this API 

CapSense_GetParam(CapSense_DONUT_FINGER_TH_PARAM_ID, &val[0]);

.. it successfully changed the value for finger threshold .

but after power reset of device when i read it again it goes back to values which was flashed through program. 

 

CapSense_SetParam is not changing the value permanently or may be i am missing something

0 Likes
1 Solution
ncbs
Moderator
Moderator
Moderator
500 replies posted 50 likes received 250 sign-ins

Hi @bilal247,

After making necessary changes to the CapSense RAM structure, you would need to make a copy in the flash. This ensures that flash stores the modified CapSense structure. Once you reset the device and come out of it, you need to repopulate the structure from the flash to the RAM.

However, I would not recommend you to follow this as this would waste your precious CPU cycles. If it is possible for you to change the values and reprogram, or use CapSense Tuner and apply the changes to the device, then I would recommend you to follow these.

Regards,
Nikhil

View solution in original post

0 Likes
3 Replies
ncbs
Moderator
Moderator
Moderator
500 replies posted 50 likes received 250 sign-ins

Hi @bilal247,

When you use SetParam function, you change the value in the CapSense_dsRam structure. This is the CapSense structure present in the RAM. Hence, when you reset the device, your configuration will be lost and the configuration present in the project will be restored.

You could change the values by tuning your button using CapSense Tuner, and save the configuration by applying it to your project. By this, you would save the configuration into the project. 

Let me know if this helps.

Regards,
Nikhil

0 Likes
bilal247
Level 1
Level 1
First reply posted First question asked Welcome!

Hi Nikhil

 

Thank you for the reply. i am using the capsense tuner also. but i want to make custom operation in which user can change the values like threshold or denounce, etc. is there any way i can do that by using an API? 

0 Likes
ncbs
Moderator
Moderator
Moderator
500 replies posted 50 likes received 250 sign-ins

Hi @bilal247,

After making necessary changes to the CapSense RAM structure, you would need to make a copy in the flash. This ensures that flash stores the modified CapSense structure. Once you reset the device and come out of it, you need to repopulate the structure from the flash to the RAM.

However, I would not recommend you to follow this as this would waste your precious CPU cycles. If it is possible for you to change the values and reprogram, or use CapSense Tuner and apply the changes to the device, then I would recommend you to follow these.

Regards,
Nikhil

0 Likes