English
Language : 

C8051F58X Datasheet, PDF (342/356 Pages) Silicon Laboratories – Programmable hysteresis and response time Configurble as interrupt or reset source Low current
C8051F58x/F59x
29.3.6. 16-Bit Pulse Width Modulator Mode
A PCA1 module may also be operated in 16-Bit PWM mode. 16-bit PWM mode is independent of the other
(8/9/10/11-bit) PWM modes. In this mode, the 16-bit capture/compare module defines the number of PCA1
clocks for the low time of the PWM signal. When the PCA1 counter matches the module contents, the out-
put on CEXn is asserted high; when the 16-bit counter overflows, CEXn is asserted low. To output a vary-
ing duty cycle, new value writes should be synchronized with PCA1 CCFn match interrupts. 16-Bit PWM
Mode is enabled by setting the ECOM1n, PWM1n, and PWM161n bits in the PCA1CPMn register. For a
varying duty cycle, match interrupts should be enabled (ECCF1n = 1 AND MAT1n = 1) to help synchronize
the capture/compare register writes. If the MAT1n bit is set to 1, the CCFn flag for the module will be set
each time a 16-bit comparator match (rising edge) occurs. The CF1 flag in PCA1CN can be used to detect
the overflow (falling edge). The duty cycle for 16-Bit PWM Mode is given by Equation 29.4.
Important Note About Capture/Compare Registers: When writing a 16-bit value to the PCA1 Cap-
ture/Compare registers, the low byte should always be written first. Writing to PCA1CPLn clears the
ECOM1n bit to 0; writing to PCA1CPHn sets ECOM1n to 1.
Duty Cycle = ---6---5----5---3---6-----–-----P----C-----A----1----C-----P----n----
65536
Equation 29.4. 16-Bit PWM Duty Cycle
Using Equation 29.4, the largest duty cycle is 100% (PCA1CPn = 0), and the smallest duty cycle is
0.0015% (PCA1CPn = 0xFFFF). A 0% duty cycle may be generated by clearing the ECOM1n bit to 0.
Write to
PCA1CPLn
0
ENB
Reset
Write to
PCA1CPHn ENB
1
PCA1CPMn
P ECCMT P E
WCA A AOWC
MOP P TGMC
1 MPN n 1 1 F
61111nn1
1nnn
n
n
1 00x0 x
PCA1CPHn PCA1CPLn
Enable
16-bit Comparator
match S SET Q
CEXn Crossbar
R CLR Q
PCA1 Timebase
PCA1H
PCA1L
Overflow
Figure 29.10. PCA1 16-Bit PWM Mode
Port I/O
342
Rev. 1.2