ARM Technical Support Knowledge Articles

INITIALIZING THE 320/520 2ND SERIAL PORT

Applies to: C51 C Compiler

Answer


Information in this article applies to:


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

Article last edited on: 2004-06-08 11:18:42

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential