P89LPC9321FN NXP Semiconductors, P89LPC9321FN Datasheet - Page 33

no-image

P89LPC9321FN

Manufacturer Part Number
P89LPC9321FN
Description
MCU 8-Bit 89LP 80C51 CISC 8KB Flash 2.5V/3.3V 28-Pin PDIP Tube
Manufacturer
NXP Semiconductors
Datasheet
NXP Semiconductors
P89LPC9321_1
Product data sheet
7.22.4 Output compare
7.22.5 Input capture
7.22.6 PWM operation
When a reload occurs, the CCU Timer Overflow Interrupt Flag will be set, and an interrupt
generated if enabled. The 16-bit CCU timer may also be used as an 8-bit up/down timer.
There are four output compare channels: A, B, C and D. Each output compare channel
needs to be enabled in order to operate and the user will have to set the associated I/O
pin to the desired output mode to connect the pin. When the contents of the timer matches
that of a capture compare control register, the Timer Output Compare Interrupt Flag
(TOCFx) becomes set. An interrupt will occur if enabled.
Input capture is always enabled. Each time a capture event occurs on one of the two input
capture pins, the contents of the timer is transferred to the corresponding 16-bit input
capture register. The capture event can be programmed to be either rising or falling edge
triggered. A simple noise filter can be enabled on the input capture by enabling the Input
Capture Noise Filter bit. If set, the capture logic needs to see four consecutive samples of
the same value in order to recognize an edge as a capture event. An event counter can be
set to delay a capture by a number of capture events.
PWM operation has two main modes, symmetrical and asymmetrical.
In asymmetrical PWM operation the CCU timer operates in down-counting mode
regardless of the direction control bit.
In symmetrical mode, the timer counts up/down alternately. The main difference from
basic timer operation is the operation of the compare module, which in PWM mode is
used for PWM waveform generation.
As with basic timer operation, when the PWM (compare) pins are connected to the
compare logic, their logic state remains unchanged. However, since bit FCO is used to
hold the halt value, only a compare event can change the state of the pin.
Fig 8.
Asymmetrical PWM, down-counting
compare value
non-inverted
timer value
inverted
0x0000
TOR2
Rev. 01 — 9 December 2008
8-bit microcontroller with accelerated two-clock 80C51 core
P89LPC9321
002aaa893
© NXP B.V. 2008. All rights reserved.
33 of 70

Related parts for P89LPC9321FN