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.

TMS320F2808 Truncation Error

Other Parts Discussed in Thread: CONTROLSUITE

Hello,

I am new to TMS320F280x DSP. I want to implement Full Bridge Thyristor Rectifier. I tried ePWM module with 60Hz PWM Frequency. 60Hz in terms of Counts comes upto 1666666 counts. When I Build this I get the error as below:

Description Resource Path Location Type
#70-D integer conversion resulted in truncation main.c /Project_1 line 27 C/C++ Problem

Is it possible to rectify this or can anyone suggest me a way to implement this Controlled Rectification.

Thank you

Regards,

Raksh

  • Raksh said:
    I want to implement Full Bridge Thyristor Rectifier.

    I have no expertise with that.  The most likely cause of this diagnostic ...

    Raksh said:
    #70-D integer conversion resulted in truncation

    is that you are using a int type variable where you should use long instead.  Note that, on C28x, int is a 16-bit type and long is a 32-bit type.  Thus, an int type variable cannot hold a value as large as 1666666.  To get a better idea of what is getting truncated, add --verbose_diagnostics to the build, then look at the output of the compiler build in the Console view, not the Problems view.

    Thanks and regards,

    -George

  • Hello George,
    Thank you for the reply.
    Yes, I tried by removing the int in the declaration and the error was gone.

    Is it possible to divide the SYSCLK this way :

    EPwm3Regs.TBCTL.bit.HSPCLKDIV = TB_DIV5;
    EPwm3Regs.TBCTL.bit.CLKDIV = TB_DIV5;

    I am sure TB_DIV4 works fine. But TB_DIV5 has "Undefined TB_DIV5" error.
    Thank you.

    Regards,
    Raksh
  • Raksh said:
    Is it possible to divide the SYSCLK this way :

    EPwm3Regs.TBCTL.bit.HSPCLKDIV = TB_DIV5;
    EPwm3Regs.TBCTL.bit.CLKDIV = TB_DIV5;

    We who watch this forum lack the expertise to answer.  I think these struct definitions and preprocessor names come from controlSUITE.  Please start a new thread in the C2000 forum with these questions.

    Thanks and regards,

    -George

  • Hello George

    Following up the previous threads, I found a solution for my question in C2000 Forum.
    Thank you for the help.
    Solution link:
    http://e2e.ti.com/support/microcontrollers/c2000/f/171/p/394073/1391850#1391850

    Regards,
    Raksh