How to edit RTC Alarm parameters
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-09-11 9:54 AM
Hi, I use RTC alarm to wake up from STOP mode I have STM32F030C8T6. During initialization I have set 5s and everything works as it should. But I would need to change the interval to maybe 30s while the program is running. The problem is that the change will not be overwritten. I found that I need to change the ALRAWF register set to 1 in RTC_ISR, but I don't know how to do it. I will be glad for help.
Thank you.
Solved! Go to Solution.
- Labels:
-
RTC
-
STM32F0 Series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-09-11 10:23 AM - edited ‎2023-09-11 10:24 AM
Hello @DJeze.1
To do this you have to:
- Diable the alarm by putting to 0 the ALRAE bit in the RTC_CR.
- Change the time to 30s (or whatever you want)
- Put back the ALRAE bit to 1.
- Write 0 to clear the ALRAWF bit in the RTC_ISR registre.
That will do the job.
Best regards.
II
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-09-11 10:23 AM - edited ‎2023-09-11 10:24 AM
Hello @DJeze.1
To do this you have to:
- Diable the alarm by putting to 0 the ALRAE bit in the RTC_CR.
- Change the time to 30s (or whatever you want)
- Put back the ALRAE bit to 1.
- Write 0 to clear the ALRAWF bit in the RTC_ISR registre.
That will do the job.
Best regards.
II
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-09-12 9:19 AM
I DON'T know what I'm doing wrong, but I can't reset the registry bit:
RTC->CR &= ~(1 << 8);
RTC->CR &= ~(1 << RTC_CR_ALRAE_Pos);
I'm doing something wrong. Neither will do anything.
