Hi:
I want to generate two channel PWMs, but there have only one timer with two CCR.
Please tell me how to do, thanks!
Fred
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi:
I want to generate two channel PWMs, but there have only one timer with two CCR.
Please tell me how to do, thanks!
Fred
Hi aBUGSworstnightmare:
The Part Number have been decided by the customer. So they want to gain two PWM's.
Fred
It is possible to use two PWMs, but then you cannot freely choose the PWM frequency.
To do so, you have to run the timer in continuous mode. The PWM frequency is then determined by the timer clock 65536. Then CCR0 can be used in set/reset or reset/set mode to provide a second PWM instead of controlling the PWM frequency.
The resulting PWM frequency, however, is quite low. only 15.26Hz per 1MHz timer clock (244Hz maximum if the timer is clocked by 16MHz)
The possible resolution, however, is incredible: you can set the PWM duty cycle in 15.26ppm steps. :)
**Attention** This is a public forum