You are here

Cap Sense CSD method | Cypress Semiconductor

Cap Sense CSD method

Summary: 6 Replies, Latest post by Mehul on 10 Nov 2016 05:08 AM PST
Verified Answers: 1
Last post
Log in to post new comments.
Mehul's picture
User
14 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
29 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
14 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
4 posts

Hello Mehul,

Can you please attach your complete project.

Thanks,

ANMN

Mehul's picture
User
14 posts

Anmn,

Here is the project.

Attachments: 
gani's picture
Cypress Employee
6 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
14 posts

Ganesh,

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

 

Thanks!

Log in to post new comments.