|
UPSD3422_06 Datasheet, PDF (175/293 Pages) STMicroelectronics – Turbo Plus Series Fast Turbo 8032 MCU with USB and Programmable Logic | |||
|
◁ |
uPSD34xx
Programmable counter array (PCA) with PWM
27 Programmable counter array (PCA) with PWM
There are two Programmable Counter Array blocks (PCA0 and PCA1) in the uPSD34xx. A
PCA block consists of a 16-bit up-counter, which is shared by three TCM (Timer Counter
Module). A TCM can be programmed to perform one of the following four functions:
1. Capture Mode: capture counter values by external input signals
2. Timer Mode
3. Toggle Output Mode
4. PWM Mode: fixed frequency (8-bit or 16-bit), programmable frequency (8-bit only)
27.1
PCA block
The 16-bit Up-Counter in the PCA block is a free-running counter (except in PWM Mode
with programmable frequency). The Counter has a choice of clock input: from an external
pin, Timer 0 Overflow, or PCA Clock.
A PCA block has 3 Timer Counter Modules (TCM) which share the 16-bit Counter output.
The TCM can be configured to capture or compare counter value, generate a toggling
output, or PWM functions. Except for the PWM function, the other TCM functions can
generate an interrupt when an event occurs.
Every TCM is connected to a port pin in Port 4; the TCM pin can be configured as an event
input, a PWMs, a Toggle Output, or as External Clock Input. The pins are general I/O pins
when not assigned to the TCM.
The TCM operation is configured by Control registers and Capture/Compare registers.
Table 93 on page 176 lists the SFR registers in the PCA blocks.
Figure 58. PCA0 block diagram
PCA0CLK
TIMER0
OVERFLOW
P4.3/ECI
CLKSEL1 CLKSEL0
16-bit up Timer/Counter
PCACH0 PCACL0
8-bit
8-bit
OVF0
EOVFI
TCM0
INT
P4.0/CEX0
EN_ALL
EN_PCA
PCAIDLE
IDLE MODE
(From CPU)
CLEAR COUNTER
TCM1
TCM2
PWM FREQ
COMPARE
P4.1/CEX1
P4.2/CEX2
AI07857
175/293
|
▷ |