How can I get an offset between 2 PWMS of 50% duty ratio? Thanks in advance
Are you talking about PWM2 duty cycle = PWM1 duty cycle * 0.5 ?
If so, you can set PWM2's compare value accordingly each time you set PWM1's duty cycle.
If you are trying to accomplish deadband see attached from PWM
Thanks for your reply: Please refer to attached picture, maybe you can understand
There are 2 PWMs and both of them have 50% duty cycle but their mutual offset(or delay in the start of one waveform wrt to other one) is variable from 0-50%.
I am using it to drive Bi-Directional DC-DC Voltage Converter
OK, now I understand that you want to have a phase shift (sorry for the language barrier).
Just thinking over I would use two PWMs running from the same clock. Some counting logic must be used to skip clock pulses for either of the PWMs to get the phase shift. There is no direct solution I've got at hand, but the available hardware logic within a PSoC5 will be quite enough to handle that. You even (when some more acquainted to PSoCs) may generate a self-written component using a hardware description language (VeriLog) that is performing the job.
there is an approach to generate variable phase shift between TTL pulses (untested):
There is another approach using DDS generator with dual variable phase output. You may download it from this thread:
Your project was bit complicated. So, I tried to make by myself and succeeded. But still thanks for you response. Your help is highly appreciated.
Congratulations and thank you for sharing your project.