1 of 1 people found this helpful
1. Is there a way to to this through firmware, or to get and read the current values of those parameters? I tried using the capsense_getParam API with the macros defined in the capsense_registermap.h header (it works for other advanced param like finger threshold) but none give access to those parameters I believe.
It is possible to change all the parameters through firmware as well. All the parameters are accessible through the getParam API as you have mentioned.
1. Tx clock frequency - In the firmware, the frequency is not set directly. Instead, the divider value is set. To access this, the param ID is CapSense_BTN0_SNS_CLK_PARAM_ID. You can pass this to the API and it will return the hardware divider value. To understand the actual frequency, you can divide the Mod Clk frequency with this value. Eg, if the mod clk is 48MHz and the divider value that you obtained is 24, it means that the actual Tx clock frequency is 2MHz (48 MHz/24).
2. Number of subconversions - This parameter is called resolution in the internal macros and the parameter to be passed is CapSense_BTN0_RESOLUTION_PARAM_ID.
Similarly, you can find the other parameters in the CapSense_RegisterMap.h header file.
In the CSX tuning example for PSOC 4, It mentions that I have to check the value of the IDAC code after setting up the TX clock frequency. https://www.cypress.com/file/504331/download p.6
2. I see every element in my widget has a different IDAC value. what is the difference between the IDAC value and the IDAC gain (and mA/bit??), I cannot quite grasp what they mean?
Internally, the IDAC hardware has two parameters, IDAC gain and IDAC code. the actual current that flows through this DAC is a product of these two parameters. For example, if the IDAC gain is 2400uA/bit and the IDAC code that you set is 40, then the total current that is pumped out whenever the DAC is active is 2400 x 40 = 96000 uA or 9.6 mA. Note that in the component, you can set the IDAC code for every sensor, but the IDAC gain is common for a widget. Different widgets can have different IDAC gains.
It is recommended to keep the IDAC code auto-calibrated to accommodate temperature variations and other environmental variations.