EasyManua.ls Logo

STC micro STC8A8K64D4 Series - Page 392

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
- 376 -
resets the receiving counter of the baud rate generator immediately, loads 1FFH into the shift register. The received datum is
shifted in from the right of the receiving shift register, the loaded 1FFH is shifted out to the left. When the start bit "0" is
shifted to the far left of the shift register, the RX controller shifts for the last time and completes a frame receiving. The
received datum is valid only if the following two conditions are met:
·RI=0
·SM2=0 or the stop bit received is 1.
The datum received is loaded into SBUF, the stop bit is loaded into RB8, RI flag is set to request interrupt to CPU. If
the two conditions can not be met at the same time, the received data is invalid and is discarded. Regardless of the conditions
are met or not, the receiver will re-test RxD pin of the "1" "0" edge, and continue to receive the next frame. If the received
datum is valid, the RI flag must be cleared by software in the interrupt service routine. Usually, SM2 is set to "0" when serial
port is operating in mode 1.
Write
SBUF
TxD
TI
D0 D1 D2 D3 D4 D5 D6 D7Start Stop
Transmitting data (UART1 mode 1)
Write
SCON
RxD
RI
D0 D1 D2 D3 D4 D5 D6 D7Start Stop
REN=1, RI=0
Receiving data (UART1 mode 1)
The baud rate of UART1 is variable. It can be generated by T1 or T2. If the timer is in 1T mode (12x speed), the
corresponding baud rate is increased by 12 times.
The baud rate of UART1 mode 1 is calculated as follows, where SYSclk is the system operating frequency.
Timer selected
Speed of timer
Baud rate calculation formula
T2
1T
reloadvalueofT2 65536
SYSclk
4 baudrate
12T
reloadvalueoftimer2 65536
SYSclk
12 4 baudrate
T1 mode 0
1T
reloadvalueofT1 65536
SYSclk
4 baudrate
12T
reloadvalueofT1 65536
SYSclk
12 4 baudrate
T1 mode 2
1T
reloadvalueofT1 256
2

SYSclk
32 baudrate
12T
reloadvalueofT1 256
2

SYSclk
12 32 baudrate
The reload value of the timers corresponding to the common frequency and the common baud rate are as following.
Frequency
(MHz)
Baud rate
T2
T1 mode 0
T1 mode 2
1T mode
12T mode
1T mode
12T mode
SMOD=1
1T mode
1T mode
12T mode
1T mode
12T mode
11.0592
115200
FFE8H
FFFEH
FFE8H
FFFEH
FAH
-
FDH
-

Table of Contents

Related product manuals