Fabio de Luca

Using TWR-K60N512 touch buttons (capacitive pads)

Discussion created by Fabio de Luca on Aug 12, 2012

Hello guys and girls

 

I'm new to ARM M4 (Kinetis) and TWR-K60N512. I'm trying to use the 4 touch buttons on the board (E1, E2, E3 and E4). Those are the 4 capacitive touch pads which work together with the 4 LEDs.

 

Fact is I can't really use them on my project. Whenever I try, I can only use them to input data once. Touching the pad again will result into no answer from the software (interrupt). If I try an equivalent code on the pushbuttons (SW1 for example), everything works just fine. SW1 is a regular "mechanical" switch.

 

Unfortunately I don't have an oscilloscope to check if there is something wrong with the board.

 

Since using touch pads are something also new to me, I expect me to be doing something wrong.

 

Project code is below. I'm using CW 10.2 and Processor Expert.

 

-----------------------------------------------------------------------

// Code below doesn't work right: E2 (PortB/3), E3 (PortB/2) and E4 (PortB/16) interrupt on rising edge

void GPIO_Touch_PTB_OnPortEvent(LDD_TUserData *UserDataPtr)
{
   extern LDD_TDeviceData *LedData;
   GPIO_LED_PTA_ToggleFieldBits(LedData,LED4,1);
}

-----------------------------------------------------------------------

// Code below works fine: SW1 (PortE/16), interrupt on rising edge

void GPIO_SW_PTE_OnPortEvent(LDD_TUserData *UserDataPtr)
{
    extern LDD_TDeviceData *LedData;
    GPIO_LED_PTA_ToggleFieldBits(LedData,LED4,1);
}

-----------------------------------------------------------------------

 

Thanks in advance guys an girls.

 

Best regards,

 

Fabio Pantano de Luca

Outcomes