Sign in

username:

password:



Not a member?

Search c54x



Search tips

Subscribe to c54x



c54x by Keywords

5409 | 5416 | AD5 | ADC | BIOS | Boot | Booting | Bootloader | C540 | C5402 | C5409 | C5416 | CCS | Codec | DMA | Dmad | DSK | DSKPlus | Dsplib | EVM | FFT | FIR | Flash | GPIO | HPI | Initialization | Interrupt | JTAG | LOG_printf | MCBSP | RFFT | RTDX | Sampling | STLM | UART | VC540

Ads

Discussion Groups

Discussion Groups | TMS320C54x | Re: How translate a data in Hex-format to float type?

Technical discussions about the TI C54x DSPs (including the c5401, c5402, c5402a, c5404, c5407, c5409, c5409a, c5410, c5410a, c5416, c5420, c5421, c5441, c549, c5470 and c5471).

  

Post a new Thread

How translate a data in Hex-format to float type? - guohua1201 - Jan 18 11:02:00 2005





Hi,everyone.
I've met a problem when I try to send floating-point number to PC
through RS232.
for example,I defined float x=0.5;and x is 0x3f000000 in the
memory,so I transfered 0x3f000000 to PC.
and now the question is how can I get the correct float value from
0x3ff000000 on PC?

any answer would be great appretiated.




(You need to be a member of c54x -- send a blank email to c54x-subscribe@yahoogroups.com )

Re: How translate a data in Hex-format to float type? - Dileepan C - Jan 19 2:10:00 2005

hi,

You can refer section 6.5 of the document spru173 for
detials of IEEE floating point format.

when transmitting to PC using the RS232, you need to
write to the UART registers. normally, these registers
are 8 bit registers. So you can write 0x3f,
0x00,0x00,0x00 to the uart data transmit registers for
transmitting.

The receiver or COM port will receive these 4
bytes.Now the receiving side application need to pack
the data to the original float representation.

regards,
Dileepan.

--- guohua1201 <> wrote: >
>
> Hi,everyone.
> I've met a problem when I try to send
> floating-point number to PC
> through RS232.
> for example,I defined float x=0.5;and x is
> 0x3f000000 in the
> memory,so I transfered 0x3f000000 to PC.
> and now the question is how can I get the correct
> float value from
> 0x3ff000000 on PC?
>
> any answer would be great appretiated.

__________________________________________________
">http://mail.yahoo.com





(You need to be a member of c54x -- send a blank email to c54x-subscribe@yahoogroups.com )