User`s guide
Rev. 1.10 88 November 14, 2014 Rev. 1.10 89 November 14, 2014
HT66FW2230
Wireless Charger A/D Flash 8-Bit MCU
Summary of A/D Conversion Steps
ThefollowingsummarisestheindividualstepsthatshouldbeexecutedinordertoimplementanA/
Dconversionprocess.
• Step1
SelecttherequiredA/DconversionclockbycorrectlyprogrammingbitsADCK2~ADCK0inthe
ADCR1register.
• Step2
EnabletheA/DbyclearingtheADOFFbitintheADCR0registertozero.
• Step3
SelectwhichchannelistobeconnectedtotheinternalA/Dconverterbycorrectlyprogramming
theACS4~ACS0bitswhicharealsocontainedintheADCR0register.
• Step4
SelectwhichpinsaretobeusedasA/Dinputsandcongurethembycorrectlyprogrammingthe
PAS07~PAS00bitsinthePAS0registerandthePAS17~PAS10bitsinthePAS1register.(AN1does
notneedtobeselectedasA/Dinput,becauseitisonlypinwithOCPandthesetwopinsareboth
asinputpins)
• Step5
Iftheinterruptsaretobeused,theinterruptcontrolregistersmustbecorrectlyconfiguredto
ensuretheA/Dconverterinterruptfunctionisactive.Themasterinterruptcontrolbit,EMI,and
theA/Dconverterinterruptbit,ADE,mustbothbesethightodothis.
• Step6
TheanalogtodigitalconversionprocesscannowbeinitialisedbysettingtheSTARTbitin
theADCR0registerfromlowtohighandthenlowagain.Notethatthisbitshouldhavebeen
originallyclearedtozero.
• Step7
Tocheckwhentheanalogtodigitalconversionprocessiscomplete,theEOCBbitintheADCR0
registercanbepolled.Theconversionprocessiscompletewhenthisbitgoeslow.Whenthis
occurstheA/DdataregistersADRLandADRHcanbereadtoobtaintheconversionvalue.Asan
alternativemethod,iftheinterruptsareenabledandthestackisnotfull,theprogramcanwaitfor
anA/Dinterrupttooccur.
Note:Whencheckingfortheendoftheconversionprocess,ifthemethodofpollingtheEOCBbit
intheADCR0registerisused,theinterruptenablestepabovecanbeomitted.
Theaccompanyingdiagramshowsgraphicallythevariousstagesinvolvedinananalogtodigital
conversionprocessanditsassociatedtiming.AfteranA/Dconversionprocesshasbeeninitiated
bytheapplicationprogram,themicrocontrollerinternalhardwarewillbegintocarryoutthe
conversion,duringwhichtimetheprogramcancontinuewithotherfunctions.Thetimetakenforthe
A/Dconversionis16t
ADCK
wheret
ADCK
isequaltotheA/Dclockperiod.