52.7.11 PWM Channel Period Register

Only the first 16 bits (internal channel counter size) are significant.

Name: PWM_CPRDx
Offset: 0x0208 + x*0x20 [x=0..3]
Reset: 0x00000000
Property: Read/Write

Bit 3130292827262524 
 CPRD[31:24] 
Access R/WR/WR/WR/WR/WR/WR/WR/W 
Reset 00000000 
Bit 2322212019181716 
 CPRD[23:16] 
Access R/WR/WR/WR/WR/WR/WR/WR/W 
Reset 00000000 
Bit 15141312111098 
 CPRD[15:8] 
Access R/WR/WR/WR/WR/WR/WR/WR/W 
Reset 00000000 
Bit 76543210 
 CPRD[7:0] 
Access R/WR/WR/WR/WR/WR/WR/WR/W 
Reset 00000000 

Bits 31:0 – CPRD[31:0] Channel Period

If the waveform is left-aligned, then the output waveform period depends on the counter source clock and can be calculated:

– By using the peripheral clock (MCK) divided by an X given prescaler value (with X being 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, or 1024). The resulting period formula will be: 

 X × CPRD MCK

– By using a peripheral clock divided by one of both DIVA or DIVB divider, the formula becomes, respectively: 

 CPRD × DIVA MCK or CPRD × DIVB MCK

If the waveform is center-aligned, then the output waveform period depends on the counter source clock and can be calculated:

– By using the peripheral clock divided by an X given prescaler value (with X being 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, or 1024). The resulting period formula will be:

 2 × X × CPRD MCK

– By using a peripheral clock divided by one of both DIVA or DIVB divider, the formula becomes, respectively:

 2 × CPRD × DIVA MCK or 2 × CPRD × DIVB MCK