Well, I just found this in the DS:
I think this means a "100%" (in my mind, this is a signal always high - not useful but for the theory) duty-cycle value would be:DS note, page 131:
To get the correct PWM duty cycle, always
multiply the calculated PWM duty cycle
value by four before writing it to the PWM
Duty Cycle registers....
- PTER * 4 => 130 * 4 => 520
So, for a 50% duty-cycle, the PDC0 value is going to to be:
- 520 * 50% => 260
But, playing with the values, I can see on my scope that the numbers would be more accurate taking in account the PTER+1 (131 instead of 130) value.
Where is the truth?
Bookmarks