PSOC 5, Parallel Execution of two PWM Blocks

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

cross mob
Anonymous
Not applicable

Respected members,

I am encountering a problem regarding parallel execution of two PWM blocks. For example, if I start PWM blocks with same parameters (freq, cmp, etc.)  then at oscilloscope there is always a phase-shift between two PWMs. And if I try to change the order of the execution statements (PWM_Start();) then I get negative phase-shift. Is there anyway to get rid of this phase-shift and start two PWMs with zero phase-shift? 

0 Likes
7 Replies
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

Configure the PWMs to run only when the "start" signal is active (hardware enable). Then route this signal to a control register. That way you need to activate the signal on the register, and both PWMs start at the same time.

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored
0 Likes
Anonymous
Not applicable

Thanks for your response,

   

Its not working, I enabled the PWM with hardware with ControlReg but still I needed to write the "PWM_1_Start();" and "PWM_2_Start();"in main prog.

0 Likes

Yes, you need to start the components, but as long as the control register is 0 the PWMs won't start.

0 Likes
Anonymous
Not applicable

Its working now.
Thanks again.

0 Likes
Anonymous
Not applicable

how do i enable the 2 pwm outputs from same block asynchronously  ie at different times?

0 Likes
Anonymous
Not applicable

I think you cant:

   

Alternatively, plz refer to following application note.

   

http://www.cypress.com/documentation/application-notes/an76439-psoc-3-and-psoc-5lp-phase-shift-full-...

   

 

   

You need to add PSFB component to your project. That component will have four outputs you can use 2 out of 4 as per your requirements. 

0 Likes