Keil Logo Arm Logo

Technical Support

C51: INITIALIZING THE 320/520 2ND SERIAL PORT


Information in this article applies to:

  • C51 Version 5.50
  • C51 Version 6.00 Beta
  • C51 Version 6.00

QUESTION

How can I set up the second serial port of the Dallas Semiconductor DS87c520?

ANSWER

Use 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 ALSO

Last Reviewed: Tuesday, June 08, 2004


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 

arm-logo-small

Keil logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.