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

sending data to serial port

I am interfacing an led with via serial port. I have set up the serial port already.

I have a display with these specification parameters: baudrate:2400 data:8 bits end code:1bit

I am trying to display the test code which comes in the following format:
"10"+"01H"+"0FFH"

I tried printf but didn't work:
printf("10"+"0x01"+"0x0FF");
Any suggestions??

10x

Parents
  • "I am interfacing an led with via serial port."

    What, exactly, do you mean by that?!

    It sounds like this is not just a single LED, but some display module - is that right?

    You need to give details!

    "I am trying to display the test code which comes in the following format:
    "10"+"01H"+"0FFH"

    What exactly do you mean by that?
    Is that supposed to be a 17-character string consisting of a double-quote followed by a '1' followed by a '0', etc...?
    Or is it supposed to be the 2-character string "10" followed by the 3-character string "01H" followed by the 4-character string "0FFH"?
    Or is it supposed to be three bytes having hex values 10, 01, FF?
    Or what?!

    "I tried printf but didn't work:
    printf("10"+"0x01"+"0x0FF");
    Any suggestions??"

    First, you need to get a 'C' textbook - that printf call will certainly not print what you are hoping for!

    Then take a look at the Keil example for using printf on the 8051:
    http://www.keil.com/support/man/docs/uv3/uv3_ex_hello.htm

Reply
  • "I am interfacing an led with via serial port."

    What, exactly, do you mean by that?!

    It sounds like this is not just a single LED, but some display module - is that right?

    You need to give details!

    "I am trying to display the test code which comes in the following format:
    "10"+"01H"+"0FFH"

    What exactly do you mean by that?
    Is that supposed to be a 17-character string consisting of a double-quote followed by a '1' followed by a '0', etc...?
    Or is it supposed to be the 2-character string "10" followed by the 3-character string "01H" followed by the 4-character string "0FFH"?
    Or is it supposed to be three bytes having hex values 10, 01, FF?
    Or what?!

    "I tried printf but didn't work:
    printf("10"+"0x01"+"0x0FF");
    Any suggestions??"

    First, you need to get a 'C' textbook - that printf call will certainly not print what you are hoping for!

    Then take a look at the Keil example for using printf on the 8051:
    http://www.keil.com/support/man/docs/uv3/uv3_ex_hello.htm

Children