Setting parameters of multiple PWM blocks in one go

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

cross mob
Anonymous
Not applicable

Hello Everyone,

   


Actually, I am designing a control system for 500W DC-DC converter which requires me to solve few equations (already did, thanks to <math.h> ) to get a new set of PWM blocks (3 actually) parameters  (frequency and compare reg etc). So, how can I give these parameters to PWM blocks in a parallel manner or in a closed loop form. Moreover, I am afraid that if I will give it in a normal manner (just write cmp or other parameters sequentially for each PWM block one at a time) then my converter will have abnormal behavior (BANG!!).

   

Note: I have been able to start PWM blocks in parallel using hardware enable i.e, setting a control reg in on go to turn ON all PWM blocks. 

Thanks in advance.

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

Changed parameters in a PWM block will take hold when the next cycle starts (at least the period does, for the compare value this might differ). I think this depends on the actual PWM config, so read the data sheet.

0 Likes
Anonymous
Not applicable

Thanks for you reply.

   

But still there will be at least one or two instructions-delay to change parameter values of two PWM blocks. I want these two PWM blocks to start at same time when I give write period and compare. 

0 Likes
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

I recommend reading this Application Note, as it dwells on how parameters take effect in  PWM.

   

http://www.cypress.com/documentation/application-notes-obsolete/an2345-general-simple-method-generat...

   

 

   

I am not sure that using standard PWM block it is possible to update all parameters in sync manner. PWM block can probably be modified to have register values being updated on a strobe signal, but then it it as good as making a custom component. 

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Thanks for you help:

   

The document really gave me an insight into the working of PWM block. But I am afraid to use this method in my task as I may have to compensate that turning ON and OFF of the PWM blocks.  

I am more interested in that strobe thing. Can you please give more information about how to proceed for it (editing a standard PWM block).
Moreover, I have attached a pdf file to summarize my task in few snaps that might help you to understand my approach for the generation of variable phase along with frequency/period. 

   

In attached doc, both PWM blocks have to start and update their respective periods/compare register to get normal phase-shift. 
 

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

What you could do: configure all 3 PWMs to run with two outputs. That way you can configure one output while the other is in use (and you don't need to care abpout glitches). Use a mux to select between the outputs. For switching you can create hardware logic that switches exactly when the PWM period is over (use a toggle-FF, triggered by the TC of the PWM).

   

This assumes that all PWMs run with the same period, but otherwise synchronizing them doesn't make sense.

0 Likes
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

Just to make sure that we are not inventing a bicycle here, there is Cypress App Note on phase-shift full bridge modulation

   

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

   

 

   

Look on pp.6 and 8 how a phase-shifted PWM pair is generated from a single PWM component. The "n_pwm_clk" (derived from "tc" output of PWM) is divided by 2, providing fixed 50% duty cycle, while PWM output provides a phase-delay gate.  This way only a single parameter (PWM duty cycle) is being updated to change the phase.

0 Likes
Anonymous
Not applicable

Thanks for your suggestion. I went through this application note before. First of all this application is for half bridge DC-DC converter not full. Secondly, The PWM block that has been used in this PSFB component is 8-bit and I want to use 16-bit to get higher resolution. Is there any way to change PSFB's internal pwm component from  8-bit to 16-bit?  

0 Likes
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

I don't see problem modifying PFSB component to 16-bit. Import component into your project and modify as needed (change PWM to16 bit UDB). The best way to consult hte author of the app note directly.

0 Likes
Anonymous
Not applicable

Well, I tried to modify source files of internal PWM block but was not been able to save it, Even though, I found the source UDB PWM block and tried to make it 16-bit but later still got error and failed to save it (file is locked, as lock symbol can be seen in the tab of UDB PWM). Finally, I contacted the author but my email was rejected by cypress's server.

0 Likes
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted
        Contact Cypress technical support by filing a case.   
0 Likes
Anonymous
Not applicable

Thanks. will do 🙂

0 Likes
Anonymous
Not applicable

I started a case and only got 2 replies which were useless and I had to esclate it after not getting any response for 3 days.

Can you spare few moments from you precious time and change PSFB-8-bit to PSFB-16-bit? I already burnt my circuits 2 times because of low resolution.

   

 

   

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

 

0 Likes
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

muhammad,

   

The only time I have is weekends.

   

try following:

   

1. Start creating empty schematic component standard way.

   

2. Open PSFB component in another Creator IDE.

   

3. Copy/paste all schematics and files from PSFB into new component.

   

4. Compile and save new component.

   

5. Once you make sure it works, modify PWM to UDB 16 bit.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

When I calculate the dates and times of your post you submitted your initial request at a holy day of obligation followed by some days off (hereabouts including the Monday). No wonder that answers came slowly.

   

Please post your complete project, so that we all can have a look at all of your settings. To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Its working now, I just extracted the component only to a different folder and edited it first before adding into my project. Thanks for your help.
@Bob, I did not realize about Easter gap, actually the deadline to write final version of my paper in PEDG2016 is only few weeks away. I will close case from cypress's technical support.  
 

0 Likes
Anonymous
Not applicable

Thanks every one 

   

recently i have face that problem too thanks for sharing your view

   

god blessed you.

0 Likes