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: The execution time of the same code is different in different frequency EPWM ISR

Part Number: TMS320F28379D

Interrupt once per PWM period. The execution time of the interrupt code in 25kHz PWM ISR is significantly less than in 50kHz PWM ISR. And, execution time are the same in 25kHz's and below. Execution time are the same at 50kHz's and above.

The following FOR loop code uses 32 clock cycles in the 25kHz PWM ISR and 128 clock cycles in the 50kHz PWM ISR.

The FOR loop is used because when the PWM ISR frequency exceeds 25kHz, running the DELAY_US function will enter the Illegal ISR.

The disassembly code at different frequencies is also the same.

SYSCLK = 200MHz

Set SVPWM_FULL to 5000 or 1000 to change the frequency.

--

Thanks & Regards

Yale

  • Hello Yale,

    With only the information you've provided, my best advice would be to take a look at the assembly code generated by the compiler. (CCS Options -> Build -> C2000 Compiler -> Advanced Options -> Assembler Options -> Keep the generated assembly language)

    Is there anything there that may indicate why behavior changes above a certain frequency? I'm uncertain how an empty for loop is affected by PWM execution time.

    Regards,
    Jason Osborn

  • Hi Jason,

    Here're the disassembly codes which are provided by customer:

     100kHz

     20kHz

    It seems there are no differences. 

    With only the information you've provided, my best advice would be to take a look at the assembly code generated by the compiler. (CCS Options -> Build -> C2000 Compiler -> Advanced Options -> Assembler Options -> Keep the generated assembly language)

    Are there difference between the way you provided and the customer using for generate .asm codes?

    Is there anything there that may indicate why behavior changes above a certain frequency? I'm uncertain how an empty for loop is affected by PWM execution time.

    Could you please make a further explain of it?

    --

    Thanks & Regards

    Yale

  • Hello Yale,

    I cannot see anything that would cause this issue. How are you determining how many clock cycles this takes?

    Regards,
    Jason Osborn

    Side note: The .asm generation options, if I'm not mistaken, should be present for everybody. That's part of CCS.