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.