Philips UM10109 Microscope & Magnifier User Manual


 
© Koninklijke Philips Electronics N.V. 2005. All rights reserved.
User manual Rev. 02 — 23 May 2005 52 of 133
Philips Semiconductors
UM10109
P89LPC932A1 User manual
9.6 PWM operation
PWM Operation has two main modes, asymmetrical and symmetrical. These modes of
timer operation are selected by writing 10H or 11H to TMOD21:TMOD20 as shown in
Section 9.3 “
Basic timer operation.
In asymmetrical PWM operation, the CCU Timer operates in downcounting mode
regardless of the setting of TDIR2. In this case, TDIR2 will always read 1.
In symmetrical mode, the timer counts up/down alternately and the value of TDIR2 has no
effect. The main difference from basic timer operation is the operation of the compare
module, which in PWM mode is used for PWM waveform generation. Ta ble 3 7
shows the
behavior of the compare pins in PWM mode.
The user will have to configure the output compare pins as outputs in order to enable the
PWM output. As with basic timer operation, when the PWM (compare) pins are connected
to the compare logic, their logic state remains unchanged. However, since the bit FCO is
used to hold the halt value, only a compare event can change the state of the pin.
The CCU Timer Overflow interrupt flag is set when the counter changes direction at the
top. For example, if TOR contains 01FFH, CCU Timer will count: …01FEH, 01FFH,
01FEH,… The flag is set in the counter cycle after the change from TOR to TOR-1.
Fig 21. Asymmetrical PWM, downcounting.
Fig 22. Symmetrical PWM.
TOR2
compare value
timer value
non-inverted
inverted
0x0000
002aaa89
3
TOR2
compare value
timer value
non-inverted
inverted
002aaa894
0