Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

RTC manipulation (ctd.)

2004-10-05 by Leighton Rowe

LPC2114 ; 14.7456 MHz XTAL
PCLK configured to 14.7456 MHz

After using PCLK to initialize the real time clock along with other 
peripherals (UART, Timers), I noticed the RTC time registers (MIN, 
SEC, HOUR, etc.) are going 2 times faster than typical a stopwatch 
(ie. I wait 10seconds and the RTC says 20). 

code....
..........
CCR = AMR = CIIR = ILR = 0;    //clear all RTC Misc registers
SEC = MIN = HOUR = 0;          //clear timer registers being used

//Setup Prescalar Values
PREINT = (PCLK/32768) - 1;                //integer value
PREFRAC = PCLK - ((PREINT + 1)* 32768);   //fraction value

CCR |= RTC_RESET;                         //reset timer
CCR &= ~RTC_RESET;
CCR |= RTC_ENABLE;                        //start timer
...............

After following the documentation as closely as possible, I'm still 
not sure why the RTC's going twice as fast. 

Can anyone clarified this issue?

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.