Rev. 1.20 118 January 23, 2015 Rev. 1.20 119 January 23, 2015
BS82B12A-3/BS82C16A-3/BS82D20A-3
Touch Key 8-Bit Flash MCU with LED/LCD Driver
BS82B12A-3/BS82C16A-3/BS82D20A-3
Touch Key 8-Bit Flash MCU with LED/LCD Driver
USR register
TheUSRregisteristhestatusregisterfortheUART,whichcanbereadbytheprogramtodetermine
thepresentstatusoftheUART.AllagswithintheUSRregisterarereadonly.Furtherexplanation
oneachoftheagsisgivenbelow.
Bit 7 6 5 4 3 2 1 0
Name PERR NF FERR OERR RIDLE RXIF TIDLE TXIF
R/W R R R R R R R R
POR 0 0 0 0 1 0 1 1
Bit7 PERR:Parityerrorag
0:Noparityerrorisdetected
1:Parityerrorisdetected
ThePERRagistheparityerrorag.Whenthisreadonlyagis"0",itindicatesa
parityerrorhasnotbeendetected.Whentheagis"1",itindicatesthattheparityof
thereceivedwordisincorrect.ThiserroragisapplicableonlyifParitymode(oddor
even)isselected.Theagcanalsobeclearedbyasoftwaresequencewhichinvolves
areadtothestatusregisterUSRfollowedbyanaccesstotheRXRdataregister.
Bit6 NF:Noiseag
0:Nonoiseisdetected
1:Noiseisdetected
TheNFflagisthenoiseflag.Whenthisreadonlyflagis"0",itindicatesnonoise
condition.Whentheagis"1",itindicatesthattheUARThasdetectednoiseonthe
receiverinput.TheNFagissetduringthesamecycleastheRXIFagbutwillnot
besetinthecaseofasoverrun.TheNFagcanbeclearedbyasoftwaresequence
whichwillinvolveareadtothestatusregisterUSRfollowedbyanaccesstotheRXR
dataregister.
Bit5 FERR:Framingerrorag
0:Noframingerrorisdetected
1:Framingerrorisdetected
TheFERRagistheframingerrorag.Whenthisreadonlyagis"0",itindicates
thatthereisnoframingerror.Whentheagis"1",itindicatesthataframingerror
hasbeendetectedforthecurrentcharacter.Theagcanalsobeclearedbyasoftware
sequencewhichwillinvolveareadtothestatusregisterUSRfollowedbyanaccessto
theRXRdataregister.
Bit4 OERR:Overrunerrorag
0:Nooverrunerrorisdetected
1:Overrunerrorisdetected
TheOERRagistheoverrunerroragwhichindicateswhenthereceiverbufferhas
overowed.Whenthisreadonlyagis"0",itindicatesthatthereisnooverrunerror.
Whentheagis"1",itindicatesthatanoverrunerroroccurswhichwillinhibitfurther
transferstotheRXRreceivedataregister.Theagisclearedbyasoftwaresequence,
whichisareadtothestatusregisterUSRfollowedbyanaccesstotheRXRdata
register.
Bit3 RIDLE:Receiverstatus
0:Datareceptionisinprogress(databeingreceived)
1:Nodatareceptionisinprogress(receiverisidle)
TheRIDLEagisthereceiverstatusag.Whenthisreadonlyagis"0",itindicates
thatthereceiverisbetweentheinitialdetectionofthestartbitandthecompletionof
thestopbit.Whentheagis"1",itindicatesthatthereceiverisidle.Betweenthe
completionofthestopbitandthedetectionofthenextstartbit,theRIDLEbitis"1"
indicatingthattheUARTreceiverisidleandtheRXpinstaysinlogichighcondition.