We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi everyone,
I am using XC164CS DSP. I need to programme in such a way that duty cycle can be controlled. According to application, its a close loop current or voltage control but I didnt manage to do it in order to get the phase shift between the two legs of the converter. I need to get the phase shift by calculating duty cycle. it's a 20khz frequency of the signal
Can anyone help me on this?
Thanks,
Vivek
your duty cycle depends on the ratio between the value of the PWx (x=channel) register and the value of the peiod register PPx. if the input signal into the PWM peripheral is 20000 Hz, your signal width will be (20000 Hz) / ( value of period register).
Hi,
What should be the value of the period register because the only way to generate PWM in the XC164CS is by using CAPCOM unit. The duty cycle is changing everytime If I want to set the 5% duty cycle then what should i do?
Thanks
as I already said, that depends on the ratio between the two registers (there are many possible combinations). choose the one that gives you the desired signal properties.
How should I write in programme? It is not supposed to be structural way.
You can find an example to create a PWM using CAPCOM6 that you can modify the duty-cycle or period.
http://www.keil.com/forum/docs/thread11620.asp
hope this helps.
-Chris
You may want to look here also to learn a way of playing around with PWM registers: http://www.keil.com/forum/docs/thread12212.asp