2016-02-08 10:33 AM
I have written some code to generate an interrupt from the RTC alarm. This includes sub seconds. This works well for times in excess of 1 second. The alarm time, including subseconds is calculated and displayed. When the interrupt is hit the time is read again and the difference is only a few subsecond counts. However when a short time (less than 1 second) is tried it will fail if the only thing that changes are the subseconds. Then the interrupt is not triggered. This does not seem expected behaviour, any workarounds out there?
#interrupt #rtc #stm32l1522016-02-08 10:45 AM
Generally speaking for the STM32 parts, you need to deal with things +1 second out.
For sub-second stuff perhaps you can consider using other timers, or SysTick?2016-02-09 03:39 AM
I should read the manual more closely, the sub second register is a down counter. This meant I was not setting the correct time. So I would read the time and see it was say 2000 (max was 16384). I would add say 8000 giving a result of 10000. However the counter then down counts from 2000 to 0 at which point the seconds are incremented and the interrupt does not fire as the seconds are now not correct.
Doh!