Rev. 1.71 104 April 11, 2017 Rev. 1.71 105 April 11, 2017
HT66F002/HT66F0025/HT66F003/HT66F004
Cost-Effective A/D Flash MCU with EEPROM
HT66F002/HT66F0025/HT66F003/HT66F004
Cost-Effective A/D Flash MCU with EEPROM
Summary of A/D Conversion Steps
ThefollowingsummarisestheindividualstepsthatshouldbeexecutedinordertoimplementanA/D
conversionprocess.
• Step1
SelecttherequiredA/DconversionfrequencybySACKS2~SACKS0
•
Step2
EnabletheADCbysetENADC=1
• Step3
SelectwhichpinswillbecongureasADCanaloginputs
• Step4
IfinputcomesfromI/O,setSAINS[2:0]=000andthensetSACSbiteldstocorrespondingPAD
input
Ifinputcomesfrominternalinput,setSAINS[2:0]tocorrespondinginternalinputsource
• Step5
SelectreferencevoltagecomesfromexternalV
REF
, AV
DD
orV
BG
bySAVRS[3:0]
Note:(1)IfselectV
REF
asreferencevoltage,(PAS3,PAS2)=(1,0)forHT66F002/HT66F004
(2)IfselectV
REF
asreferencevoltage,(PAS2,PAS1)=(1,0)forHT66F003
• Step6
SelectADCoutputdataformatbyADRFS
• Step7
IfADCinterruptisused,theinterruptcontrolregistersmustbecorrectlyconguredtoensure
theA/Dinterruptfunctionisactive.Themasterinterruptcontrolbit,EMI,andtheA/Dconverter
interruptbits,ADE,mustbothsethighinadvance.
• Step8
TheA/DconvertprocedurecannowbeinitializedbysetSTARTfromlowtohighandthenlow
again
•
Step9
IfADCisunderconversion,ADBZ=1.AfterA/Dconversionprocessiscompleted,theADBZ
agwillgolow,andthenoutputdatacanbereadfromSADOHandSADOLregisters.Ifthe
ADCinterruptisenabledandthestackisnotfull,datacanbeacquiredbyinterruptservice
program.AnotherwaytogettheA/DoutputdataispollingtheADBZag.