English
Language : 

UPSD33XX Datasheet, PDF (129/231 Pages) STMicroelectronics – Fast 8032 MCU with Programmable Logic
uPSD33xx
PWM Mode - Fixed Frequency, 16-bit
The operation of the 16-bit PWM is the same as
the 8-bit PWM with fixed frequency. In this mode,
one or all the TCM can be configured to have a
fixed frequency PWM output on the port pins. The
PWM frequency is depending on the clock input
frequency to the 16-bit Counter. The duty cycle of
each TCM module can be specified in the CAP-
COMHn and CAPCOMLn Registers. When the 16-
bit PCA_Counter is equal or greater than the val-
ues in registers CAPCOMHn and CAPCOMLn, the
PWM output is switched to a high state. When the
PCA_Counter overflows, CEXn is asserted low.
PWM Mode - Fixed Frequency, 10-bit
The 10-bit PWM logic requires that all 3 TCMs in
PCA0 or PCA1 operate in the same 10-bit PWM
mode. The 10-bit PWM operates in a similar man-
ner as the 16-bit PWM, except the PCACHm and
PCACLm counters are reconfigured as 10-bit
counters. The CAPCOMHn and CAPCOMLn Reg-
isters become 10-bit registers.
PWM duty cycle of each TCM module can be
specified in the 10-bit CAPCOMHn and CAP-
COMLn Registers. When the 10-bit PCA counter
is equal or greater than the values in the 10-bit
registers CAPCOMHn and CAPCOMLn, the PWM
output switches to a high state. When the 10-bit
PCA counter overflows, the PWM pin is switched
to a logic low and starts the next PWM pulse.
The most-significant 6 bits in the PCACHm
counter and CAPCOMH Register are “Don’t cares”
and have no effect on the PWM generation.
Writing to Capture/Compare Registers
When writing a 16-bit value to the PCA Capture/
Compare registers, the low byte should always be
written first. Writing to CAPCOMLn clears the
E_COMP Bit to '0'; writing to CAPCOMHn sets
E_COMP to '1' the largest duty cycle is 100%
(CAPCOMHn CAPCOMLn = 0x0000), and the
smallest duty cycle is 0.0015% (CAPCOMHn
CAPCOMLn = 0xFFFF). A 0% duty cycle may be
generated by clearing the E_COMP Bit to ‘0’.
Control Register Bit Definition
Each PCA has its own PCA_CONFIGn, and each
module within the PCA block has its own
TCM_Mode Register which defines the operation
of that module (see Table 70., page 129 through
Table 71., page 130). There is one PCA_STATUS
Register that covers both PCA0 and PCA1 (see
Table 72., page 131).
Table 70. PCA0 Control Register PCACON0 (SFR 0A4h, Reset Value 00h)
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
EN-ALL
EN_PCA
EOVFI
PCAIDLE
–
–
Details
Bit
Symbol
Function
0 = No impact on TCM modules
Bit 1
Bit 0
CLK_SEL[1:0]
7
EN-ALL 1 = Enable both PCA counters simultaneously (override the EN_PCA Bits)
This bit is to start the two 16-bit counters in the PCA. For customers who want 5 PWM,
for example, this bit can start all of the PWM outputs.
0 = PCA counter is disabled
1 = PCA counter is enabled
6
EN_PCA
EN_PCA Counter Run Control Bit. Set with software to turn the PCA counter on. Must
be cleared with software to turn the PCA counter off.
5
EOVFI 1 = Enable Counter Overflow Interrupt if overflow flag (OVF) is set
4
PCAIDLE
0 = PCA operates when CPU is in Idle Mode
1 = PCA stops running when CPU is in Idle Mode
3
–
Reserved
2
10B_PWM
0 = Select 16-bit PWM
1 = Select 10-bit PWM
1-0
CLK_SEL
[1:0]
00 Select Prescaler clock as Counter clock
01 Select Timer 0 Overflow
10 Select External Clock pin (P4.3 for PCA0) (MAX clock rate = fOSC/4)
129/231