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.

RE: How to generate a three-phase symmetric PWM using N2HET?

Hi Anthony,

i have an program overflow issue when assemble the code you provide. device has 160 instructions word limit

is there something that i missed?

thanks

  • Erol,

    2 ways to get an overflow:

    1) modify the code so that it doesn't branch back to instruction 0 when it's done.

    2) don't give the program enough cycles to execute.

    If you didn't modify the code at all then I'd assume the problem is 2.
    In that case you need to increase the LRP and/or HRP dividers.  The # of cycles that you get to execute your program is based on these dividers.

    Ex. if the LRP is set to 128 HR clocks and the HRP is set to 1 VCLK2 = 1 HR Clock, then you get 127 cycles (128-1) worth of execution time per loop.  The N2HET has to be already back to address 0 on or before the 128th cycle or else you will get the overflow error.   If it gets there early no problem - that's the way HET usually works. It'll wait till the start of the next LRP before executing again which is how the execution stays periodic.

  • Hi Anthony,

    That's Right when i increase the divider it works.

    thanks a lot.