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

string send on serial port

Hi All,,

How can a formatted string be send on the serial port ??

Any help will be great.

Thankzz && Bye
Rocknmoon

Parents
  • "DO i have to use it in the serial ISR or in the main code ??"

    Absolutely do not use printf in any ISR!

    You just use printf as you would in any 'C' program; eg, the classic "Hello, world!"
    printf ends up using putchar - C51 provides a standard, non-interrupt-driven implementation which uses the standard 8051 UART. You may need to customise it to your own requirements; eg, different port, interrupt-driven, etc

    This is documented in the manual, there's an example in the downloads section, and Mark has given you his own implementation!

Reply
  • "DO i have to use it in the serial ISR or in the main code ??"

    Absolutely do not use printf in any ISR!

    You just use printf as you would in any 'C' program; eg, the classic "Hello, world!"
    printf ends up using putchar - C51 provides a standard, non-interrupt-driven implementation which uses the standard 8051 UART. You may need to customise it to your own requirements; eg, different port, interrupt-driven, etc

    This is documented in the manual, there's an example in the downloads section, and Mark has given you his own implementation!

Children
No data