找回密码
 立即注册

微信扫码登录

查看: 325|回复: 2

ZigBee End Device - wakeup on button press delay

[复制链接]

10

主题

18

回帖

158

积分

注册会员

积分
158
发表于 2024-9-25 14:28:44 | 显示全部楼层 |阅读模式
I have an ZigBee End Device which should wake up when the button is pressed.
The problem is, that when the button is pressed it takes sometimes up to 6 seconds before the device is active. I have checked it on the scope.

I have the following code:
in app_cfg.h

#define BUTTON1                GPIO_PD2  //P16 pin 24
#define PD2_FUNC            AS_GPIO
#define PD2_OUTPUT_ENABLE    0
#define PD2_INPUT_ENABLE    1
#define    PULL_WAKEUP_SRC_PD2    PM_PIN_PULLUP_1M        //PM_PIN_PULLUP_10K

#define    PM_WAKEUP_LEVEL                  PM_WAKEUP_LEVEL_LOW

in app_main.c
#if PM_ENABLE
/**
*  @brief Definition for wakeup source and level for PM
*/
drv_pm_pinCfg_t g_sensorPmCfg[] = { {BUTTON1, PM_WAKEUP_LEVEL} };
#endif

void app_task(void){
    app_key_handler();

...

    if(bdb_isIdle()){
        report_handler();
#if PM_ENABLE
         drv_pm_lowPowerEnter();
#endif
}


void user_init(bool isRetention){
#if PM_ENABLE
    drv_pm_wakeupPinConfig(g_sensorPmCfg, sizeof(g_sensorPmCfg)/sizeof(drv_pm_pinCfg_t));
#endif
...
}

I had the same code before with the door sensor and it has been working fine.

When I disable PM there is no delay, so it is definitely something to do with sleep mode.



I enter the correct code but it tells me it is incorrect. I have tried multiple of times. I can't make a post

Could you fix this. It is annoying.



Untitled.png

27

主题

121

回帖

447

积分

版主

积分
447
发表于 2024-9-26 11:19:23 | 显示全部楼层
Hi,
You could conduct a cross experiment to eliminate hardware defects first.

And, I have forwarded the verification code issue to the developer. Thanks~

10

主题

18

回帖

158

积分

注册会员

积分
158
 楼主| 发表于 2024-9-26 15:07:58 | 显示全部楼层
TL_YB 发表于 2024-9-26 11:19
Hi,
You could conduct a cross experiment to eliminate hardware defects first.

Hi
Thanks for your response.
I have spent some time today on this and found out that the issue is with the app_key_handler() function that is used in the examples. It is good for normal operation of the device but not wakeup from sleep.
I also looked at my prevous project with door sensor and I had my own function for handling key press.
I wrote my own debouncing function and now it works fine.
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Telink forum ( 沪ICP备17008231号-1 )

GMT+8, 2024-11-24 05:42 , Processed in 0.085567 second(s), 21 queries .

Powered by Telink 隐私政策

泰凌微电子版权所有 © 。保留所有权利。 2024

快速回复 返回顶部 返回列表