Ccu Clock (Ccuclk); Ccu Clock Prescaling; Basic Timer Operation - Philips P89LPC938 User Manual

Single-chip microcontroller
Table of Contents

Advertisement

Philips Semiconductors
16-BIT SHADOW REGISTER
TOR2H TO TOR2L
16-BIT TIMER RELOAD
REGISTER
16-BIT UP/DOWN TIMER
WITH RELOAD
10-BIT DIVIDER
4-BIT
32 × PLL
DIVIDER
Fig 21. Capture Compare Unit block diagram.

10.1 CCU Clock (CCUCLK)

The CCU runs on the CCUCLK, which can be either PCLK in basic timer mode or the
output of a PLL (see
0.5 MHz to 1 MHz that is multiplied by 32 to produce a CCUCLK between 16 MHz and
32 MHz in PWM mode (asymmetrical or symmetrical). The PLL contains a 4-bit divider
(PLLDV3:0 bits in the TCR21 register) to help divide PCLK into a frequency between
0.5 MHz and 1 MHz

10.2 CCU Clock prescaling

This CCUCLK can further be divided down by a prescaler. The prescaler is implemented
as a 10-bit free-running counter with programmable reload at overflow. Writing a value to
the prescaler will cause the prescaler to restart.

10.3 Basic timer operation

The Timer is a free-running up/down counter counting at the pace determined by the
prescaler. The timer is started by setting the CCU Mode Select bits TMOD21 and
TMOD20 in the CCU Control Register 0 (TCR20) as shown in the table in the TCR20
register description
The CCU direction control bit, TDIR2, determines the direction of the count. TDIR2 = 0:
Count up, TDIR2 = 1: Count down. If the timer counting direction is changed while the
counter is running, the count sequence will be reversed in the CCUCLK cycle following the
write of TDIR2. The timer can be written or read at any time and newly-written values will
take effect when the prescaler overflows. The timer is accessible through two SFRs,
TL2(low byte) and TH2(high byte). A third 16-bit SFR, TOR2H:TOR2L, determines the
overflow reload value. TL2, TH2 and TOR2H, TOR2L will be 0 after a reset
User manual
OVERFLOW/
UNDERFLOW
Figure
(Table
Rev. 03 — 7 June 2005
16-BIT SHADOW REGISTER
OCRxH TO OCRxL
TIMER > COMPARE
COMPARE CHANNELS A TO D
16-BIT CAPTURE
REGISTER ICRxH, L
EVENT
COUNTER
INTERRUPT FLAG
TICF2x SET
21). The PLL is designed to use a clock source between
47).
UM10119
P89LPC938 User manual
16-BIT COMPARE
VALUE
FCOx
ICESx
ICNFx
NOISE
EDGE
FILTER
SELECT
CAPTURE CHANNELS A, B
002aab009
© Koninklijke Philips Electronics N.V. 2005. All rights reserved.
OCD
OCC
OCB
OCA
ICB
ICA
54 of 139

Advertisement

Table of Contents
loading

Table of Contents