You are here

Cap Sense CSD method | Cypress Semiconductor

Cap Sense CSD method

Summary: 8 Replies, Latest post by Mehul on 10 Apr 2017 04:52 AM PDT
Verified Answers: 1
Last post
Log in to post new comments.
Mehul's picture
User
15 posts

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

}

yuva's picture
Cypress Employee
37 posts

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.

Mehul's picture
User
15 posts

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!

anmn's picture
Cypress Employee
5 posts

Hello Mehul,

Can you please attach your complete project.

Thanks,

ANMN

Mehul's picture
User
15 posts

Anmn,

Here is the project.

Attachments: 
gani's picture
Cypress Employee
12 posts

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.

Mehul's picture
User
15 posts

Ganesh,

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

 

Thanks!

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

Mehul's picture
User
15 posts

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.

Log in to post new comments.