Yahoo Groups archive

Lpc2000

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

Message

Re: RTC manipulation (ctd.)

2004-10-05 by Leighton Rowe

Hey guys,

After looking further looking up the usermanual and playing with the 
RTC registers....

> PREINT = (PCLK/32768) - 1;                //integer value
> PREFRAC = PCLK - ((PREINT + 1)* 32768);   //fraction value
       // where PCLK = 14745600 or 14.7456MHz

...this code from my previous post follows the Usr Manual but 
apparently the RTC ended up counting twice the speed of a normal 
clock (or stopwatch). I'm not sure why.

PREINT  = ((2*PCLK)/32768) - 1;                //integer value
PREFRAC =  (2*PCLK) - ((PREINT + 1)* 32768);   //fraction value
       // where PCLK = 14745600 or 14.7456MHz

Now I tried the above code change. To my surprise, the RTC counted 
at the correct speed. But this formula doesn't really follow the Usr 
Manual. So now, I'm not convinced that the prescalar formulas in the 
RTC documentation (LPC2114/19/29 User Manual) are correct.

Can anyone clarify this and/or explain what I'm doing wrong? 

Thanks in advance,
Leighton

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.