Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] LPC2368 RTC clock source

Status
Not open for further replies.

bikashh

Full Member level 5
Joined
Nov 28, 2009
Messages
264
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,298
Location
india
Activity points
3,132
Dear friends,
In my project i am trying to configure RTC. but had a doubt that as i am using clock source from the main crystal(in my case it is 12 Mhz).my question is if i turn off the device will my RTC work from this clock source.

Thanks in advance
 

hi Bikashh,

it wil not work without battery power and need to use the standard crystal frequency(for RTC) i.e.,32.786KHZ -- can use 32KHz. With 12Mhz it wont work properly.
 

thanks for the reply
will try and let you know
 

i've written a progam for RTC but its not working please check.

main()
{
Init_UART0(9600);
InitTimer();
uart0Puts("Initialize OK \n\r");
RTC_Init();
while(1)
{}
}

__irq void RTC_ISR(void)
{
if(RTC_ILR & 0x01)
{
uart0Puts("Counter incrementing\n\r");
RTC_ILR = 0x01; //clear interrupt
}

VICVectAddr=0x00000000;//dummy write to signal end of enterrupt
}

void RTC_Init(void) //Pclk=12Mhz
{
RTC_CISS = 0x00;
RTC_CIIR = 0x01; //enable seconds counter interrupt
RTC_CCR = 0x01; // Enable clock
RTC_ILR = 0x01; //enable clock interrupt and inactive alarm interrupt
RTC_PREINT = 0x0000016D; //set RTC prescalar for 12Mhz;=(PCLK/3276-1
RTC_PREFRAC= 0x00001B00; // = PCLK - ((PREINT + 1) x 3276

VICVectAddr13=(unsigned long)RTC_ISR;
VICVectCntl13=0x0000002D;
VICIntEnable= 0x00002000;
}

thanks for the reply
 

hi, my RTC is working in pooling mode but unable to run using IRQ.
thanks for the reply
 

yes,my RTC is running properly and i am also able to assert the service routine.
but now my RTC gets reset when i restart the device.RTC is given seperate battery backup and 32khz crystal. how can i keep my data unchanged


thanks
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top