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

problem with puthcar()

I am using puthcar( ) function to send a series of bytes serially thru UART. My problem is that i cannot see the output through serial window of simulator . its printing just some junk values. when i am doing the same with printf(). I am getting response which could be observed from serial window.Can any one tell me why this is happening.

Nitin

Parents
  • "eg, if the value is 0xA5, it will print 'A5'"

    To be precise, since you specified the format string "[%x]", it will actually print "[a5]"

    "Whats the reason and how can it be corrected"

    You need to review your 'C' course notes/textbook/whatever and understand the difference between formatted output using printf, and direct output using putchar.

Reply
  • "eg, if the value is 0xA5, it will print 'A5'"

    To be precise, since you specified the format string "[%x]", it will actually print "[a5]"

    "Whats the reason and how can it be corrected"

    You need to review your 'C' course notes/textbook/whatever and understand the difference between formatted output using printf, and direct output using putchar.

Children