We're using RTC with 2 timers
1 Khz to wakeup from low power modes
1 hz for alarm events
So what we noticed is sometimes alarm doesn't fire!
digging down we found that when we reset Wakeup Rtc timer "Turn it off then oN" it clears Alarm flag if it's set while it shouldn't as per datasheet 1 khz timer shouldn't affect 1hz timer
Can you please verify as it's causing a big issue to us and advice how to solve!
Hello @AD11
Thank you for your patience.
I ran your code on an LPCxpresso54114 board, but it didn’t work well. Maybe you used your own board. Therefore, I modified the RTC demo under the SDK according to your requirements. The original RTC demo focused on alarms, so I added a wake-up interrupt. During debugging, both the alarm and wake-up interrupt triggered successfully.
Due to our company policy, we cannot send code to customers, so I have taken a screenshot of the added code. I highly recommend that you first evaluate based on the SDK RTC demo.
Thank you.
BR
Alice
Any updates??
Hello @AD11
Sorry, I just got back from a business trip. I will reply to you today. Thank you.
BR
Alice
Hello,
Using 2 modes: Normal sleep and deep sleep.
But it even happens without going to sleep at all. I tried it on a super loop application with no sleep modes
Hi @AD11
Please send your test project code without sleep to me, I help to check on my side.
Thank you.
BR
Alice
Hello,
Can i do in a pesudo code?
/*Main function*/
main(void)
{
read rtc time();
set RTC alarm after 1 second();
set wakeup interrupt after 2 seconds();
while(1)
{
}
}
/*Handler*/
RTC_Handler()
{
status = read rtc status();
if(alarm)
{
print("OK");
}
else if(wakeup)
{
print("Done);
}
}
}
/***************************************************/
You'll see logs till wakeup interrupt is generated.
As you can see i am not clearing any flag just to make sure interrupt is always pending
Hello @AD11
From the pesudo code, there is no logic issue.