Rev. 2.50 252 June 22, 2017 Rev. 2.50 253 June 22, 2017
HT66F20/HT66F30/HT66F40/HT66F50/HT66F60
HT66FU30/HT66FU40/HT66FU50/HT66FU60
A/D Flash MCU with EEPROM
HT66F20/HT66F30/HT66F40/HT66F50/HT66F60
HT66FU30/HT66FU40/HT66FU50/HT66FU60
A/D Flash MCU with EEPROM
• UARTreceiver
TheUARTiscapableofreceivingwordlengthsofeither8or9bitscanbeselectedby
programmingtheBNObitintheUCR1register.WhenBNObitisset,thewordlengthwillbe
setto9bits.Inthiscasethe9thbit,whichistheMSB,willbestoredintheRX8bitintheUCR1
register.AtthereceivercoreliestheReceiverShiftRegistermorecommonlyknownastheRSR.
ThedatawhichisreceivedontheRXexternalinputpinissenttothedatarecoveryblock.The
datarecoveryblockoperatingspeedis16timesthatofthebaudrate,whilethemainreceive
serialshifteroperatesatthebaudrate.AftertheRXpinissampledforthestopbit,thereceived
datainRSRistransferredtothereceivedataregister,iftheregisterisempty.Thedatawhich
isreceivedontheexternalRXinputpinissampledthreetimesbyamajoritydetectcircuitto
determinethelogiclevelthathasbeenplacedontotheRXpin.ItshouldbenotedthattheRSR
register,unlikemanyotherregisters,isnotdirectlymappedintotheDataMemoryareaandas
suchisnotavailabletotheapplicationprogramfordirectread/writeoperations.
• Receivingdata
WhentheUARTreceiverisreceivingdata,thedataisseriallyshiftedinontheexternalRXinput
pintotheshiftregister,withtheleastsignicantbitLSBrst.TheRXRregisterisafourbyte
deepFIFOdatabuffer,wherefourbytescanbeheldintheFIFOwhilethe5thbytecancontinue
tobereceived.NotethattheapplicationprogrammustensurethatthedataisreadfromRXR
beforethe5thbytehasbeencompletelyshiftedin,otherwisethe5thbytewillbediscardedand
anoverrunerrorOERRwillbesubsequentlyindicated.Thestepstoinitiateadatatransfercanbe
summarizedasfollows:
♦
MakethecorrectselectionoftheBNO,PRT,PRENandSTOPSbitstodenetherequired
wordlength,paritytypeandnumberofstopbits.
♦
SetuptheBRGregistertoselectthedesiredbaudrate.
♦
SettheRXENbittoensurethattheUARTreceiverisenabledandtheRXpinisusedasa
UARTreceiverpin.
Atthispointthereceiverwillbeenabledwhichwillbegintolookforastartbit.
Whenacharacterisreceived,thefollowingsequenceofeventswilloccur:
♦
TheRXIFbitintheUSRregisterwillbesetthenRXRregisterhasdataavailable,atleastthree
morecharactercanberead.
♦
WhenthecontentsoftheshiftregisterhavebeentransferredtotheRXRregisterandiftheRIE
bitisset,thenaninterruptwillbegenerated.
♦
Ifduringreception,aframeerror,noiseerror,parityerrororanoverrunerrorhasbeendetected,
thentheerroragscanbeset.
TheRXIFbitcanbeclearedusingthefollowingsoftwaresequence:
1.AUSRregisteraccess
2.ARXRregisterreadexecution