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
The following summarises the individual steps that should be executed in order to implement an A/D
conversion process.
• Step 1
Select the required A/D conversion frequency by SACKS2~ SACKS0
• Step 2
Enable the ADC by set ENADC=1
• Step 3
Select which pins will be configure as ADC analog inputs
• Step 4
If input comes from I/O, set SAINS[2:0]=000 and then set SACS bit fields to corresponding PAD
input
If input comes from internal input, set SAINS[2:0] to corresponding internal input source
• Step 5
Select reference voltage comes from external V
REF
, AV
DD
or V
BG
by SAVRS[3:0]
Note: (1) If select V
REF
as reference voltage, (PAS3, PAS2) = (1, 0) for HT66F002/HT66F004
(2) If select V
REF
as reference voltage, (PAS2, PAS1) = (1, 0) for HT66F003
• Step 6
Select ADC output data format by ADRFS
• Step 7
If ADC interrupt is used, the interrupt control registers must be correctly configured to ensure
the A/D interrupt function is active. The master interrupt control bit, EMI, and the A/D converter
interrupt bits, ADE, must both set high in advance.
• Step
8
The A/D convert procedure can now be initialized by set START from low to high and then low
again
• Step
9
If ADC is under conversion, ADBZ=1. After A/D conversion process is completed, the ADBZ
flag will go low, and then output data can be read from
S
ADOH and
S
ADOL registers. If the
ADC interrupt is enabled and the stack is not full, data can be acquired by interrupt service
program. Another way to get the A/D output data is polling the ADBZ flag.