Rev. 1.50 164 August 28, 2017 Rev. 1.50 165 August 28, 2017
HT66F0175/HT66F0185
A/D Flash MCU with EEPROM
HT66F0175/HT66F0185
A/D Flash MCU with EEPROM
Thefollowingdiagramshowsthetransmitandreceivewaveformsforboth8-bitand9-bitdata
formats.
UART Transmitter
Datawordlengthsofeither8or9bitscanbeselectedbyprogrammingtheBNObitintheUCR1
register.WhenBNObitisset,thewordlengthwillbesetto9bits.Inthiscasethe9
th
bit,which
istheMSB,needstobestoredintheTX8bitintheUCR1register.Atthetransmittercoreliesthe
TransmitterShiftRegister,morecommonlyknownastheTSR,whosedataisobtainedfromthe
transmitdataregister,whichisknownastheTXRregister.Thedatatobetransmittedisloaded
intothisTXRregisterbytheapplicationprogram.TheTSRregisterisnotwrittentowithnewdata
untilthestopbitfromtheprevioustransmissionhasbeensentout.Assoonasthisstopbithasbeen
transmitted,theTSRcanthenbeloadedwithnewdatafromtheTXRregister,ifitisavailable.It
shouldbenotedthattheTSRregister,unlikemanyotherregisters,isnotdirectlymappedintothe
DataMemoryareaandassuchisnotavailabletotheapplicationprogramfordirectread/write
operations.AnactualtransmissionofdatawillnormallybeenabledwhentheTXENbitisset,but
thedatawillnotbetransmitteduntiltheTXRregisterhasbeenloadedwithdataandthebaudrate
generatorhasdenedashiftclocksource.However,thetransmissioncanalsobeinitiatedbyrst
loadingdataintotheTXRregister,afterwhichtheTXENbitcanbeset.Whenatransmissionof
databegins,theTSRisnormallyempty,inwhichcaseatransfertotheTXRregisterwillresultin
animmediatetransfertotheTSR.IfduringatransmissiontheTXENbitiscleared,thetransmission
willimmediatelyceaseandthetransmitterwillbereset.TheTXoutputpinwillthenreturntotheI/
Oorotherpin-sharedfunction.
Transmitting Data
WhentheUARTistransmittingdata,thedataisshiftedontheTXpinfromtheshiftregister,with
theleastsignicantbitLSBrst.Inthetransmitmode,theTXRregisterformsabufferbetweenthe
internalbusandthetransmittershiftregister.Itshouldbenotedthatif9-bitdataformathasbeen
selected,thentheMSBwillbetakenfromtheTX8bitintheUCR1register.Thestepstoinitiatea
datatransfercanbesummarizedasfollows:
• MakethecorrectselectionoftheBNO,PRT,PRENandSTOPSbitstodenetherequiredword
length,paritytypeandnumberofstopbits.
• SetuptheBRGregistertoselectthedesiredbaudrate.
• SettheTXENbittoensurethattheUARTtransmitterisenabledandtheTXpinisusedasa
UARTtransmitterpin.
• AccesstheUSRregisterandwritethedatathatistobetransmittedintotheTXRregister.Note
thatthisstepwillcleartheTXIFbit.