Figure 45: Rtc Prescaler Block Diagram - Philips LPC2194 User Manual

Table of Contents

Advertisement

Philips Semiconductors
ARM-based Microcontroller
Example of Prescaler Usage
In a simplistic case, the pclk frequency is 65.537 kHz. So:
PREINT = int (pclk / 32768) - 1 = 1 and PREFRAC = pclk - ((PREINT +1) x 32768) = 1
With this prescaler setting, exactly 32,768 clocks per second will be provided to the RTC by counting 2 pclks 32,767 times, and
3 pclks once.
In a more realistic case, the pclk frequency is 10 MHz. Then,
PREINT = int (pclk / 32768) - 1 = 304 and PREFRAC = pclk - ((PREINT +1) x 32768) = 5,760.
In this case, 5,760 of the prescaler output clocks will be 306 (305+1) pclks long, the rest will be 305 pclks long.
In a similar manner, any pclk rate greater than 65.536 kHz (as long as it is an even number of cycles per second) may be turned
into a 32 kHz reference clock for the RTC. The only caveat is that if PREFRAC does not contain a zero, then not all of the 32,768
per second clocks are of the same length. Some of the clocks are one pclk longer than others. While the longer pulses are
distributed as evenly as possible among the remaining pulses, this "jitter" could possibly be of concern in an application that
wishes to observe the contents of the Clock Tick Counter (CTC) directly.
Clk
13-bit Integer Counter
13-bit Reload Integer Register
Real Time Clock
(Down Counter)
Underflow
Reload
13
(PREINT)
13

Figure 45: RTC Prescaler block diagram

To Clock Tick
Counter
15-bit Fraction Counter
Combinatorial Logic
Extend
Reload
15-bit Fraction Register
(PREFRAC)
VPB Bus
254
Preliminary User Manual
LPC2119/2129/2194/2292/2294
pclk
(VPB Clock)
Clk
15
15
15
May 03, 2004

Advertisement

Table of Contents
loading

This manual is also suitable for:

Lpc2129Lpc2119Lpc2292Lpc2294

Table of Contents