cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 4 MCU

Anonymous
Not applicable

Hi there,

   

 

   

I'm having a weird problem with the touch buttons on the CY8C4245. When I enable only one button in capsense it works fine. But when I enable more than 1 input as capsense button the software goes to the CY_ISR(IntDefaultHandler) function. I've tried lots of different setting but cant get it to work. Any ideas?

   

<code>

   

CapSense_1_Start();
    
CyGlobalIntEnable;

   

/* Initialize baselines */ 
CapSense_1_InitializeAllBaselines();

   

while(1)
{
    /* Update all baselines */
    CapSense_1_UpdateEnabledBaselines();

   

    /* Start scanning all enabled sensors */
    CapSense_1_ScanEnabledWidgets();

   

    /* Wait for scanning to complete */
    while(CapSense_1_IsBusy() != 0)
    {
        /* Loop until condition true */
    }
    if(CapSense_1_CheckIsWidgetActive(CapSense_1_Sns_Enter__BTN))
    {
        TP2_Write(0);
    }
    else
    {
         TP2_Write(1);
    }
    if(CapSense_1_CheckIsWidgetActive(CapSense_1_Sns_Up__BTN))
    {
        TP3_Write(0);
    }
    else
    {
         TP3_Write(1);
    }
    if(CapSense_1_CheckIsWidgetActive(CapSense_1_Sns_Right__BTN))
    {
        TP4_Write(0);
    }
    else
    {
         TP4_Write(1);
    }
}

   

</code>

   

 

   

Thanks,

   

P

0 Likes
Reply
3 Replies
Esteemed Contributor II

Can you post your complete project, so that we all can have a look at all of your settings? To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file. Another question: Which board do you use? Self-made?? Prototyping kit???

   

 

   

Bob

0 Likes
Reply
Anonymous
Not applicable

Hi Bob,

   

 

   

I'm using a custom Board. This is the first time I've used this particular chip but I've used touch before with the CYBL10563 with no problems. I've attached my project.

   

 

   

Thanks for your time,

   

P

0 Likes
Reply
Esteemed Contributor II

I rewrote the project for a CY8CKIT-042.

   

Main changes were sensor numbers

   

Setting of Capsense to auto (smart sense)

   

setting all buttons to the same values in Capsense

   

Look at the attached project

   

 

   

Bob

0 Likes
Reply