Rev. 2.50 250 June 22, 2017 Rev. 2.50 251 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
• Data,parityandstopbitselection
Theformatofthedatatobetransferrediscomposedofvariousfactorssuchasdatabitlength,
parityon/off,paritytype,addressbitsandthenumberofstopbits.Thesefactorsaredetermined
bythesetupofvariousbitswithintheUCR1register.TheBNObitcontrolsthenumberofdata
bitswhichcanbesettoeither8or9.ThePRTbitcontrolsthechoiceifoddorevenparity.The
PRENbitcontrolstheparityon/offfunction.TheSTOPSbitdecideswhetheroneortwostop
bitsaretobeused.Thefollowingtableshowsvariousformatsfordatatransmission.Theaddress
detectmodecontrolbitidentifiestheframeasanaddresscharacter.Thenumberofstopbits,
whichcanbeeitheroneortwo,isindependentofthedatalength.
Start Bit Data Bits Address Bits Parity Bits Stop Bit
Example of 8-bit Data Formats
1 8 0 0 1
1 7 0 1 1
1 7 1 0 1
Example of 9-bit Data Formats
1 9 0 0 1
1 8 0 1 1
1 8 1 0 1
Transmitter Receiver Data Format
Thefollowingdiagramshowsthetransmitandreceivewaveformsforboth8-bitand9-bitdata
formats.
• UARTtransmitter
Datawordlengthsofeither8or9bitscanbeselectedbyprogrammingtheBNObitintheUCR1
register.WhenBNObitisset,thewordlengthwillbesetto9bits.Inthiscasethe9thbit,which
istheMSB,needstobestoredintheTX8bitintheUCR1register.Atthetransmittercorelies
theTransmitterShiftRegister,morecommonlyknownastheTSR,whosedataisobtainedfrom
thetransmitdataregister,whichisknownastheTXRregister.Thedatatobetransmittedis
loadedintothisTXRregisterbytheapplicationprogram.TheTSRregisterisnotwrittentowith
newdatauntilthestopbitfromtheprevioustransmissionhasbeensentout.Assoonasthisstop
bithasbeentransmitted,theTSRcanthenbeloadedwithnewdatafromtheTXRregister,ifit
isavailable.ItshouldbenotedthattheTSRregister,unlikemanyotherregisters,isnotdirectly
mappedintotheDataMemoryareaandassuchisnotavailabletotheapplicationprogramfor
directread/writeoperations.Anactualtransmissionofdatawillnormallybeenabledwhenthe
TXENbitisset,butthedatawillnotbetransmitteduntiltheTXRregisterhasbeenloadedwith
dataandthebaudrategeneratorhasdenedashiftclocksource.However,thetransmissioncan
alsobeinitiatedbyrstloadingdataintotheTXRregister,afterwhichtheTXENbitcanbeset.
Whenatransmissionofdatabegins,theTSRisnormallyempty,inwhichcaseatransfertothe
TXRregisterwillresultinanimmediatetransfertotheTSR.IfduringatransmissiontheTXEN
bitiscleared,thetransmissionwillimmediatelyceaseandthetransmitterwillbereset.TheTX
outputpinwillthenreturntothehighimpedancestate.