PWMS with programmable offset

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
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
Level 10
Level 10
First like given 50 questions asked 10 questions asked

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
lock attach
Attachments are accessible only for community members.
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

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
lock attach
Attachments are accessible only for community members.
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
Level 10
Level 10
First like given 50 questions asked 10 questions asked

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
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

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
lock attach
Attachments are accessible only for community members.
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
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

Congratulations and thank you for sharing your project.

0 Likes