cancel
Showing results for 
Search instead for 
Did you mean: 

FM0+, FM3 & FM4 MCU

New Contributor

Hello everybody,

my Real Time Clock (RTC) on the S6E2DH5J0A works well.

Now I want to set up a 1-second-interrupt.

After clearing all interrupt flags, enabeling the 1-second-interrupt and enabeling (and clearing) the NIVC, the RTC_IRQHandler (void) will be executed immediately.

Moreover it is not possible to return from the RTC_IRQHandler, although I have cleared every interrupt flag and the NIVC.

Did someone have the same problem? Can someone post some code example for setting up the 1 second interrupt of the RTC?

PS: I use FreeRTOS on my MCU.

0 Likes
Reply
1 Reply
Moderator
Moderator

Sample code for Peripheral control including RTC is included in the Peripheral Driver Library (PDL).

For S6E2DH5J0A (FM4) please install PDL version 2.1.x and refer to the following file.

(Install Directory)\2.1.0\drivers\rtc\rtc.[c|h]

Following functions of rtc.c will be helpful.

void Rtc_IrqHandler (volatile stc_rtcn_t * pstcRtc, stc_rtc_intern_data_t * pstcRtcInternData)

en_result_t Rtc_ClrIrqFlag (volatile stc_rtcn_t * pstcRtc, en_rtc_irq_sel_t enIrqSel)

0 Likes
Reply
Top labels