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.

CCS/TMS320F28035: IQasin or IQacos in IQmathLib

Part Number: TMS320F28035
Other Parts Discussed in Thread: C2000WARE

Tool/software: Code Composer Studio

hi,

everyone,

my question is:

in1 =_IQ(0.70710678L);
out1 =_IQasin(in1);

in theory:

out1 = 0.25 * 3.14156

but when I use CCS V6 debug the formula :IQasin,it results :

out1 = -0.3131141663

why?

  • Hello,

    Can you try the following and let me know what the result is:

    Value of in1

    The return value is supposed to be in IQ format. Can you adjust for that and get back to me?

    -Shantanu

  • Thanks,

    Shantanu,

    #define   GLOBAL_Q       24

    in1 =_IQ(1.0);
    out1 =_IQasin(in1);

    debug value:

    out1 = 2.309521794

  • I am assuming in1 is 16777216 ?

    out1 is expected to be in Q24 format right?

  • I ran the test on the F2837x using the project at C2000Ware_3_02_00_00\libraries\math\IQmath\c28\examples\C\2837xd

    and it works fine. See attached. The default Global Q is 24, so in1 corresponds to round(0.707.. x 2^24) and out1 corresponds to round(pi/4 x 2^24).

  • Hi,

    thanks for your answer!!

    I have found the problem ,because of “F28035.CMD” file(I need to add IQmathTablesRam  SECTIONS) ,

    1、but i donnot know the relationship between IQmath_coff.lib and IQmath.lib?

    2、following is the cmd,and I donnot know Uncomment or   not uncommented ?

     /* Allocate IQ math areas: */
       IQmath            : > FLASHA      PAGE = 0                  /* Math Code */
       IQmathTables      : > IQTABLES    PAGE = 0, TYPE = NOLOAD   /* Math Tables In ROM */
       IQmathTablesRam   : > IQTABLES3   PAGE = 0, TYPE = NOLOAD   /* Math Tables In ROM 林华俤新增*/


       Cla1ToCpuMsgRAM   : > CLA_CPU_MSGRAM PAGE = 1
       CpuToCla1MsgRAM   : > CPU_CLA_MSGRAM PAGE = 1

       .reset            : > RESET,      PAGE = 0, TYPE = DSECT
       vectors           : > VECTORS     PAGE = 0, TYPE = DSECT


     /* Uncomment the section below if calling the IQNexp() or IQexp()
          functions from the IQMath.lib library in order to utilize the
          relevant IQ Math table in Boot ROM (This saves space and Boot ROM
          is 1 wait-state). If this section is not uncommented, IQmathTables2
          will be loaded into other memory (SARAM, Flash, etc.) and will take
          up space, but 0 wait-state is possible.
       */
     /*
       IQmathTables2    : > IQTABLES2, PAGE = 0, TYPE = NOLOAD
       {

                  IQmath.lib<IQNexpTable.obj> (IQmathTablesRam)

       }
     */
       /* Uncomment the section below if calling the IQNasin() or IQasin()
          functions from the IQMath.lib library in order to utilize the
          relevant IQ Math table in Boot ROM (This saves space and Boot ROM
          is 1 wait-state). If this section is not uncommented, IQmathTables2
          will be loaded into other memory (SARAM, Flash, etc.) and will take
          up space, but 0 wait-state is possible.
       */

       IQmathTables3    : > IQTABLES3, PAGE = 0, TYPE = NOLOAD
       {

                 IQmath.lib<IQNasinTable.obj> (IQmathTablesRam)

       }

     

    thanks!!