EasyManua.ls Logo

STC micro STC8A8K64D4 Series - UART Communication; UART Function Pin Switch; Registers Related to Uarts

Default Icon
901 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
STC8A8K64D4 Series Manual
- 372 -
14 UART Communication
There are 4 full duplex asynchronous serial communication ports (UART in short) in STC8A8K64D4 series of
microcontrollers. Each UART consists of two data buffers, a shift register, a serial control register and a baud rate generator.
Each UART data buffer consists of two independent receive and transmit buffers, which can transmit and receive data
simultaneously.
There are 4 modes for UART1 of STC8A8K64D4 series of microcontrollers, the baud rates of two modes of them are
variable, and the baud rates of the other two modes are fixed. They can be chosen for different applications. There are only
two modes in UART2, UART3 and UART4, and their baud rates are variable. Different baud rates and different modes can
be set by software. It is flexible for the host to query the receiving or sending process, or use the interrupt method.
All the pins of UART1, UART2, UART3 and UART4 can be switched amoung multiple groups of ports using the
pin switching function, so that a serial port can be multiplexed into severial serial ports in a time-sharing manner.
14.1 UART function pin switch
Symbol
Address
B7
B6
B5
B4
B3
B2
B1
B0
P_SW1
A2H
S1_S[1:0]
CCP_S[1:0]
SPI_S[1:0]
0
-
P_SW2
BAH
EAXFR
-
I2C_S[1:0]
CMPO_S
S4_S
S3_S
S2_S
S1_S[1:0]: UART1 function pin selection bit
S1_S[1:0]
RxD
TxD
00
P3.0
P3.1
01
P3.6
P3.7
10
P1.6
P1.7
11
P4.3
P4.4
S4_S: UART4 function pin selection bit
S4_S
RxD4
TxD4
0
P0.2
P0.3
1
P5.2
P5.3
S3_S: UART3 function pin selection bit
S3_S
RxD3
TxD3
0
P0.0
P0.1
1
P5.0
P5.1
S2_S: UART2 function pin selection bit
S2_S
RxD2
TxD2
0
P1.0
P1.1
1
P4.0
P4.2
14.2 Registers Related to UARTs
Symbol
Description
Address
Bit Address and Symbol
Reset
value
B7
B6
B5
B4
B3
B2
B1
B0
SCON
UART1 control register
98H
SM0/FE
SM1
SM2
REN
TB8
RB8
TI
RI
0000,0000
SBUF
UART1 data buffer register
99H
0000,0000
S2CON
UART2 control register
9AH
S2SM0
-
S2SM2
S2REN
S2TB8
S2RB8
S2TI
S2RI
0100,0000
S2BUF
UART2 data buffer registe
9BH
0000,0000
S3CON
UART3 control register
ACH
S3SM0
S3ST3
S3SM2
S3REN
S3TB8
S3RB8
S3TI
S3RI
0000,0000
S3BUF
UART3 data buffer register
ADH
0000,0000
S4CON
Serial port 4 control register
84H
S4SM0
S4ST4
S4SM2
S4REN
S4TB8
S4RB8
S4TI
S4RI
0000,0000
S4BUF
Serial port 4 data buffer register
85H
0000,0000
PCON
Power control register
87H
SMOD
SMOD0
LVDF
POF
GF1
GF0
PD
IDL
0011,0000
AUXR
Auxiliary register 1
8EH
T0x12
T1x12
UART_M0x6
T2R
T2_C/T
T2x12
EXTRAM
S1ST2
0000,0001
SADDR
UART1 slave address register
A9H
0000,0000
SADEN
UART1 slave address enable
register
B9H
0000,0000

Table of Contents

Related product manuals