STC12C5Axx
Technical Summary
41
Mode3
Mode 3 is the same as mode 2 except the baud rate is variable.
The user can redirect functional pins
RXD2
and
RXD2
from pins P1.2 and P1.3 to pins P4.2 and P4.3 by
setting bit
S2P4
in SFR
AUXR1
.
There are several special function registers which should be understood by users before using the
secondary UART.
SFR:
S2CON
Read/Write
Address:
0x9AH
Default:
0000-0000
Bit
7
6
5
4
3
2
1
0
Name
S2SM0 S2SM1 S2SM2
S2REN
S2TB8
S2RB8
S2TI S2RI
{ S2SM0
,
S2SM1 }
:= Used to set operating mode of the serial port.
{ 0, 0 }
:= set the serial port operate under Mode 0(8-bit shift register)
{ 0, 1 }
:= set the serial port operate under Mode 1(8-bit UART)
{ 1, 0 }
:= set the serial port operate under Mode 2(9-bit UART)
{ 1, 1 }
:= set the serial port operate under Mode 3(9-bit UART)
S2SM2
:= Enable the
automatic address recognition
feature in mode 2 and 3.
If
SM2
=
1
,
RI
will not be set unless the received 9th data bit is 1, indicating an address, and
the received byte is a Given or Broadcast address. In mode1, if SM2=1 then RI will not be
set unless a valid stop Bit was received, and the received byte is a Given or Broadcast
address.
S2REN
:= Enable the serial port reception.
0
:= (default)
Disable the secondary serial port reception.
1
:=
Enable the secondary serial port reception.
S2TB8
:=
The 9th data bit, which will be transmitted in Mode 2 and Mode 3.
Baud Rate (
for
Mode 3)
=
2
S2SMOD
32
X
(BRT timer overflow rate)
http://www.DataSheet4U.net/
datasheet pdf - http://www.DataSheet4U.net/