i~.
87C51GBHARDWARE DESCRIPTION
Table17.SCON:SerialPortControlRegister
SCON Address= 98H
ResetValue= 0000OOOOB
BitAddreeseble
SMO/FE
SM1
SM2
REN ~8
RB8
TI RI
Bit: 5
4
3 2
1 0
(sM:m=o/L
Symbol Function
FE
FramingErrorbit.Thisbitissetbythereceiverwhenaninvalidstopbitisdetected.me FE
bitisnotclearedbyvalidframesbutshouldbeclearedbysoftware.TheSMODO*bitmust
besettoenableaccesstotheFEbit.
SMO
SerialPortModeBitO,(SMODOmust= OtoaccessSMO)
SM1 SerialPortModeBit1
SMO SM1 Mode Description
BaudRate”’
000 shift
register
Fac/12
01
1
8-bitUART
variable
10
0 9-bitUART Fo5c/64orFo~/32
1
1 3 9-bitUART
variable
SM2 EnablestheAutomaticAddressRecognitionfeatureinModes2or3.IfSM2= 1thenRI
willnotbesetunlessthereceivedbyteisaGivenorBroadcastAddress.InMode1,
ifSM2= 1thenRIwillnotbeactivatedunlessavalidstopbitwasreceived,andthe
receivedbyteisa GivenorBroadcastAddress.InModeO,SM2shouldbeO.
REN Enablesserialreception.Setbysoftwaretoenablereception.Clearadbysoftwareto
disablereception.
TB8 The9thdatabitthatwillbetransmittedinModes2 and 3. Set
or clear by software as
desired.
RB8 In modes 2 and 3, the 9th data bit that was
recetied.InMode1ifSM2=0, RB8isthestop
bitthatwasreceived.InModeO,RB8isnotused.
TI
Transmitinterruptflag.Setbyherdwereattheendofthe8thbittimeinModeO,oratthe
beginningofthestopbitintheothermodes,inanyserialtransmission.Mustbeclearedby
software.
RI Receiveinterruptflag.Setbyhardwareattheendofthe8thbittimeinModeOorhalfway
throughthestopbittimeintheothermodes,inanyserialreoeption(exceptseeSM2).
Mustbeclearedbysoftwere.
NOTE
●SMOOOis
locatedat PCON6.
●*Foec = oaclllatorfrequeney
Tbeaerialporteanoperatein4mcdes:
In all four modes,transmissionis initiated bv snv in-
ModeO:ShitlRegister,freedfrequency
Mode
1: 8-BitUART,variablefreqsseney
Mode2: 9-BitUART,fixed
ffequency
structionthat * SBUFasa deatinstionregker~Re-
ceptionisinitiatedin
ModeObytbe conditionRI = O
smd RBN = 1. Reception is initiated in the other
modesby the incomingstart bit if REN = 1.
Mode3: 9-BitUART, variablefrequeney
Mode O:Serial data enters and exits through RXD.
The baud rate in some modesis fixedand in others is
TXDoutputsthe shiftclock.8bitaare transmitted/re-
generatedbyTimer 1or Timer 2.
eeived:8data bits (L3Bfirst).Tbebaud rate is fixedat
1/12the oscillatorfrequency.
6-34