Is there a tangent block in the C28x IQmath library?

1 view (last 30 days)
I would like to calculate the tangent of an angle using the C28x IQmath library, but the "Trig Fcn" block only provides SIN and COS options.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
There is no built-in capability in the C28x IQmath library to calculate tangent.
To work around this issue, you can use the regular tangent block and change the target function library to point to your specific processor. To change the target function library, go to 'Simulation' >> 'Configuration Parameters' >> 'Real-Time Workshop' >> 'Interface' and use the 'Target Function Library' drop-down list to select your processor. This process will replace the generic tangent function with a target-specific function.
You can view the details of the target-specific function by executing 'RTW.viewTfl' at the MATLAB command prompt. After navigating to the TI C28x folder, you will see that there is no fixed-point implementation for TANn. This means that the code Simulink generates for tangent will actually be floating-point, but Code Composer Studio will convert the floating-point code to fixed-point.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!