Cap Sense CSD method

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

cross mob
melac_296496
Level 2
Level 2

Does anyone know why would I would have to call CapSense_CSD_Start() method twice in order to make my 3 button switch to work correctly?  My top button wouldn't work if i don't call that method twice.  The top button is further away from other 2 buttons.  The tuning method is set to "AutoSense." 

   

Here is the line of code.

   

    CyGlobalIntEnable;  /* Uncomment this line to enable global interrupts. */     
    CapSense_CSD_Start();    
    CapSense_CSD_Start();
    CapSense_CSD_InitializeAllBaselines();

   

for(,,)    

   

if(CapSense_CSD_IsBusy() == 0u){// If not busy.
            /* Update all baselines */
            CapSense_CSD_UpdateEnabledBaselines();
            /* Update On/Off State */
            CapSense_CSD_ScanEnabledWidgets();
            /* Display CapSense state using LED/LCD */         
        }
        CapSense_State();//checks for active widget

   

}

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
VenkataD_41
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi Mehul,

   

I am attaching a simple LED project here which checks whether any of the 3 CapSense buttons is pressed or not and glows LED if the button is touched. Could you please check this code on your board and let me know whether it is working or not? Please ensure that the pins are assigned correctly to CapSense buttons and LED.

   

Thank you,

   

Best Regards,

   

Ganesh.

View solution in original post

0 Likes
8 Replies
Yuva
Moderator
Moderator
Moderator
250 replies posted 250 sign-ins 100 solutions authored

Hi,

   

 

   

It is sufficient to use CapSense_Start() once in the project. Tell us more information about what happens when you use CapSense_Start().

   

Also what happens when using Manual tuning mode?

   

 

   

Thanks,

   

Yuva.

0 Likes

Yuva,

   

I have not tried manual tuning method. I thought it would be best to keep it Auto Sense, since it serves the best results.  As I said before when I use CapSense_start() once, one of the button would not respond.

   

Thanks!

0 Likes
Anonymous
Not applicable

Hello Mehul,

   

Can you please attach your complete project.

   

Thanks,

   

ANMN

0 Likes
lock attach
Attachments are accessible only for community members.

Anmn,

   

Here is the project.

0 Likes
lock attach
Attachments are accessible only for community members.
VenkataD_41
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi Mehul,

   

I am attaching a simple LED project here which checks whether any of the 3 CapSense buttons is pressed or not and glows LED if the button is touched. Could you please check this code on your board and let me know whether it is working or not? Please ensure that the pins are assigned correctly to CapSense buttons and LED.

   

Thank you,

   

Best Regards,

   

Ganesh.

0 Likes

Ganesh,

   

it works, but it still doesn't explain why in my code it doesn't work without adding CapSense_start() twice.

   

 

   

Thanks!

0 Likes

Hi Mehul

   

I am also facing same issue what u mentioned above....

   

I am using Casense_CSD V3.10 component for touch detection. After code loading all my buttons are working fine after some time suddenly one or two buttons are not detecting... I am not able to know what is the exact issue for this. If u solved ur problem pls let me know

0 Likes
melac_296496
Level 2
Level 2

Hi Gangaghar,

   

The only way I was able make this issue go away by calling CapSense_Start() twice at initialization. I am not sure why, but that has worked for me.

0 Likes