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.

IQ math for C++ for TMS320F28335

Other Parts Discussed in Thread: TMS320F28335, CONTROLSUITE

Hi,

I am using CCS5.2 with XDS510 emulator for TMS320F28335.

 I want to use IQ math variables in CPP. I declare a class with _iq variables.

When I try use variable in CPP file, while debugging it is throwing an error stating illegal operation occurred compiler aborting.

Class

{

_iq variable1;

_iq variable2;

int variable3;

}

declared in hpp file.

I am using following code in CPP file.

Variable1 = _IQmltpy(_IQ( variable3),_IQvariable2);

while debugging it is stating illegal ISR occurred code aborting.

Is there any IQ example code available for CPP.

Thanks & Regards,

Bhanu 

  • Bhanu,

    Please take a look at the example/source:

    C:\ti\controlSUITE\libs\math\IQmath\<version>\examples_ccsv4\Cpp\source

    -Lori

  • Hi Lori,

    I imported CPP example code from following path into my CCS5.2 workdspace.

    C:\ti\controlSUITE\libs\math\IQmath\v160\examples_ccsv4\Cpp\2833x

    I added following line to the code.

    Yoffset = _IQmpy(IQ(STEP_X_SIZE) ,IQ(STEP_Y_SIZE));

    and compiled. It is throwing following error.

    "Description Resource Path Location Type
    no suitable conversion function from "iq" to "long" exists IQsample.cpp /28335_IQsampleCpp line 79 C/C++ Problem"

    I am able to do multiplication in "C" but not in "CPP" file.

    Thanks & Regards,1423.IQsample.cpp1538.IQsample.cpp

    Bhanu Prakash Villuri1602.IQsample.cpp

     

     

  • villuribhanu said:

    I imported CPP example code from following path into my CCS5.2 workdspace.

    C:\ti\controlSUITE\libs\math\IQmath\v160\examples_ccsv4\Cpp\2833x

    I added following line to the code.

    Yoffset = _IQmpy(IQ(STEP_X_SIZE) ,IQ(STEP_Y_SIZE));

    and compiled. It is throwing following error.

    "Description Resource Path Location Type
    no suitable conversion function from "iq" to "long" exists IQsample.cpp /28335_IQsampleCpp line 79 C/C++ Problem"

    In C++ the operators are overloaded, so you you would write it as a natural multiply:

        Step.Yoffset = IQ(STEP_X_SIZE) * IQ(STEP_Y_SIZE);

    Regards

    Lori