Measure Cmod and Cp of PSoC 4 CapSense - KBA225808

Version 3

    Author: RyanZ_36          Version: **

     

    Question:

    How to measure Cmod and Cp of my PSoC® 4 CapSense® design?

     

    Answer:

    The PSoC 4 CapSense Component contains a built-in self-test library for implementing IEC 60730 Class B requirements. The built-in library supports Cmod and Cp measurement by PSoC 4 CapSense itself.

    Cmod is the external modulator capacitor that is mandatory for operation of the CSD sensing method and required only if CSD sensing is used. The recommended value is 2.2 nF/5V/X7R or an NP0 capacitor.

    Cp is the parasitic capacitance of the sensor in the CSD sensing method.

    To get Cmod and Cp by using the PSoC 4 CapSense BIST library, use the following functions:

    Function definition

    Descriptions

    uint32 CapSense_GetSensorCapacitance(uint32 widgetId, uint32 sensorId)

    The function measures the specified widget/sensor, returns the measurement result, and stores it into the data structure. Component configuration does not influence measurement. It is done with the following parameter settings:

    Modulator clock frequency - as high as possible

    Sense clock source - Direct

    IDAC sensing configuration - IDAC sourcing

    Compensation IDAC - Disabled

    Resolution - 10 bits

    The measurement sensor capacitance range is from 5 pF to 255 pF. If the returned value is 255, the sensor capacitance can be higher.

    uint32 CapSense_GetExtCapCapacitance (uint32 extCapId)

    The function measures the capacitance, returns the measurement result and stores it into the CapSense_EXT_CAP<EXT_CAP_ID>_VALUE register. The CapSense sensor state during measurement is High-Z Analog. The measurement capacitance range is from 200 pF to 60,000 pF. The accuracy of the measurement is 10%.

    The extCapld parameter specifies the ID number of the external capacitor to be measured:

    CapSense_TST_CMOD_ID - Cmod capacitor

    CapSense_TST_CSH_ID - Csh capacitor

    CapSense_TST_CINTA_ID - CintA capacitor

    CapSense_TST_CINTB_ID - CintB capacitor

     

    Attached is an example code to use these functions to measure Cmod and Cp.

    The function execution will use a series of specified CapSense parameters. After execution, it will restore the CapSense parameters of your design.

    In addition to these functions, the BIST library also supports shield sensor, shield tank sensor, and CSX integration capacitors. For more details, see the PSoC4 CapSense Component datasheet, or contact Cypress Tech Support.

    Reference:

    PSoC4 CapSense CSD Component Datasheet

    AN85951 - PSoC® 4 and PSoC® 6 MCU CapSense® Design Guide