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.

TMS320F28027: Warning during using IQmath and error in watch window

Part Number: TMS320F28027


I am usingCCSv6

A) My code is as follows

#define PI 3.14159

_iq29 in2, out2;
in2 =_IQ29(0.25*PI);
out2 =_IQ29cos(in2);

B) I am getting following warning

Type #16002-D build attribute vendor section TI missing in "../IQmath.lib<IQ24cos.obj>": compatibility cannot be determined

#16002-D build attribute vendor section TI missing in "../IQmath.lib<IQmathTables.obj>": compatibility cannot be determined

 Type #552-D variable "out2" was set but never used

C) When I put above variables in watch window and I run the programm I get following remarks againts the variables

out2       unknown Error: identifier not found: out2 
in2         unknown Error: identifier not found: in2

D) However when I pause the program I get some values against the variable

out2     379625302 ( However right value is 379625062)
in2       421657088 ( However right value is 421657072)

E) My questions

1. Why I am getting warning for IQ maths and variable (was set but never used) at same time

2. Why in run mode I am not able to see the values against the variables.However when it is paused i am able to see

3. Why there is difference between the values calaculated and shown by CCS

  • Ashutosh,

    1. Why I am getting warning for IQ maths and variable (was set but never used) at same time

    - The compatibility warnings are innocuous.  You can find further information here:

    - You are getting the "set but never used" warning on a local variable which was assigned a value and then never used.  This is helpful to know if you are coding, but if you want to suppress the message you can do so by changing the warning number in the Wiki description above.

    2. Why in run mode I am not able to see the values against the variables.However when it is paused i am able to see

    - In normal debug mode the CCS expressions window updates only when the CPU is halted.  Since your variables are (I believe) local, CCS does not know their value until the program has run, so it displays "identifier not found" until you stop the CPU. If your variables had been global you would have seen values against them before you ran the CPU.

    If you want to examine the variables in real-time, while the program is running, you can invoke real-time debug mode.  There is more on this in the C2000 1-day workshop, and here:

    3. Why there is difference between the values calaculated and shown by CCS

    - This is an artefact of finite numerical precision.  You are working with a 32-bit fixed-point machine.  When two 32-bit integers are multiplied the result is a 64-bit integer which must be scaled (right shifted) so the result is in the same (32-bit integer) format as the operands.  The right shifting is part of the IQ multiplication and precision is lost when this takes place.  This applies to "in2".  For "out2" a small amount of additional error is introduced in the cosine function (see p.64 of the IQ math user's guide).

    Regards,

    Richard