How to calculate the PWM frequency and duty cycle?
Posted: 27 Mar 2017, 13:53
The formula is as follows:
PWM frequency = PWM clock source frequency / ((Pre-scale + 1) * frequency divider * (CNR + 1))
Duty Cycle = (CMR + 1) / (CNR + 1)
(CNR: 16-bit counter register; CMR: 16-bit comparator register)
PWM frequency = PWM clock source frequency / ((Pre-scale + 1) * frequency divider * (CNR + 1))
Duty Cycle = (CMR + 1) / (CNR + 1)
(CNR: 16-bit counter register; CMR: 16-bit comparator register)