STC12C5Axx
Technical Summary
39
Bit[
i
]
of
Compared Byte =
(
SADEN[ i ] == 1
)?
SADDR
[
i
]
: x
RI
= (SM2 ==
1
) && (SBUF ==
Compared Byte
) && (RB8 ==
1
)
SFR:
SBUF
(Serial Buffer)
Read/Write
Address:
0x99H
Default:
00
00-0000
Bit
7
6
5
4
3
2
1
0
Name
Frame Error Detection
When used for frame error detect, the UART looks for missing stop bits in the communication.
A missing bit will set the FE bit in the SCON register. The FE bit shares the SCON.7 bit with
SM0 and the function of SCON.7 is determined by PCON.6 (SMOD0). If SMOD0 is set then
SCON.7 functions as FE. SCON.7 functions as SM0 when SMOD0 is cleared. When used as
FE, SCON.7 can only be cleared by software.
Automatic Address Recognition
There is an extra feature makes the device convenient to act as a master, which
communicates to multiple slaves simultaneously. It is really
Automatic Address Recognition
.
There are two SFR
SADDR
and
SADEN
implemented in the device. The user can read or
write both of them. Finally, the hardware will make use of these two SFR to “generate” a
“compared byte”. The formula specifies as following.
For example:
Set
SADDR
= 11000000b
Set
SADEN
= 11111101b
Ö
The achieved “Compared Byte” will be “110000x0” (
x
means don’t care)
For another example:
Set
SADDR
= 11100000b
Set
SADEN
= 11111010b
Ö
The achieved “Compared Byte” will be “11100x0x”
After the generic “Compared Byte” has been worked out, the STC12Cxx will make use of this
byte to determine how to set the bit
RI
in SFR
SCON
.
Normally, an UART will set bit
RI
whenever it has done a byte reception; but for the UART in
the STC12Cxx, if the bit
SM2
is set, it will set
RI
according to the following formula.
In other words, not all data reception will respond to RI, while specific data does.
By setting the SADDR and the SADEN, the user can filter out those data byte that he doesn’t
like to care. This feature brings great help to reduce software overhead.
The above feature adapts to the serial port when operated in Mode1, Mode2, and Mode3.
Dealing with Mode 0, the user can ignore it.
http://www.DataSheet4U.net/
datasheet pdf - http://www.DataSheet4U.net/