Low Power Wake-up Timer disabled via PINT

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Low Power Wake-up Timer disabled via PINT

跳至解决方案
1,404 次查看
Gabriel88
Contributor II

Dear Community,

I am trying to set a #OM15076-3 Carrier Board with a #JN5189 Module for a #QN9090 development.

Unfortunately, using a Low Power Wake-up Timer (based on powerdown example) I don't know how to momentarily disable Deep Sleep/Power-down mode through software control triggered by an Pin INT (based on pint example).

I do manage to set a periodical timer on its own, and to go into a constant Power-down mode waking up with a button interruption, separately.

The main objective is to have a periodical event whenever the timer reach zero, and have a different event during the timer's period triggered by a button, resuming back where the timer stopped.

Thanks in advance for whatever information that could help.

Looking forward to hearing from you,

Gabriel

0 项奖励
回复
1 解答
1,369 次查看
EduardoZamora
NXP TechSupport
NXP TechSupport

Hello Gabriel,

In addition to the timer, powerdown_demo allows the user to select the User Button (board BP1) as wake-up source:

EduardoZamora_0-1663715086613.png

You can use this event as base and it can be merged with the timer event; both the timer and the IO can be selected as wake-up source in config.pm_wakeup_src. For example:

config.pm_wakeup_src=POWER_WAKEUPSRC_WAKE_UP_TIMER0 | POWER_WAKEUPSRC_IO;

And the wake-up pin can be selected in config.pm_wakeup_io. For example:

config.pm_wakeup_io = 1 << BOARD_SW1_GPIO_PIN;

Regards,
Eduardo.

在原帖中查看解决方案

7 回复数
934 次查看
Gabriel88
Contributor II

Dear community,

What if I would like to use whatever interruption instead of Switch 1?
Let's say I configured pin 3 as an external interruption.

How does the following line change: 

config.pm_wakeup_io = 1 << BOARD_SW1_GPIO_PIN;

Thanks in advance for your comments.

Best regards,
Gabriel

0 项奖励
回复
935 次查看
Gabriel88
Contributor II

Dear community,

What if I would like to use whatever interruption instead of Switch 1?
Let's say I configured pin 3 as an external interruption.

How does the following line change: 

config.pm_wakeup_io = 1 << BOARD_SW1_GPIO_PIN;

 Thanks in advance for your comments.

Best regards,
Gabriel

0 项奖励
回复
1,370 次查看
EduardoZamora
NXP TechSupport
NXP TechSupport

Hello Gabriel,

In addition to the timer, powerdown_demo allows the user to select the User Button (board BP1) as wake-up source:

EduardoZamora_0-1663715086613.png

You can use this event as base and it can be merged with the timer event; both the timer and the IO can be selected as wake-up source in config.pm_wakeup_src. For example:

config.pm_wakeup_src=POWER_WAKEUPSRC_WAKE_UP_TIMER0 | POWER_WAKEUPSRC_IO;

And the wake-up pin can be selected in config.pm_wakeup_io. For example:

config.pm_wakeup_io = 1 << BOARD_SW1_GPIO_PIN;

Regards,
Eduardo.

1,352 次查看
Gabriel88
Contributor II

Dear @EduardoZamora,

I tried to merge them but maybe not as easy as you did.

The problem is that once in the Timer cycle the IO will not have priority, am I right?

Thanks for the hint anyways, I'll start just like you propose.

Regards,
Gabriel

0 项奖励
回复
1,346 次查看
EduardoZamora
NXP TechSupport
NXP TechSupport

Hi,

With this configuration you should be able to wake up the device by using either the timer or the IO when the device is in low power mode, both events should be independent and have the same effect.

Regards,
Eduardo.

1,302 次查看
Gabriel88
Contributor II

Hi @EduardoZamora , how are you?

Your solution worked like a charm!

The only thing I didn't manage to set is a “pause/resume” timer, as in whenever the GPIO INT takes place the whole timer cycle restart from scratch.

I didn't find any function on fsl_clock.c that allows me to do that pause/resume action. Maybe I'm looking in the wrong place.

Let me know if you have some hints for that.

Thanks in advance as always.

Regards,
Gabriel

0 项奖励
回复
1,264 次查看
EduardoZamora
NXP TechSupport
NXP TechSupport

Hello,

Could you please try reading the timer counter value when the IO wake-up event occurs? Function

uint32_t WTIMER_ReadTimer(WTIMER_timer_id_t timer_id)

may be usefull for this, and you can try starting the timer again using this value as count before re-entering low-power mode.

Regards,
Eduardo.