This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28379D: HRPWM Buck Converter

Part Number: TMS320F28379D
Other Parts Discussed in Thread: C2000WARE, BOOSTXL-BUCKCONV

Hi,

In the code for the HRPWM converter, which is referenced in a previous question that I have created a new question from, there are a few questions I have. The code can also be seen on page 25 of https://www.ti.com/lit/ug/spru924f/spru924f.pdf?ts=1616598823840&ref_url=https%253A%252F%252Fwww.google.com%252F

First of all, the initialization code is written in C, but the actual updating of the duty, I believe, is performed in assembly. How exactly does one call an assembly code from the main C? There does not seem to be any single function or call from within the C code that would allow execution of the asm file.

Is this a good snippet from a full program, that TI wrote? is there any way I could access this whole C program, such that the program makes more sense with more context?

This would also help with a lot of the defintions when initializing the PWM module, which are given as variables - which I assume are initialized as global variables elsewhere in the code. I am afraid that it is terribly difficult to understand and interpret the HRPWM code snippet with so little context. 

Regards,
Joel

  • Furthermore, for example, the line "hrbuck_period = 200; // Used for Q15 to Q0 scaling" makes no sense to me, since it is not referenced or used within the code whatsoever. What is Q15 to Q0 scaling, why is it necessary in the application, and how is it performed?

    Again, this would all be much clearer if I could access the actual, full code for the HRPWM buck converter. I cannot seem to locate it in C2000Ware or anywhere else - I can only access a basic code for the SFO and HRPWM functions, but not the buck converter or even the DAC example on the following pages.

  • Hi Joel,

    I am trying to find the source code for this example and will reply back by tomorrow with more information.

    Best Regards,

    Marlyn

  • Joel,

    You can either use the asm("") function or make a C callable assembly function in a different ASM file and then call it in you application.

    But I'm pretty sure for you application you can just update the CMP/duty values using normal C. Unless you are counting every cycle, you should be okay with C.

    Also we have many HRPWM examples that Marlyn and I have put together an validated in C2000Ware. Those are full examples. Why dont you try one of those?

    Nima

  • Hi,

    I have been looking through some of the examples of the HRPWM in C2000Ware unfortuantely, they are written using the driverlib functions - they are also terribly complicated, and I find it difficult to follow them. I am slightly better versed with the direct register access method of coding - although still not experienced. For example, I attempted to look through the bi-directional CLLLC example which I believe uses HRPWM for the phase-shift; but found that I couldn't follow the code because of how complex it is. I will look again. 

    Thanks for your help.

    Joel

  • Hi Joel,

    Another idea would be to look at the software example for the BOOSTXL-BUCKCONV in the Digital Power SDK (which is for the F280049C).  Note that it does use driverlib.

    For someone who is going to look at the more complex system solutions within the SDK, I would typically recommend looking at the buck converter solution first.  It also happens to match with the topology you're working with.


    Thank you,
    Brett