2015-09-08 10:22 PM
Hello, I had a quick question is it possible to setup the RTC to trigger Alarm interrupt and Wakeup counter interrupt in the same program. This is needed because I use Standby for long sleep (~1s) and Stop mode for short sleep (6-8ms) while the external sensor is converting measurements. I was only successful of doing this only if the RTC is fully restarted, but because of that it resets the time. If I do not reset the RTC fully, I get the Alarm trigger to work only once. I tried adding all the function that I use in RTC initialization with Alarm to the main program, but still no luck.
2015-09-09 02:09 AM
I found the error. I needed the Alarm to set off every 6-9ms, so I only adjusted the subsecond config:
RTC_AlarmSubSecondConfig(RTC_Alarm_A, 0x00000001, RTC_AlarmSubSecondMask_SS14_1);I did not even call the RTC_SetAlarm, because its minimum parameter was every second and that was to long for me. And so the interrupt worked only onceThe SOLUTION was to add the RTC_SetAlarm and set it to every second (RTC_AlarmStructure.RTC_AlarmMask = 0x80808080;) my interrupt started working.