HT82A520R HOLTEK [Holtek Semiconductor Inc], HT82A520R Datasheet - Page 34

no-image

HT82A520R

Manufacturer Part Number
HT82A520R
Description
Full Speed USB 8-Bit OTP MCU with SPI
Manufacturer
HOLTEK [Holtek Semiconductor Inc]
Datasheet
Analog to Digital Converter - HT82A620R
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 channel analog to
digital converter which can directly interface to external
analog signals, such as that from sensors or other con-
trol signals and convert these signals directly into an
12-bit digital value. The number of available channels
depends upon which package type is chosen.
The A/D block diagram shows the overall internal struc-
ture of the A/D converter, together with its associated
registers.
A/D Converter Data Registers - ADRL, ADRH
The device, which contain a single12-bit A/D converter,
requires two data registers, known as ADRL and ADRH.
After the conversion process takes place, these regis-
ters can be directly read by the microcontroller to obtain
the digitised conversion value.
In the following tables, D0~D7 are the A/D conversion
data result bits.
Note: D11~D0 is the A/D conversion result data bit
MSB~LSB.
Rev.1.00
Register
ADRL
ADRH
D11 D10 D9
Bit
D3
7
A/D Data Register
Bit
D2
6
Bit
D1
5
Bit
D0
D8
4
Bit
D7
3
Bit
D6
2
Bit
D5
A/D Converter Structure
1
Bit
D4
0
34
A/D Converter Control Register - ADCR
To control the function and operation of the A/D con-
verter, control registers known as ADCR and ADSR are
provided. These 8-bit registers define functions such as
the selection of which analog channel is connected to
the internal A/D converter, which pins are used as ana-
log inputs and which are used as normal I/Os as well as
controlling the start function and monitoring the A/D con-
verter end of conversion status.
One section of this register contains the bits
ACS3~ACS0 which define the channel number. As each
of the devices contains only one actual analog to digital
converter circuit, each of the individual analog inputs
must be routed to the converter. It is the function of the
ACS3~ACS0 bits in the ADCR register to determine
which analog channel is actually connected to the inter-
nal A/D converter.
The START bit in the ADCR register is used to start and
reset the A/D converter. When the microcontroller sets
this bit from low to high and then low again, an analog to
digital conversion cycle will be initiated. When the
START bit is brought from low to high but not low again,
the EOCB bit in the ADCR register will be set to a 1
and the analog to digital converter will be reset. It is the
START bit that is used to control the overall on/off opera-
tion of the internal analog to digital converter.
The EOCB bit in the ADCR register is used to indicate
when the analog to digital conversion process is com-
plete. This bit will be automatically set to 0 by the
microcontroller after a conversion cycle has ended. In
addition, the corresponding A/D interrupt request flag
will be set in the interrupt control register, and if the inter-
rupts are enabled, an appropriate internal interrupt sig-
nal will be generated. This A/D internal interrupt signal
will direct the program flow to the associated A/D inter-
nal interrupt address for processing. If the A/D internal
interrupt is disabled, the microcontroller can be used to
HT82A520R/HT82A620R
October 23, 2009

Related parts for HT82A520R