3738 views|0 replies

1140

Posts

0

Resources
The OP
 

TMS320F28035 learning how to use IQMath lib [Copy link]

Reference Manual "IQmath_Quickstart.pdf" Version V1.6.0

Storage path: C:\ti\controlSUITE\libs\math\IQmath\v160\doc

1. TMS320F28035 is a 32-bit fixed-point DSP chip launched by TI. Its hardware itself does not support floating-point operations. The floating-point operations used in C language programming are completed at the software level. TMS320F28035 does not have floating-point operation capabilities. Using C language programming to implement floating-point operations in software will increase the amount of code and program running time. IQmath is a calculation method that uses fixed-point operations but has floating-point data processing characteristics, and IQmath also has a rich function library.

The advantage is fast processing speed and low code size. The disadvantage is that there may be errors when converting decimal floating point numbers to binary.

4. The IQ format consists of an integer part (I), a decimal part (Q) and a sign bit. So I+Q=31 bits. When the Q value is determined, the accuracy of all IQ data participating in the calculation is consistent, and the dynamic range of the data is also determined. The accuracy and data range corresponding to the specific Q value can be found in the table.

5. Simple summary of IQmath application:

1) Q value calibration: Select a Q value based on the required error and data range.

2) Convert floating point numbers to IQ data format.

3) Convert the IQ data to floating point numbers.

6.IQmath.lib is used for fixed-point chips. IQmath_f32.lib is used for floating-point chips.

7. Some suggestions for CMD file configuration:

The output section "IQmathTables" contains some functions that have been burned into the BOOTROM area, so it must be set to the "NOLOAD" type to look up the table in the BOOTROM area without loading other areas.

The output section "IQmathTablesRam" contains functions that can be loaded when needed. Some chips also burn these functions into the BOOTROM area, so you can look up the table directly.

8. Configure IQmath.lib library file in the project

1). Similar to the method of adding c files, just know the path and add it

2). You need to include #include "IQmathLib.h" in the c file

3).Configure the .CMD file.

9. Instructions for using IQmath

1. In IQmathLib.h, modify the Q format as needed, the range is Q1 to Q30 (P30)

//30<=GLOBAL_Q<=1

//

#ifndefGLOBAL_Q

#defineGLOBAL_Q24

#endif

The default format in IQmathLib.h is Q24

The value range and precision of the Q format are described on page 10 of the manual.

10. Process of using IQmath

1) All data involved in the calculation must be converted into Q format, such as

#definePI3.1415926535898

_iq input = _IQ(PI); //Convert PI to Q format

2) After conversion to Q format, all data are involved in the calculation and must be calculated using the IQ library function

3) Convert Q format to floating point number

float_IQtoF(_iqA)

11.

This post is from Microcontroller MCU
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list