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).
|
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. |
|
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 |