CE210291_CapSense_P4_One_Button01, bug with fast scan mode at Start/Reset?

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

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hello

I think there is a little bug in the program example: "CE210291_CapSense_P4_One_Button01.cywrk", but still now I'm not able to fix it 😞

The problem is, that after every start or reset, the Programm needs around 20 seconds to change to the Fast-Scan-Mode.

And if I touch a button from the beginning one (start or reset) the Programm stays forever in Slow-Scan-Mode and not change to the Fast-Scan-Mode.

How can I fix that?

See attached example-Code, I have added LED, Port 2(5) output, named as "interrupt" to see if scan is finished or not.

If blue LED (evakit 4045) is blinking very fast - the Program is in Fast-Mode.

BTW: What is the fastest scan-time we can get with PSoC4000S ? Is it 20mS? (because until now I was not able to tune it faster)

thank you

0 Likes
1 Solution

Hello,

I think that the issue is with WDT_Start().

Calibrating wdt match value to slow scan mode and then calibrating to fast scan mode should resolve this issue.

(i.e) swap lines 469-471 with 474-476

Since WDT_Start() sets the watchdog match value to slow scan match value, this issue arises.

Let me know if this helps.

Thanks,
Shanmathi

View solution in original post

6 Replies
RyanZhao
Moderator
Moderator
Moderator
250 sign-ins First question asked 750 replies posted

Hi Pierre,

Fastest scan-time is decided by sensor scan time. In this code example, scan period is controlled by WDT. You can try to decrease LOOP_TIME_FASTSCANMODE. For more details, see the code example document.

Regarding that 'bug', I will try to reproduce it and find the root cause. 

Thanks,

Ryan

0 Likes
Anonymous
Not applicable
You can try to decrease LOOP_TIME_FASTSCANMODE.

that I have tried already. It doesn't matter if I setup 10u, 5u ... the lowest scantime keeps at 20ms (measured with a datalogger).
Also change the clocksetting (IMO to 48MHz and Modulator clk to 48MHz) does not help. Scantime keeps at 20ms minimum.

I have setup the CapSense tuning mode to "Full Auto-Tune".
As I know from the fix programmed version CY8CMBR3116, the minimum Setup Time in EZ-Click is 20ms... so maybe that is really the minimum and the same for the PSoC4000S devices??

I will try to reproduce it and find the root cause.

thank you, I hope you can reproduce it

BTW: what does that "u" after every Value means?

0 Likes
Anonymous
Not applicable

@rzzh, could you reproduce the problem in the meantime? thank you

0 Likes
RyanZhao
Moderator
Moderator
Moderator
250 sign-ins First question asked 750 replies posted

Hi Pierre,

Last many days, I was involved in some other projects support, so I am late to do some experiment around this CE.

Yes. I have reproduced the issue. Not sure the root cause.

The workaround is changing the definition and initialization of softcounter:

uint16 softCounter = SCANMODE_TIMEOUT_VALUE;

Kindly have a try.

Thanks,

Ryan

0 Likes

Hello,

I think that the issue is with WDT_Start().

Calibrating wdt match value to slow scan mode and then calibrating to fast scan mode should resolve this issue.

(i.e) swap lines 469-471 with 474-476

Since WDT_Start() sets the watchdog match value to slow scan match value, this issue arises.

Let me know if this helps.

Thanks,
Shanmathi

Anonymous
Not applicable

thank you very much that works :-), I have swaped it as follow:

    /* Get the actual match value required to generate a given delay */

    watchdogMatchValue = WDT_TIMEOUT_SLOW_SCAN;

    CalibrateWdtMatchValue();

    wdtMatchValSlowMode = watchdogMatchValue; 

 

    watchdogMatchValue = WDT_TIMEOUT_FAST_SCAN;

    CalibrateWdtMatchValue();

    wdtMatchValFastMode  = watchdogMatchValue;

0 Likes