Rev. 2.50 176 June 22, 2017 Rev. 2.50 177 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
A/D Input Pins
AlloftheA/Danaloginputpinsarepin-sharedwiththeI/OpinsonPortA,PE6,PF7,PF0orPF1
aswellasotherfunctions.TheACE11~ACE0bitsintheACERHandACERLregisters,determine
whethertheinputpinsaresetupasA/Dconverteranaloginputsorwhethertheyhaveother
functions.IftheACE11~ACE0bitsforitscorrespondingpinissethighthenthepinwillbesetupto
beanA/Dconverterinputandtheoriginalpinfunctionsdisabled.Inthisway,pinscanbechanged
underprogramcontroltochangetheirfunctionbetweenA/Dinputsandotherfunctions.Allpull-
highresistors,whicharesetupthroughregisterprogramming,willbeautomaticallydisconnectedif
thepinsaresetupasA/Dinputs.NotethatitisnotnecessarytorstsetuptheA/Dpinasaninputin
thePAC,PECorPFCportcontrolregistertoenabletheA/DinputaswhentheACE11~ACE0bits
enableanA/Dinput,thestatusoftheportcontrolregisterwillbeoverridden.
TheA/Dconverterhasitsownreferencevoltagepin,VREF,howeverthereferencevoltagecan
alsobesuppliedfromthepowersupplypin,achoicewhichismadethroughtheVREFSbitinthe
ADCR1register.TheanaloginputvaluesmustnotbeallowedtoexceedthevalueofV
REF
.
A/D Input Structure
Summary of A/D Conversion Steps
Thefollowingsummarisestheindividualstepsthatshouldbeexecutedinordertoimplementan
A/Dconversionprocess.
• Step1
SelecttherequiredA/DconversionclockbycorrectlyprogrammingbitsADCK2~ADCK0inthe
ADCR1register.
• Step2
EnabletheA/DbyclearingtheADOFFbitintheADCR0registertozero.
• Step3
SelectwhichchannelistobeconnectedtotheinternalA/Dconverterbycorrectlyprogramming
theACS4~ACS0bitswhicharealsocontainedintheADCR1andADCR0register.
• Step4
SelectwhichpinsaretobeusedasA/Dinputsandcongurethembycorrectlyprogrammingthe
ACE11~ACE0bitsintheACERHandACERLregisters.
• Step5
Iftheinterruptsaretobeused,theinterruptcontrolregistersmustbecorrectlyconfiguredto
ensuretheA/Dconverterinterruptfunctionisactive.Themasterinterruptcontrolbit,EMI,and
theA/Dconverterinterruptbit,ADE,mustbothbesethightodothis.