2013-04-10 08:12 AM
Hello.
Does anyone has any idea how can i get the source of wake up from standby mode? I use only RTC and wake up pin. I found a WUF bit in PWR_CSR, but problem is that this bit is for both events. Thanks for any idea2013-04-10 08:17 AM
Doesn't the RTC signal the alarm condition? Can you observed the state of the GPIO pin?
If the external event is transient perhaps you need to latch it, and clear it.2013-04-10 11:34 AM
I tryed to catch the RTC_FLAG_OW and RTC_FLAG_ALR.. In data sheet are these figures:
So i think flags should be still on after wake up,shouldnt they? In my code i use this:if (RTC_GetFlagStatus(RTC_FLAG_ALR))LCD_DisplayStringLine(Line7, ''RTC_FLAG_ALR on'');
if (RTC_GetFlagStatus(RTC_FLAG_OW ))
LCD_DisplayStringLine(Line8, ''RTC_FLAG_OW on''); But it always shows that flags are set on 0.
2013-04-10 01:12 PM
if (PWR_GetFlagStatus(PWR_FLAG_WU))
puts(''PWR_FLAG_WU''); if (PWR_GetFlagStatus(PWR_FLAG_SB)) puts(''PWR_FLAG_SB''); if (RTC_GetITStatus(RTC_IT_ALRB)) puts(''RTC_IT_ALRB''); if (RTC_GetITStatus(RTC_IT_ALRA)) puts(''RTC_IT_ALRA''); 00:14:00 Standby Option ....ENTERS STANDBY, Alarm set for 2 minutes hence ....EXITS PWR_FLAG_WU PWR_FLAG_SB RTC_IT_ALRA RTC from STANDBY.... 00:16:002013-04-14 03:23 PM
Just for ppl who will work with this problem : there are two ideas how go.
1. check RTC counter ( after RTC alarm it should be somewhere on the start) 2. check status on WKUP GPIO. Butt isnt fast as uController,so there will be still information that butt is pressed I tryed only 2. - and all worked ok,.