lpcware

RTC setup for lpc1769 of lpcxpresso

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by paksoft on Sat Apr 16 00:30:26 MST 2011
Hi dude,
    I'm trying to write some code for RTC of lpcxpresso and still cannot figure out how to setup RTC. I've read manual of LPC17xx and but still don't understand about it because of I'm new to ARM. I've some experience in AVR. :) In datasheet of AVR, it's clearly mentioned about how to configure or setup but in NXP, still confusing. :confused: 
    There is no sample code in the datasheet at all. I've got some sample code in the forum as follow:
#define CCR_CLKEN 0x01

void RTC_init(void) //init RTC
{
LPC_SC->PCONP |= (1<<9); //power on RTC
LPC_RTC->CCR =0; //stop RTC
LPC_RTC->AMR =0; //no alarm
LPC_RTC->CIIR =0; //no second interrupt
LPC_RTC->CCR |= CCR_CLKEN ;
}
   If anyone know about setup of RTC of lpc1769 please advise me.

Regards,
pak

Outcomes