English
Language : 

UPSD33XX Datasheet, PDF (126/231 Pages) STMicroelectronics – Fast 8032 MCU with Programmable Logic
uPSD33xx
Operation of TCM Modes
Each of the TCM in a PCA block supports four
modes of operation. However, an exception is
when the TCM is configured in PWM Mode with
programmable frequency. In this mode, all TCM in
a PCA block must be configured in the same mode
or left to be not used.
Capture Mode
The CAPCOM registers in the TCM are loaded
with the counter values when an external pin input
changes state. The user can configure the counter
value to be loaded by positive edge, negative edge
or any transition of the input signal. At loading, the
TCM can generate an interrupt if it is enabled.
Timer Mode
The TCM modules can be configured as software
timers by enable the comparator. The user writes
a value to the CAPCOM registers, which is then
compared with the 16-bit counter. If there is a
match, an interrupt can be generated to CPU.
Figure 48. Timer Mode
Toggle Mode
In this mode, the user writes a value to the TCM's
CAPCOM registers and enables the comparator.
When there is a match with the Counter output, the
output of the TCM pin toggles. This mode is a sim-
ple extension of the Timer Mode.
PWM Mode - (X8), Fixed Frequency
In this mode, one or all the TCM's can be config-
ured to have a fixed frequency PWM output on the
port pins. The PWM frequency depends on when
the low byte of the Counter overflows (modulo
256). The duty cycle of each TCM module can be
specified in the CAPCOMHn Register. When the
PCA_Counter_L value is equal to or greater than
the value in CAPCOMHn, the PWM output is
switched to a high state. When the
PCA_Counter_L Register overflows, the content
in CAPCOMHn is loaded to CAPCOMLn and a
new PWM pulse starts.
ENABLE
CAPCOMHn
8
CAPCOMLn
8
16-bit COMPARATOR
8
8
PCACHm
PCACLm
16-bit up Timer/Counter
MATCH
INTFn
PCASTA
MATCH_TIMER
INTR
Note: m = 0: n = 0, 1, or 2
m = 1: n = 3, 4, or 5
TCMMODEn EINTF E_COMP CAP_PE
0
C
D
EN_FLAG
CAP_NE
0
MATCH TOGGLE PWM1
0
0
RESET
WRITE to
CAPCOMHn
1
0
PWM0
0
WRITE to
CAPCOMLn
AI07858
126/231