Hello. I have working program for vector control on TMS320F28027 and i want convert all calculations on TMS320F28069.
Simple code:
Asin=_IQ19sin(_IQ19(6.28)); Acos=_IQ19cos(_IQ19(6.28)); Asqrt=_IQ19sqrt(_IQ19(4)); Ampy=_IQ19mpy(_IQ19(10),_IQ19(2)); Adiv=_IQ19div(_IQ19(10),_IQ19(2));
works on F28027 :sin(6.28)=-0.0032, Asqrt=5 etc...
but when i placed it to F28069 i was very surprised:
Asin=_IQ19sin(2*pi)=-0.7825889587
Acos=_IQ19cos(2*pi)=1.102172852
Asqrt=_IQ19sqrt(4)=-508.0003605;!!!!!
etc. Only _IQ19mpy works...
What I did wrong?My actions:
1. added iqmathlib.h
2. added "rts2800_fpu32.lib"
3. added "IQmath_fpu32.lib"
4. added "rts2800_fpu32_fast_supplement.lib"
5. 28069.cmd file:
FPUTABLES : origin = 0x3FD860, length = 0x0006A0 /* FPU Tables in Boot ROM */ IQTABLES : origin = 0x3FDF00, length = 0x000B50 /* IQ Math Tables in Boot ROM */ IQTABLES2 : origin = 0x3FEA50, length = 0x00008C /* IQ Math Tables in Boot ROM */ IQTABLES3 : origin = 0x3FEADC, length = 0x0000AA /* IQ Math Tables in Boot ROM */ /* Allocate IQ math areas: */ IQmath : > FLASHA, PAGE = 0 /* Math Code */ IQmathTables : > IQTABLES, PAGE = 0, TYPE = NOLOAD /* Allocate FPU math areas: */ FPUmathTables : > FPUTABLES, PAGE = 0, TYPE = NOLOAD
6. in iqmathlib.h strings:
#define FLOAT_MATH 1 #define IQ_MATH 0 #ifndef MATH_TYPE #define MATH_TYPE IQ_MATH #endif
7. Compiler opt:
-v28 -ml -mt --cla_support=cla0 --float_support=fpu32 --vcu_support=vcu0
