STC8A8K64D4 Series Manual
PCA 7-bit PWM mode
0 0 0
Output 0
0 CL[6:0]
EPCnL CCAPnL[6:0]
0 0
8-bit comparator
enable
CL overflow
CCPn
1
EPCnH CCAPnH[6:0]
reload
CCAPMn
- ECOMn CAPPn CAPNn MATn TOGn PWMn ECCFn
Output 1
{0,CL[6:0]}<{EPCnL,CCAPnL[6:0]}
{0,CL[6:0]}>={EPCnL,CCAPnL[6:0]}
18.3.4.3 6-bit PWM Mode
When EBSn [1: 0] in the PCA_PWMn register is set to 10, PCAn operates in 6-bit PWM mode, where {0, CL [5:
0]} is compared with the capture registers {EPCnL, CCAPnL [5: 0] }. When PCA modules are operating in 6-bit PWM
mode, the output frequencies of them are the same because all the modules share a single PCA counter. The output duty
ratio of each module is set using the registers {EPCnL, CCAPnL [5: 0]}. The output is low when the value of {0, CL
[5: 0]} is less than {EPCnL, CCAPnL [5: 0]}, and the output is high when the value of {0, CL [5: 0]} is equal to or
greater than {EPCnL , CCAPnL [5: 0]}. When CL [5: 0] overflows from 3F to 00, the contents of {EPCnH, CCAPnH
[5: 0]} are reloaded into {EPCnL, CCAPnL [5: 0]}. This makes it possible to update the PWM without interference.
PWM frequency in 6-bit mode=
PCA input clock source frequency
64
When EPCnH=0 and CCAPnH=00H, PWM fixed output high
When EPCnH=1 and CCAPnH=FFH, PWM fixed output low
The structure of PCA module working in 6-bit PWM mode is shown below.
PCA 6-bit PWM mode
0 0 0
Output 0
0 CL[5:0]
EPCnL CCAPnL[5:0]
0 0
7-bit comparator
enable
CL overflow
CCPn
1
EPCnH CCAPnH[5:0]
reload
CCAPMn
- ECOMn CAPPn CAPNn MATn TOGn PWMn ECCFn
Output 1
{0,CL[5:0]}<{EPCnL,CCAPnL[5:0]}
{0,CL[5:0]}>={EPCnL,CCAPnL[5:0]}