PSOC4000S CapSense sensing issue after CySysPmSleep(); but no issue if using CySysPmDeepSleep()

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

cross mob
user_284076
Level 3
Level 3
10 replies posted 10 likes given 5 replies posted

Hi,

We are using CY8C4025LQI-S412.

We are using PWM for controlling  backlight LED Intensity but for 100%  and 0% duty cycle we STOP PWM and using GPIO to control LED ON OFF state.

we are putting CPU in sleep mode in between capsense scan in active mode for 30ms using CySysPmSleep(); when LED PWM is running and if LED PWM not running we are using CySysPmDeepSleep() to put device in deepsleep mode for 30ms.

if put in sleep, capsense touch response is not good I have to put finger on button for little more time. But in case we used deepsleep capsense sensing of button working very smooth and responsive.

Can any one review code and suggest possible reason behind it.

complete workspace code is attached in post,

                    if(false == isPWMRunning)

                    {

                        /* Put the device to deep sleep after each CapSense scan */

                        EnterDeepSleepMode();    

                    }

                    else

                    {

                        /* Put the device to sleep after each CapSense scan */

                        EnterSleepMode();    

                    }

Regards,

Hardik Harpal

0 Likes
1 Solution

AH_96 wrote:

Sleep mode is not expected to cause such behaviour.

You are right. Stupid of me ,I did not checked UART Debug LOG. Key Press detected every time on UART LOG with sleep mode but Buzzer not playing by I2C master. I need to find why this happens. If I2C communication fails these could be reason but let me check as Buzzer played by I2C master(key not detetcted by it)  working properly if I put device in Deep Sleep  and not working if  put in sleep mode so there should not be code logic issue but something else probably. Let me find out.

Edited: If I use sleep mode instead of deep sleep in PSOC4 in between scan, On I2C master side It receives I2C error. In sleep mode I can run SCB  block right?

I am not calling SCB sleep and  wakeup in EnterSleepMode() this resolved issue.

SCB_Wakeup();

SCB_Sleep();

Thanks for your support.

In mean time can you help me with one more issue/query I have,

If there is proximity present (RFID card at 14 mm parallel to keypad) in front of keypad and upon timeout If I call for Look For Touch mode

                                  /* Set up ganged sensor for scanning */

                                /* Configure slider widget before scanning */

                                CapSense_CSDSetupWidgetExt(CapSense_PROXIMITY0_WDGT_ID, CapSense_PROXIMITY0_SNS0_ID);                      

                                /* Set the watchdog timer match value */

                                ConfigureWdt(gst_KeypadParameter.mu16_LFTScanTimeMS);

                          

                                /* Set mode to look-for-touch */

                                scanMode = LOOK_FOR_TOUCH;

After this if I remove card form there and place again after few seconds at same distance card proxy is not detected  I removed card again placed again after some time this time 10 mm close to keypad than also proxy is not detected. If I place just 3-5 mm than it detects proxy after that If remove card before calling above code(setting keypad in look for touch mode) than next time I I place card at 14 mm it detects proxy.

This happens every time, In short every time If there is proxy present and I put device in Look for touch mode and than card removed, proxy detects only by placing card very near to keypad. But in case of proxy is not present and I put device in Look for touch mode next time  whenever I put card in front of keypad it It detects fine at 14 mm or more for every time.

So My question, Is below function do not update baseline for proximity sensor in Look for touch mode in firmware?.

                        CapSense_CSDScanExt();

                        CapSense_ProcessWidget(CapSense_PROXIMITY0_WDGT_ID);              

                  

                        CapSense_IsWidgetActive(CapSense_PROXIMITY0_WDGT_ID);

Is my flow in code related to capsense is right? All function I called related to capsense in code is the best way to achieve following out come:

What I tried to do in sleep scan for proxy(by ganged all sensor as proxy sensor) detection and after proxy detection scan all sensor and after operation complete (Required number of key pressed(LED OFF Command by i2c master)) or on timeout again go back to sleep and scan for proxy. Use possible lowest current consumption.

If there is any suggestion regarding capsense related code let me know.

Regards,

Hardik Harpal

View solution in original post

0 Likes
11 Replies