First of all, the target of raw count percent is 85%, when auto-calibration is used.
For manual tuning, you has to consider the equations described in design guide, especially for Equation 3-9 to Equation 3-12.
Best practice would be that you perform auto-calibration first and then perform manual tuning (changing IDAC parameters) to get your target of raw count.
This quesiton is not used "auto-calibration".
Can we set it with only CapSense_SetParam?
yes, I understand your question is for "auto-calibration".
However, I can not completely understand why you would like to set "Raw count percent".
could you please elaborate the background of this inquiry?
Still not sure the background of this inquiry... however, try to answer the questions...
if you would like to set the target of "Raw count percent" manually, there are two method to change target "Raw count percent".
- 1 - use "Show Expression View" in PSoC Creator, and set the required target percentage to CsdRawCountCalibrationLevel in CapSense component configuration.
Select the menu "Tools" --> "Options".
Select "Component Catalog" and check "Enable Param Edit Views"
In the CapSense component configuration, right click on "Advanced" tab and select "Show Expression View".
Set the required percent to the "CsdRawCountCalibrationLevel"
- 2 - Manually change the macro "CapSense_CSD_RAWCOUNT_CAL_LEVEL" value in CapSense_Configuration.h to the required percentage.
And, it would be good to perform auto-calibration first, then manually change parameters.
Note that some CapSense parameters can be changed by CapSense_SetParam(), but not for macros.
Thank you for your reply.
What do you mean "but not for macros"?
> Note that some CapSense parameters can be changed by CapSense_SetParam(), but not for macros.
#define CapSense_CSD_RAWCOUNT_CAL_LEVEL (85u)
defined in CapSense_Configuration.h.
Thank you very much.
I could change the gain below.
CapSense_SetParam (CapSense_BUTTON0_IDAC_MOD0_PARAM_ID, 16);
CapSense_Start(); /* Initialize CapSense Component */
Your two methods are changing IDAC value and feeding back the raw counts that is not touched the finger repeatedly, right?
The answer for additional question would be "YES".
The above two methods (below - 0 -, - 1 -) set the target percent of raw count, the chip will automatically change IDAC(Auto-Calibration) to move raw count(no touch) at the target we set.
- 0 - set the target raw count percent
- 1 - IDAC is tuned by auto-calibration with the changed target percent
- 2 - other parameters will be changed by manual tuning