|
|||||||||||
|
Technical Support Support Resources
Product Information |
C51: 8051 Serial I/O in CInformation in this article applies to:
QUESTIONHow do I write a C program to echo characters coming in the 8051's serial port? ANSWERThe functions _getkey and putchar perform serial I/O using the on-chip serial port. These routines are included in the C51 libraries and source for each is included in the \C51\LIB directory. Refer to your C51 User's Guide for complete documentation on these routines. The following example program sets up the on-chip serial port, sets the baud rate, and waits for a character (using the _getkey function). When a character is received, it is output using the putchar function.
MORE INFORMATION
Last Reviewed: Thursday, February 25, 2021 | ||||||||||
|
|||||||||||
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.