68.7.45 PWM Channel Period Update Register

This register can only be written if bits WPSWS3 and WPHWS3 are cleared in the PWM Write Protection Status Register.

This register acts as a double buffer for the CPRD value. This prevents an unexpected waveform when modifying the waveform period.

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

Name: PWM_CPRDUPDx
Offset: 0x0210 + x*0x20 [x=0..3]
Reset: 
Property: Write-only

Bit 3130292827262524 
          
Access  
Reset  
Bit 2322212019181716 
 CPRDUPD[23:16] 
Access WWWWWWWW 
Reset  
Bit 15141312111098 
 CPRDUPD[15:8] 
Access WWWWWWWW 
Reset  
Bit 76543210 
 CPRDUPD[7:0] 
Access WWWWWWWW 
Reset  

Bits 23:0 – CPRDUPD[23:0] Channel Period Update

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

– By using the PWM peripheral clock divided by a given prescaler value “X” (where X = 2PREA is 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, or 1024). The resulting period formula is: 

 X × CPRDUPD f peripheral clock

– By using the PWM peripheral clock divided by a given prescaler value “X” (see above) and by either the DIVA or the DIVB divider. The formula becomes, respectively:

 X × CPRDUPD × DIVA f peripheral clock or X × CPRDUPD × DIVB f peripheral clock 

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

– By using the PWM peripheral clock divided by a given prescaler value “X” (where X = 2PREA is 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, or 1024). The resulting period formula is:

 2 × X × CPRDUPD f peripheral clock

– By using the PWM peripheral clock divided by a given prescaler value “X” (see above) and by either the DIVA or the DIVB divider. The formula becomes, respectively:

 2 × X × CPRDUPD × DIVA f peripheral clock or 2 × X × CPRDUPD × DIVB f peripheral clock