Psoc 6 - Capsense CMOD pin assignement

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

cross mob
riccardo-monty
Level 3
Level 3
50 sign-ins 10 replies posted First like received

Is there any constraints to choose a different pin for CMOD from default one?

In a project with a custom board with CY8C6244AZI-S4D93, CMOD is routed to P7.0 but Capsense enable api failed.

Debugger let to observe that call "Cy_CapSense_Enable" return "CY_CAPSENSE_STATUS_BAD_PARAM", as shown with following code:

 

cy_capsense_status_t Cy_CapSense_InternalPreCalculation(cy_stc_capsense_context_t * context)
{
    cy_capsense_status_t initStatus = CY_CAPSENSE_STATUS_SUCCESS;
    uint32_t wdgtIndex;
    uint32_t temp;

    #if (CY_CAPSENSE_ENABLE == CY_CAPSENSE_CSD_EN)
        if ((context->ptrCommonConfig->portCmodPadNum == context->ptrCommonConfig->portCmodNum) &&
            (context->ptrCommonConfig->pinCmodPad == context->ptrCommonConfig->pinCmod))
        {
            context->ptrInternalContext->csdCmodConnection = (uint8_t)CY_CAPSENSE_CMODPAD_E;
        }
        else if ((context->ptrCommonConfig->portCshPadNum == context->ptrCommonConfig->portCmodNum) &&
                 (context->ptrCommonConfig->pinCshPad == context->ptrCommonConfig->pinCmod))
        {
            context->ptrInternalContext->csdCmodConnection = (uint8_t)CY_CAPSENSE_CTANKPAD_E;
        }
        else if ((context->ptrCommonConfig->portShieldPadNum == context->ptrCommonConfig->portCmodNum) &&
                 (context->ptrCommonConfig->pinShieldPad == context->ptrCommonConfig->pinCmod))
        {
            context->ptrInternalContext->csdCmodConnection = (uint8_t)CY_CAPSENSE_CSHIELDPAD_E;
        }
        else if ((context->ptrCommonConfig->portVrefExtPadNum == context->ptrCommonConfig->portCmodNum) &&
                 (context->ptrCommonConfig->pinVrefExtPad == context->ptrCommonConfig->pinCmod))
        {
            context->ptrInternalContext->csdCmodConnection = (uint8_t)CY_CAPSENSE_VREFEXTPAD_E;
        }
        else
        {
            context->ptrInternalContext->csdCmodConnection = (uint8_t)CY_CAPSENSE_CMODPAD_E;
            initStatus = CY_CAPSENSE_STATUS_BAD_PARAM;
        }

 

this code is in "cy_capsense_sensing_v2.c" and come from "capsense middleware v3.0.1"

0 Likes
1 Solution
PandaS
Moderator
Moderator
Moderator
100 solutions authored 5 likes given 250 sign-ins

Hi @riccardo-monty ,

PSoC6 has 3 supported pins for CMOD connection. The recommended pin is P7[1], and P7[2] or P7[7] are also supported.

Please refer to the section 7.4.13.1 External capacitors pin selection of CapSense Design GUide:

https://www.infineon.com/dgdl/Infineon-AN85951_PSoC_4_and_PSoC_6_MCU_CapSense_Design_Guide-Applicati...

Warm regards,

Sobhit

View solution in original post

0 Likes
2 Replies
PandaS
Moderator
Moderator
Moderator
100 solutions authored 5 likes given 250 sign-ins

Hi @riccardo-monty ,

PSoC6 has 3 supported pins for CMOD connection. The recommended pin is P7[1], and P7[2] or P7[7] are also supported.

Please refer to the section 7.4.13.1 External capacitors pin selection of CapSense Design GUide:

https://www.infineon.com/dgdl/Infineon-AN85951_PSoC_4_and_PSoC_6_MCU_CapSense_Design_Guide-Applicati...

Warm regards,

Sobhit

0 Likes
riccardo-monty
Level 3
Level 3
50 sign-ins 10 replies posted First like received

Saddly I must to accept.

I hope that ModusToolbox or Capsense Configurator will return an error about a so wrong setting, in the next release .

0 Likes