RTC_GetAlarmDateAndTime() will return all 0's if the time entry written by RTC_SetAlarmDateAndTime() is invalid. Try reading the alarm date and time after setting it to make sure the date/time is valid and set correctly.
You also need to call RTC_Start() to start the clock. Also, the checkboxes for "Implement RTC update manually" and "Enable alarm functionality" in the component's API will change behavior as well.
You also probably want to set the settings before starting the RTC clock I think.
Unfortunately the hints didn't solve the problem.
Thats why I created a new workspace with the minimal implementation for the RTC and Alarm.
Whoever wants to have a look into it, please try it and maybe you find the bug?
Thanks a lot
Workspace01.cywrk.Archive01.zip 462.6 K
Finally I found a very simple and effective solution: I just implemented the alarm functionality by myself!
Eliminating the alarm-function in the RTC-component and implementing the necessary counter is even faster and more flexible.
My implementation is based on a uint32 counter which is decremented each second. When setting the initial alarm I used the Date-to-Unixtime to easily calculate the value of the counter until the next alarm should trigger.
In the Alarm-function I can very easily set the counter for a certain repetition rate. 60*60*24 for daily alarm, or 60*60 für hourly alarm, or even anything inbetween!
Setting the counter to 32bit-max value disables the alarm for the next 136years. :-)
Just to keep you updated!