Measure Cmod and Cp of PSoC 4S CapSense for CSD V7.0

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

cross mob
YoIs_1298666
Level 5
Level 5
250 sign-ins 100 replies posted 100 sign-ins

Hello,

We are trying it with CY8CKIT-145-40XX.

We know that there is the "Measure Cmod and Cp of PSoC 4 CapSense - KBA225808".

However, this KBA only works up to CSD V6.0 and is obsolete in V7.0.

The arguments of the API functions below are different.

[up to CSD V6.0]

   uint32 CapSense_GetSensorCapacitance (uint32  widgetId, uint32  sensorId)

[CSD V7.0]

   uint32 CapSense_GetSensorCapacitance (uint32  widgetId, uint32  sensorElement,

                                                                        CapSense_TST_MEASUREMENT_STATUS_ENUM *  measurementStatusPtr)

Therefore, We added and changed the following codes.

[Addition]

   CapSense_TST_MEASUREMENT_STATUS_ENUM measurementStatusPtr;

[Change]

    // MyI2CRegs.u8_cpValue = (uint8)CapSense_GetSensorCapacitance (i, 0);

    MyI2CRegs.u8_cpValue = (uint8)CapSense_GetSensorCapacitance (i, 0, &measurementStatusPtr);

The result of measuring Cp is as follows.

[up to CSD V6.0]

    u8_cpValues are correct.pastedImage_0.png

[CSD V7.0]

     u8_cpValues are incorrect.pastedImage_2.png

We have confirmed that the value of measurementStatusPtr is CapSense_TST_MEASUREMENT_SUCCESS.

Why?

Best regards,

Yocchi

0 Likes
1 Solution
BragadeeshV
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hi YoIs_1298666​,

The CapSense component v7.0 returns Capacitance in fF therefore the return of this API can not fit into uint8_t , please use uint32_t since the function returns uint32.

Regards,

Bragadeesh

Regards,
Bragadeesh

View solution in original post

0 Likes
3 Replies
BragadeeshV
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hi YoIs_1298666​,

The CapSense component v7.0 returns Capacitance in fF therefore the return of this API can not fit into uint8_t , please use uint32_t since the function returns uint32.

Regards,

Bragadeesh

Regards,
Bragadeesh
0 Likes

Hello Bragadeesh-san,

Thank you very much for your help.

I changed the code and ran it.

pastedImage_0.png

The result is below.

[up to CSD V6.0]

    u8_cpValue[0] = 0x0c (12pF)

    u8_cpValue[1] = 0x0e (14pF)

[CSD V7.0]

    u32_cpValue[0] = 0x3166 (12.646pF)

    u32_cpValue[1] = 0x39d8 (14.808pF)

Is this correct?

Best regards,

Yocchi

0 Likes

Hi YoIs_1298666​-san,

Thanks for the quick response., Yes, it is correct now.

Regards,

Bragadeesh

Regards,
Bragadeesh
0 Likes