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.
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.
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.
I recommend reading this Application Note, as it dwells on how parameters take effect in PWM.
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.
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.
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.
Just to make sure that we are not inventing a bicycle here, there is Cypress App Note on phase-shift full bridge modulation
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.
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?
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.
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.
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.
The only time I have is weekends.
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.
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.
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.