Philips UM10109 Microscope & Magnifier User Manual


 
© Koninklijke Philips Electronics N.V. 2005. All rights reserved.
User manual Rev. 02 — 23 May 2005 54 of 133
Philips Semiconductors
UM10109
P89LPC932A1 User manual
9.8 Synchronized PWM register update
When the OCRx registers are written, a built in mechanism ensures that the value is not
updated in the middle of a PWM pulse. This could result in an odd-length pulse. When the
registers are written, the values are placed in two shadow registers, as is the case in basic
timer operation mode. Writing to TCOU2 will cause the contents of the shadow registers
to be updated on the next CCU Timer overflow. If OCRxH and/or OCRxL are read before
the value is updated, the most currently written value is read.
9.9 HALT
Setting the HLTEN bit in TCR20 enables the PWM Halt Function. When halt function is
enabled, a capture event as enabled for the Input Capture A pin will immediately stop all
activity on the PWM pins and set them to a predetermined state defined by FCOx bit. In
PWM Mode, the FCOx bits in the CCCRx register hold the value the pin is forced to during
halt. The value of the setting can be read back. The capture function and the interrupt will
still operate as normal even if it has this added functionality enabled. When the PWM unit
is halted, the timer will still run as normal. The HLTRN bit in TCR20 will be set to indicate
that a halt took place. In order to re-activate the PWM, the user must clear the HLTRN bit.
The user can force the PWM unit into halt by writing a logic 1 to HLTRN bit.
9.10 PLL operation
The PWM module features a Phase Locked Loop that can be used to generate a
CCUCLK frequency between 16 MHz and 32 MHz. At this frequency the PWM module
provides ultrasonic PWM frequency with 10-bit resolution provided that the crystal
frequency is 1 MHz or higher (The PWM resolution is programmable up to 16 bits by
writing to TOR2H:TOR2L). The PLL is fed an input signal of 0.5 MHz to 1 MHz and
generates an output signal of 32 times the input frequency. This signal is used to clock the
timer. The user will have to set a divider that scales PCLK by a factor of 1 to 16. This
divider is found in the SFR register TCR21. The PLL frequency can be expressed as
follows:
PLL frequency = PCLK / (N+1)
Where: N is the value of PLLDV3:0.
Since N ranges in 0 to 15, the CCLK frequency can be in the range of PCLK to
PCLK
16
.
Table 38: CCU control register 1 (TCR21 - address F9h) bit allocation
Bit 7 6 5 4 3 2 1 0
SymbolTCOU2---PLLDV.3PLLDV.2PLLDV.1PLLDV.0
Reset0xxx0000