Rev. 1.20 128 January 23, 2015 Rev. 1.20 129 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
Receive Break
AnybreakcharacterreceivedbytheUARTwillbemanagedasaframingerror.Thereceiverwill
countandexpectacertainnumberofbittimesasspeciedbythevaluesprogrammedintotheBNO
andoneSTOPSbit.Ifthebreakismuchlongerthan13bittimes,thereceptionwillbeconsidered
ascompleteafterthenumberofbittimesspeciedbyBNOandoneSTOPbit.TheRXIFbitisset,
FERRisset,zerosareloadedintothereceivedataregister,interruptsaregeneratedifappropriate
andtheRIDLEbitisset.Ifalongbreaksignalhasbeendetectedandthereceiverhasreceiveda
startbit,thedatabitsandtheinvalidstopbit,whichsetstheFERRag,thereceivermustwaitfora
validstopbitbeforelookingforthenextstartbit.Thereceiverwillnotmaketheassumptionthatthe
breakconditiononthelineisthenextstartbit.Abreakisregardedasacharacterthatcontainsonly
zeroswiththeFERRagset.Thebreakcharacterwillbeloadedintothebufferandnofurtherdata
willbereceiveduntilstopbitsarereceived.ItshouldbenotedthattheRIDLEreadonlyagwillgo
highwhenthestopbitshavenotyetbeenreceived.ThereceptionofabreakcharacterontheUART
registerswillresultinthefollowing:
• Theframingerrorag,FERR,willbeset.
• Thereceivedataregister,RXR,willbecleared.
• TheOERR,NF,PERR,RIDLEorRXIFagswillpossiblybeset.
Idle Status
Whenthereceiverisreadingdata,whichmeansitwillbeinbetweenthedetectionofastartbitand
thereadingofastopbit,thereceiverstatusagintheUSRregister,otherwiseknownastheRIDLE
ag,willhaveazerovalue.Inbetweenthereceptionofastopbitandthedetectionofthenextstart
bit,theRIDLEagwillhaveahighvalue,whichindicatesthereceiverisinanidlecondition.
Receiver Interrupt
ThereadonlyreceiveinterruptagRXIFintheUSRregisterissetbyanedgegeneratedbythe
receiver.AninterruptisgeneratedifRIEbitis"1",whenawordistransferredfromtheReceive
ShiftRegister,RSR,totheReceiveDataRegister,RXR.Anoverrunerrorcanalsogeneratean
interruptifRIEis"1".
Managing Receiver Errors
SeveraltypesofreceptionerrorscanoccurwithintheUARTmodule,thefollowingsectiondescribes
thevarioustypesandhowtheyaremanagedbytheUART.
Overrun Error – OERR ag
TheRXRregisteriscomposedofatwobytedeepFIFOdatabuffer,wheretwobytescanbeheld
intheFIFOregister,whileathirdbytecancontinuetobereceived.Beforethisthirdbytehasbeen
entirelyshiftedin,thedatashouldbereadfromtheRXRregister.Ifthisisnotdone,theoverrun
erroragOERRwillbeconsequentlyindicated.
Intheeventofanoverrunerroroccurring,thefollowingwillhappen:
• TheOERRagintheUSRregisterwillbeset.
• TheRXRcontentswillnotbelost.
• Theshiftregisterwillbeoverwritten.
• AninterruptwillbegeneratediftheRIEbitisset.
TheOERRflagcanbeclearedbyanaccesstotheUSRregisterfollowedbyareadtotheRXR
register.