Hi ,
For RTC initialization in LPC1768 I am using below code, after time is set initially , it is working fine, but after power reset it is giving garbage value, that to everytime same garbage value . Tried modifying the init block code in many ways , still error persists, any suggestion, how to resolve the issue?
void RTC_Init(void)
{
LPC_SC->PCONP |=(1<<9); // Enable the power to RTC module
/* Disable RTC clock, reset clock, Enable RTC calibration */
LPC_RTC->CCR = ((1<<SBIT_CTCRST) | (1<<SBIT_CCALEN));
LPC_RTC->CALIBRATION = 0x00;
LPC_RTC->CCR = (1<<SBIT_CLKEN); /* Enable the clock for RTC */
}
Hello @Suchismita
Please refer to the RTC demo under LPCopen, which contains detailed examples and configurations that can guide you through the implementation process.
The initialization code is as follows:
BR
Alice