|
|||||||||||
|
Technical Support Support Resources
Product Information |
Technical SupportC51: INITIALIZING THE 320/520 2ND SERIAL PORTInformation in this article applies to:
QUESTIONHow can I set up the second serial port of the Dallas Semiconductor DS87c520? ANSWERUse the following register values for serial Port 1 initialization. SCON1 = 0x50; /* SCON: mode 1, 8-bit UART, enable rcvr */ TMOD |= 0x20; /* TMOD: timer 1, mode 2, 8-bit reload */ WDCON |= 0x80; /* SMOD_1: double baud rate bit */ TH1 = 0x71; /* TH1: 1200 baud @ 33.00MHz */ TR1 = 1; /* TR1: timer 1 run */ TI_1 = 1; /* TI: set TI to send first char of UART */ After adding this code, you must modify the getkey and putchar functions to use the second serial port registers for I/O. SEE ALSOLast Reviewed: Tuesday, June 08, 2004 | ||||||||||
|
|||||||||||