3 Replies Latest reply on Apr 29, 2018 1:08 PM by andreas.kreuzer.ak2_1499391

    PSoC4 RTCs periodic alarm only triggering once

    andreas.kreuzer.ak2_1499391

      Hi,

       

      I have a very strange problem with a CY8C4248LQI-BL583 device and the RTC component.

       

      I configured the RTC with alarm and I want to trigger a daily action with the alarm,

      To test the periodic alarm feature I tried to create a minutely, an hourly or a daily alarm.

      But only the daily alarm triggers correcty and it triggers only once.

       

      I use the following code to set the alarm:

      RTC_SetAlarmMask( RTC_ALARM_SEC_MASK | RTC_ALARM_MIN_MASK  | RTC_ALARM_HOUR_MASK );   // Set periodic daily alarm

      RTC_SetAlarmHandler( AlarmCallbackHandler );       // set Callback Handler for Alarm

      RTC_DATE_TIME MyAlarm;

      MyAlarm.date = RTC_SetDay( MyAlarm.date, 22 );

      MyAlarm.date = RTC_SetMonth( MyAlarm.date, RTC_APRIL);

      MyAlarm.date = RTC_SetYear( MyAlarm.date, 2018 );

      MyAlarm.time = RTC_SetHours( MyAlarm.time, 11 );

      MyAlarm.time = RTC_SetMinutes( MyAlarm.time,  55 );

      MyAlarm.time = RTC_SetSecond( MyAlarm.time, 1 );

      RTC_SetAlarmDateAndTime( &MyAlarm );      // Alarm is triggered on the next day at 11:55:01

      // But Alarm is triggered only once, and not repeated on the day after tomorrow.

       

       

      This is the Alarm-callback:

      void AlarmCallbackHandler(){ 

          RTC_ClearAlarmStatus();           // Clear Alarm Status  

          LED_Write( ~LED_READ() );                             //  toggle LED to detect the alarm has occured

      }

       

      What also does not work:

      RTC_SetAlarmMask( RTC_ALARM_SEC_MASK | RTC_ALARM_MIN_MASK  );   // Set periodic hourly alarm

      // or:

      RTC_SetAlarmMask( RTC_ALARM_SEC_MASK  );   // Set periodic minutely alarm

      // Same setup/configuration as before...

      // But Alarm is NOT triggered in the next hour at minute 55 and second 01 or on each minute with minutely alarm.

       

      Do I have to reenable the alarm somehow?

      And if so, how do I do this?

       

      Thanks a lot

      Andreas