HT66F016/HT66F017/HT68F016/HT68F017
HT66F016R/HT66F017R/HT68F016R/HT68F017R
Analog to Digital Converter
The need to interface to real world analog signals is a
common requirement for many electronic systems.
However, to properly process these signals by a
microcontroller, they must first be converted into digital
signals by A/D converters. By integrating the A/D con-
version electronic circuitry into the microcontroller, the
need for external components is reduced significantly
with the corresponding follow-on benefits of lower costs
and reduced component space requirements.
A/D Overview
The device contains a multi-channel analog to digital
converter which can directly interface to external analog
signals, such as that from sensors or other control sig-
nals and convert these signals directly into either a
12-bit digital value.
Part No.
Input A/D Channel
Channels Select Bits
Input
Pins
HT66F016
HT66F017
4
ACS4,
ACS1~ACS0
AN0~AN3
HT68F016
HT68F017
¾
¾
¾
The accompanying block diagram shows the overall in-
ternal structure of the A/D converter, together with its as-
sociated registers.
A/D Converter Register Description
Overall operation of the A/D converter is controlled us-
ing five registers. A read only register pair exists to store
the ADC data 12-bit value. The remaining three regis-
ters are control registers which setup the operating and
control function of the A/D converter.
Register
Name
ADRL(ADRFS=0)
ADRL(ADRFS=1)
ADRH(ADRFS=0)
ADRH(ADRFS=1)
ADCR0
ADCR1
ACERL
7
D3
D7
D11
¾
START
ACS4
¾
Bit
6
5
4
3
D2
D1
D0
¾
D6
D5
D4
D3
D10
D9
D8
D7
¾
¾
¾
D11
EOCB ADOFF ADRFS
¾
V125EN
¾
¾
¾
VREFS
¾
¾
ACE3
A/D Converter Register List
2
¾
D2
D6
D10
¾
ADCK2
ACE2
1
¾
D1
D5
D9
ACS1
ADCK1
ACE1
0
¾
D0
D4
D8
ACS0
ADCK0
ACE0
A/D Converter Data Registers - ADRL, ADRH
As the devices contain an internal 12-bit A/D converter, they require two data registers to store the converted value.
These are a high byte register, known as ADRH, and a low byte register, known as ADRL. After the conversion process
takes place, these registers can be directly read by the microcontroller to obtain the digitised conversion value. As only
12 bits of the 16-bit register space is utilised, the format in which the data is stored is controlled by the ADRFS bit in the
ADCR0 register as shown in the accompanying table. D0~D11 are the A/D conversion result data bits. Any unused bits
will be read as zero.
ADRH
ADRL
ADRFS
7654321076543210
0
D11 D10 D9 D8 D7 D6 D5 D4 D3 D2 D1 D0 0 0 0 0
1
0 0 0 0 D11 D10 D9 D8 D7 D6 D5 D4 D3 D2 D1 D0
A/D Data Registers
Rev. 1.40
73
November 22, 2016