cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 5, 3 & 1

Anonymous
Not applicable

How can I get an offset between 2 PWMS of 50% duty ratio? Thanks in advance

0 Likes
9 Replies
Bob_Marlowe
Expert II

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.

   

 

   

Bob

0 Likes
ETRO_SSN583
Esteemed Contributor

If you are trying to accomplish deadband see attached from PWM

   

datasheet.

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

Thanks for your reply: Please refer to attached picture, maybe you can understand 

   

0 Likes
Anonymous
Not applicable

offset picture

0 Likes
Anonymous
Not applicable

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 

0 Likes
Bob_Marlowe
Expert II

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.

   

 

   

Bob

0 Likes
odissey1
Honored Contributor II

muhammad,

   

there is an approach to generate variable phase shift between TTL pulses (untested):

   

http://www.cypress.com/file/37261/download

   

 

   

 

   

There is another approach using DDS generator with dual variable phase output. You may download it from this thread:

   

http://www.cypress.com/forum/psoc-community-components/how-do-lock-amplifivation-psoc-5lp#comment-28...

   

and here:

   

http://www.cypress.com/forum/psoc-5-device-programming/need-demo-program-lock-amplification

   

YouTube link:

   

https://youtu.be/qVU3PoVIUxw

0 Likes
Anonymous
Not applicable

Dear odissey,
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.   

0 Likes
odissey1
Honored Contributor II

Congratulations and thank you for sharing your project.

0 Likes