RTC initialization issue in LPC1768

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

RTC initialization issue in LPC1768

347 Views
Suchismita
Contributor I

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 */
}

0 Kudos
Reply
1 Reply

313 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @Suchismita 

Please refer to the RTC demo under LPCopen, which contains detailed examples and configurations that can guide you through the implementation process.

Alice_Yang_1-1747045722610.png

The initialization code is as follows:

Alice_Yang_0-1747045631829.png

 

BR

Alice

 

 

0 Kudos
Reply