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.

TMS320F28069F: InstaSPIN Projects and Labs: Lab10c: some questions on the file of user.c

Part Number: TMS320F28069F

Hello,

I have a question on InstaSPIN Projects and Labs.

Specifically it is on Lab10c-An Example in Space Vector Over Modulation, with fpu32.

I have some questions on the file of user.c as follows.

----------------------------------------------------------------------------------------------------

1. The First question.

In the file of user.c the following #ifdef statement is listed:

#ifdef __TMS320C28XX_FPU32__

It seems that the symbol of __TMS320C28XX_FPU32__ has been defined somewhere in the project because the C statements next to this line are asserted.

However I am not able to find the place where the symbol __TMS320C28XX_FPU32__ is defined.

Furthermore the symbol is not listed in the Predefined Symbols window of the Project Properties.

Where has the symbol __TMS320C28XX_FPU32__ been defined?

2. The second question

It is stated in the file of user.c as follows:

  // when calling EST_ functions that return a float, and fpu32 is enabled, an integer is needed as a return
  // so that the compiler reads the returned value from the accumulator instead of fpu32 registers

What is the problem if the compiler reads the returned value from the fpu32 registers?

3. The third question

The following C statements are listed in the file of user.c

#else
  Ls_d = EST_getLs_d_H(obj->estHandle);

  Ls_q = EST_getLs_q_H(obj->estHandle);

  Rs = EST_getRs_Ohm(obj->estHandle);
#endif

In this case, the compiler seems to read the returned value from the fpu32 registers. Isn't it?

For example, the prototype for the function  EST_getLs_d_H() is given in the file est.h as follows:

extern float_t EST_getLs_d_H(EST_Handle handle);

----------------------------------------------------------------------------------------------

Thank you for your guidance.

With regards,

JS Yoo

  • 1.  __TMS320C28XX_FPU32__ is set by C2000 compiler automatically if fpu32 is enabled in project properties (--float_support=fpu32).

    2. The different FAST library is used for float point, so that need this conversion.

    3. As of Q2, that's from the FAST library.