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.

TMS320F2806: conversion of Lab05c debugger values to real numbers

Part Number: TMS320F2806
Other Parts Discussed in Thread: CONTROLSUITE

Following the steps through the InstaSpin Projects User Manual for Lab05c, there are a few instances where I need to enter 'real' numbers for things like max motor RPM, and a couple of instances where I need to extract 'real' numbers: e.g. to insert inertia estimates back into the user.h file. The user guide seems to thing it's a cut-and-paste thing, but the number formats are very different.

How do you convert _iq24 debugger values back into real numbers for _Aperkrpm values, and how can I convert RPM into _krpm _iq24 values?

cheers,

Mat

  • Chapter 6 of the IQmath_Quickstart.pdf located here: C:\ti\controlSUITE\libs\math\IQmath\v160\doc will show the API used to convert back and forth from float to _IQ format

    The function declarations are shown below

    For float -> IQ:
    _iq _IQ(float F)

    For IQ -> float:
    float _IQtoF(_iq A)

    Sean
  • Thanks Sean. Is there any way to get the debugger to perform this conversion automatically, so that real numbers are shown 'live'?

    Mat

  • Hmm, not sure about setting the debugger settings to perform an automatic conversion. I do know that some variables, for instance Speed_krpm, are shown in "actual" value when in _IQ(24) unit. They show up as "0.0199999" or something like that when cast into the IQ24 value

    Other than that I'm not sure it's possible to perform the calculation in the watch window

    Sean