English
Language : 

HT56RB27 Datasheet, PDF (51/153 Pages) Holtek Semiconductor Inc – TinyPowerTM A/D Type Smart Card OTP MCU with DAC, ISO 7816 and USB Interfaces
HT56RB27
TinyPowerTM A/D Type Smart Card OTP MCU
with DAC, ISO 7816 and USB Interfaces
A/D Converter Control Registers - ADCR, ADPCR, ACSR
To control the function and operation of the A/D converter, three control registers known as ADCR,
ADPCR and ACSR 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 analog inputs and
which are used as normal I/Os, the A/D clock source as well as controlling the start function and
monitoring the A/D converter end of conversion status.
The ACS2~ACS0 bits in the ADCR register define the channel number. As the device contains only
one actual analog to digital converter circuit, each of the individual 8 analog inputs must be routed to
the converter. It is the function of the ACS2~ACS0 bits in the ADCR register to determine which
analog channel is actually connected to the internal A/D converter.
The ADPCR control register contains the PCR7~PCR0 bits which determine which pins on Port A are
used as analog inputs for the A/D converter and which pins are to be used as normal I/O pins. If the
PCRn bit has a value of 1, the related pin on PORT A will be set as an analog input. If the PCRn bit is
set to zero, then the related pin on Port A will be setup as a normal I/O pin.
ACSR Register
Bit
Name
R/W
POR
7
TEST
R/W
1
6
ADONB
R/W
1
5
ACS4
R/W
0
4
VBGEN
R/W
0
3
VREFS
R/W
0
2
ADCS2
R/W
0
1
ADCS1
R/W
0
0
ADCS0
R/W
0
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2~0
TEST: For test only, read as 1
ADONB: A/D Converter enable control
0: A/D converter is turned off
1: A/D converter is turned on
ACS4: Internal Band-gap reference voltage channel input selection
0: A/D converter analog channel is connected to the analog input from AN0 to AN/7
1: A/D converter analog channel is connected to the internal Band-gap voltage VBG
VBGEN: Band-gap reference voltage enable control
0: Band-gap voltage VBG is disabled and connected to the ground
1: Band-gap voltage VBG is enabled
The band-gap reference voltage VBG is used for the A/D converter and LVD/LVR function, which
is controlled by the band-gap reference voltage enable bit VBGEN in the ACSR register. If the
VBG is not used for the A/D converter and the LVD/LVR function is disabled, the microcontroller
hardware will automatically turned off the band-gap reference voltage to conserve power. Care
must be taken as when the VREFS bit is set high for the A/D converter, then a VBG turn on time
tBG must be allowed before any A/D conversions are implemented.
VREFS: A/D converter reference voltage selection bit
0: from the internal voltage AVDD
1: from the external pin VREF
The A/D reference voltage can come from either the internal voltage AVDD or the external
voltage VREF, which is selected by the VREFS bit in the ACSR register. When the VREFS bit
is cleared to 0, the reference voltage of the A/D converter comes from the internal A/D power
supply VADD and the external VREF pin can be used as an I/O pin or other pin-shared function.
When the VREFS bit is set to 1, the reference voltage of the A/D converter comes from the
external VREF pin and the I/O or other pin-shared functions are disabled.
ADCS2~ADCS0: Select A/D converter clock source
000: fSYS/2
001: fSYS/8
010: fSYS/32
011: undefined
100: fSYS
101: fSYS/4
110: fSYS/16
111: undefined
Rev. 1.20
51
April 26, 2013