|
The compare value register is what controls duty cycle.
PWM_WriteCompare() (for a one output PWM)
For 8 bit part it can range from 0 to 255, 0 produces a DC value of 0%, 255 100%,
and in between the DC ranges from 0+ - 100- %.
The PWM output is driven by the compare logic, as PWM counter is running, the compare
register values is compared to the period counter value, and depending on the compare type,
" less than", "less than or equal"..... it sets or resets the PWM output terminal, there by
controling the duty cycle.
Regards, Dana.
|