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.

F28069 Control Stick

Other Parts Discussed in Thread: CONTROLSUITE

Hi,

I am using the signal generator function which generates an IQ15 output variable.  I need to convert this to floating point, so I added the IQmathlib.h and use _IQ15toF.

I see a couple of postings here that recommend just using the floating point sine function, but that is too slow for my application.

#include "PeripheralHeaderIncludes.h"
#include "IQmathLib.h"
#include "F2806x_Device.h"     // F2806x Headerfile Include File
#include "FPU.h"               // Include Floating Point Functions
#include <math.h>               //
#include "sgen.h"                // sine generator code

//--- INT 3.1 EPWM1 period interrupt
interrupt void EPWM1_INT_ISR(void)     // EPWM-1
{
    extern float k_wt;
    extern Uint16 PWMperiod;
    extern SGENT_1 sgen;
    float sine;

    PieCtrlRegs.PIEACK.all = PIEACK_GROUP3;    // acknowledge this PIE group
    EPwm1Regs.ETCLR.bit.INT = 1;            // reset the interrupt flag

    sgen.calc(&sgen);
    sine = _IQ15toF(sgen.out);

    EPwm1Regs.CMPA.half.CMPA = (Uint16)((float)(PWMperiod >> 1) * (1.0f + sine));
}

Here's the console output:

**** Build of configuration F2806x_FLASH for project Resolver_12AUG13 ****

"C:\\ti\\ccsv5\\utils\\bin\\gmake" -k all
'Building target: BlinkingLED.out'
'Invoking: C2000 Linker'
"C:/ti/ccsv5/tools/compiler/c2000_6.1.3/bin/cl2000" --silicon_version=28 -g --define="_DEBUG" --define="LARGE_MODEL" --define="FLASH" --diag_warning=225 --large_memory_model -z -m"BlinkingLED.map" --stack_size=0x380 --warn_sections -i"C:/ti/ccsv5/tools/compiler/c2000_6.1.3/lib" -i"C:/ti/controlSUITE/libs/math/IQmath/v15c/lib/IQmath_fpu32" -i"C:/ti/controlSUITE/libs/libs/math/IQmath/v15c/lib" -i"C:/ti/ccsv5/tools/compiler/c2000_6.1.3/include" -i"C:/Users/CKlaes/Documents/CCS5_WorkSpace/Resolver_12AUG13" --reread_libs --rom_model -o "BlinkingLED.out"  "../F2806x_Headers_nonBIOS.cmd" "./GPIOinit.obj" "./F2806x_PieVect.obj" "./F2806x_PieCtrl.obj" "./F2806x_GlobalVariableDefs.obj" "./F2806x_DefaultIsr.obj" "./F2806x_CpuTimerInit.obj" "./F2806x_CodeStartBranch.obj" "./F2806x_CaptureInit.obj" "./EPWMinit.obj" "./BlinkingLED-Main.obj" "./BlinkingLED-DevInit_F2806x.obj" -l"rts2800_ml.lib" "../F2806x_FLASH_BlinkingLED.CMD"
<Linking>

 undefined first referenced       
  symbol       in file            
 --------- ----------------       
 __IQ15toF ./F2806x_DefaultIsr.obj

error: unresolved symbols remain

error: errors encountered during linking; "BlinkingLED.out" not built
>> Compilation failure
gmake: *** [BlinkingLED.out] Error 1
gmake: Target `all' not remade because of errors.

So I don't understand why it's not finding the IQ library.

  • Hello!

    It seems you need IQmath_f32.lib. Perhaps this thread will be useful http://e2e.ti.com/support/microcontrollers/c2000/f/171/p/281731/984298.aspx#984298.

    Regards,

    Igor

  • You have the path to the IQMath library described via the following statement in the Linker options:

    -i"C:/ti/controlSUITE/libs/libs/math/IQmath/v15c/lib"

    But you still need to add the library to the linker options.  The following statement does not do this:

    -i"C:/ti/controlSUITE/libs/math/IQmath/v15c/lib/IQmath_fpu32"

    I don't think there is a directory called this.  I suspect you were intending for that statement to say "grab this .lib file".  The -i option is meant to give the path to library files.

    Via the Linker options found in the Project build options, you need to add the appropriate, desired .lib file in the "Include library file or command file as input" option.

    Menu Project -> Properties -> Build -> C2000 Linker -> File Search Path

    Add IQMath.lib or IQMath_fpu32.lib via --library, -l option.