This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to transmit binary data and floating point data result to RS232 serial com

Hi all ,

I would like to know the method of transmitting 16bit binary data (from 8255 port A & B) and floating point ouput result using serial comm(rs232) from 8051 to pc. i know we can use printf method. But if i want to use SBUF method, should i convert the binary data or the floating point calculated result using sprintf method and transmit the buf (from sprintf) to SBUF.

your help is much appreciated.

thanks

Parents
  • Depends on what the receiver expects. Do you need to convert the numbers to human-readable ASCII (via sprintf), or does it suffice simply to send the bytes themselves? Avoiding the conversion to ASCII will be faster and probably result in fewer bytes sent. Converting to ASCII will be easier to debug, since you can plug in any ordinary terminal program and see what comes out.

Reply
  • Depends on what the receiver expects. Do you need to convert the numbers to human-readable ASCII (via sprintf), or does it suffice simply to send the bytes themselves? Avoiding the conversion to ASCII will be faster and probably result in fewer bytes sent. Converting to ASCII will be easier to debug, since you can plug in any ordinary terminal program and see what comes out.

Children