Capsense malfunctional in EMS test

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

cross mob
AdamsChengTW
Level 3
Level 3
10 sign-ins 5 sign-ins 10 questions asked

HI,

I use capsense function for my company new vehicle air condition HMI product.

Some key will auto trigger in EMS test. (Fail frequency in the  10~12 MHz)

Capsense setting is manual In PSoC creator. (If set Auto some keys are too sensitive)

My key press detect code in the below.

Are there any code design suggestions under the interference of EMS?

capsens2.jpg

capsens1.jpg

0 Likes
1 Solution
Hari
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi ChHs_4614611

In the code, you are scanning the sensors continuously. CapSense_ScanAllWidgets must be called if CapSense block is free. that is, The CapSense_ScanAllWidgets must also be inside the if (CapSense_NOT_BUSY == CapSense_IsBusy()) statement.

Thanks,
Hari

View solution in original post

4 Replies
Hari
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi ChHs_4614611

In the code, you are scanning the sensors continuously. CapSense_ScanAllWidgets must be called if CapSense block is free. that is, The CapSense_ScanAllWidgets must also be inside the if (CapSense_NOT_BUSY == CapSense_IsBusy()) statement.

Thanks,
Hari

Dear Hari,

    Thanks for your reply.

     So do I just add CapSense_ScanAllWidgets in this line?

capsense3.jpg

0 Likes
Hari
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi ChHs_4614611

This is not correct. CapSense_ScanAllWidgets will return to program execution since it is interrupt based. So, you must call this after CapSense_ProcessAllWidgets(). The correct implementation is

if(CapSense_NOT_BUSY == CapSense_IsBusy())

{

CapSense_ProcessAllWidgets();

CapSense_ScanAllWidgets();

.

.

.

.

}

Please refer any CapSense related Code example for details on implementation.

You must also remove the scanallwidgets from the bottom portion (last line of the code snippet).

Thanks,
Hari

OK, I see.

Thank you for your reply.

0 Likes