Question
SPC560BL1-RTC Configuration
Posted on April 29, 2016 at 16:10
I am trying to configure the RTC using for date & time purpose. But the following RTC configuration is not working,when i debug the code it is hanging at R TC.RTCCNT.B.RTCCNT .How to use RTC is timer counter for date & time.
SPCSetPeripheralClockMode(91, SPC5_ME_PCTL_RUN(1) | SPC5_ME_PCTL_LP(1)); /*configure RTC module as autonomous periodic interrupt to generate internal wakeup event*/ RTC.RTCC.B.CNTEN =0 ; //counter reset and stop RTC.RTCSUPV.B.SUPV =0 ; //counter reset and stop RTC.RTCC.B.CLKSEL = 0x01 ; //set SIRC as source clock for API RTC.RTCC.B.DIV32EN= 0; //Divide clock for 32 is not used RTC.RTCC.B.DIV512EN = 1; //divide clock for 512 RTC.RTCC.B.APIVAL = 512/4; //set API timer to 2 Seconds RTC.RTCCNT.B.RTCCNT =5678327; RTC.RTCS.R=0xFFFFFFFF; RTC.RTCC.B.CNTEN =1 ; //counter reset and stop #spc56 #rtc #!colorado