Rev. 1.50 166 August 28, 2017 Rev. 1.50 167 August 28, 2017
HT66F0175/HT66F0185
A/D Flash MCU with EEPROM
HT66F0175/HT66F0185
A/D Flash MCU with EEPROM
Receiver Interrupt
Thereadonlyreceiveinterruptag,RXIF,intheUSRregisterissetbyanedgegeneratedbythe
receiver.AninterruptisgeneratedifRIE=1,whenawordistransferredfromtheReceiveShift
Register,RSR,totheReceiveDataRegister,RXR.Anoverrunerrorcanalsogenerateaninterruptif
RIE=1.
Managing Receiver Errors
SeveraltypesofreceptionerrorscanoccurwithintheUARTmodule,thefollowingsectiondescribes
thevarioustypesandhowtheyaremanagedbytheUART.
Overrun Error – OERR
TheRXRregisteriscomposedofatwobytedeepFIFOdatabuffer,wheretwobytescanbeheldin
theFIFOregister,whilea3
th
bytecancontinuetobereceived.Beforethe3
th
bytehasbeenentirely
shiftedin,thedatashouldbereadfromtheRXRregister.Ifthisisnotdone,theoverrunerrorag
OERRwillbeconsequentlyindicated.
Intheeventofanoverrunerroroccurring,thefollowingwillhappen:
• TheOERRagintheUSRregisterwillbeset.
• TheRXRcontentswillnotbelost.
• Theshiftregisterwillbeoverwritten.
• AninterruptwillbegeneratediftheRIEbitisset.
TheOERRflagcanbeclearedbyanaccesstotheUSRregisterfollowedbyareadtotheRXR
register.
Noise Error – NF
Over-samplingisusedfordatarecoverytoidentifyvalidincomingdataandnoise.Ifnoiseis
detectedwithinaframe,thefollowingwilloccur:
• Thereadonlynoiseag,NF,intheUSRregisterwillbesetontherisingedgeoftheRXIFbit.
• DatawillbetransferredfromtheshiftregistertotheRXRregister.
• Nointerruptwillbegenerated.HoweverthisbitrisesatthesametimeastheRXIFbitwhich
itselfgeneratesaninterrupt.
NotethattheNFagisresetbyaUSRregisterreadoperationfollowedbyanRXRregisterread
operation.
Framing Error – FERR
Thereadonlyframingerrorag,FERR,intheUSRregister,issetifazeroisdetectedinsteadof
stopbits.Iftwostopbitsareselected,bothstopbitsmustbehigh.OtherwisetheFERRagwillbe
set.TheFERRagisbufferedalongwiththereceiveddataandisclearedinanyreset.
Parity Error – PERR
Thereadonlyparityerrorag,PERR,intheUSRregister,issetiftheparityofthereceivedword
isincorrect.Thiserroragisonlyapplicableiftheparityfunctionisenabled,PREN=1,andifthe
paritytype,oddoreven,isselected.ThereadonlyPERRagisbufferedalongwiththereceived
databytes.Itisclearedonanyreset,itshouldbenotedthattheFERRandPERRagsarebuffered
alongwiththecorrespondingwordandshouldbereadbeforereadingthedataword.