Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Help:How to save floating point variables in CodeCompStudio

Status
Not open for further replies.

vinod_261

Newbie level 1
Joined
Jun 13, 2006
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,309
Hello friends,

Ref: Code composer studio 3.1 for C6416.

I wish to know how to save floating point variables
in floating format to a file using 'File->Data->Save'
option in CCS.
(I know how to save the integers and read it through Matlab).


For example the value 215.3560 must come in the file as
215.3560 only. Not as a Hexadecimal number.
Is there any provision for this in CCS.

Or

I wish to know the exact formatting of floating point numbers
so that I can read it by matlab.

Can anybody help me on this regard.

Regards,
Vinod
 

Re: Help:How to save floating point variables in CodeCompStu

The floating point implementation is in compliance with IEEE 754 standard, hence

sign exponent mantissa
32-bits 1 8 23
64-bits 1 11 52

More info if you browse in the Contents of CCS on line help searching for
"floating-point fields".
To save it in a file you could use the printf C function, but if you run on the target I presume that this would excessively slow down the execution of your program, thus violating the real time constraints (if any).
More effective solution could be use of the DSP-BIOS Log objects in conjunction with a CCS IDE Log window set to save the displayed log results in a text file. Be sure that each time you call the Log_printf( ) API function to print a Float value only 1 placeholder %f is placed in the input string (e.g Log_printf( "My float value is %f", floatValue ) ): I observed corruption of the displayed values when trying to print other variables in presence of the placeholder for float format.

Regards
Mowgli
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top