HT46R24/HT46C24
Rev. 1.50
19
May 3, 2004
A/D Converter
The 8 channels and 10-bit resolution A/D (9-bit accu-
racy) converter are implemented in this microcontroller.
The reference voltage is VDD. The A/D converter con-
tains 4 special registers which are; ADRL (24H), ADRH
(25H), ADCR (26H) and ACSR (27H). The ADRH and
ADRL are A/D result register higher-order byte and
lower-order byte and are read-only. After the A/D con-
version is completed, the ADRH and ADRL should be
read to get the conversion result data. The ADCR is an
A/D converter control register, which defines the A/D
channel number, analog channel select, start A/D con-
version control bit and the end of A/D conversion flag. If
the users want to start an A/D conversion. Define PB
configuration, select the converted analog channel, and
give START bit a raising edge and falling edge
(0
cleared and an A/D converter interrupt occurs (if the A/D
converter interrupt is enabled). The ACSR is A/D clock
setting register, which is used to select the A/D clock
source.
1
0). At the end of A/D conversion, the EOCB bit is
The A/D converter control register is used to control the
A/D converter. The bit2~bit0 of the ADCR are used to
select an analog input channel. There are a total of eight
channels to select. The bit5~bit3 of the ADCR are used
to set PB configurations. PB can be an analog input or
as digital I/O line decided by these 3 bits. Once a PB line
is selected as an analog input, the I/O functions and
pull-high resistor of this I/O line are disabled and the A/D
converter circuit is power on. The EOCB bit (bit6 of the
ADCR) is end of A/D conversion flag. Check this bit to
know when A/D conversion is completed. The START
bit of the ADCR is used to begin the conversion of the
A/D converter. Giving START bit a rising edge and fall-
ing edge means that the A/D conversion has started. In
order to ensure the A/D conversion is completed, the
STARTshould remain at 0 until the EOCB is cleared to
0 (end of A/D conversion).
The bit 7 of the ACSR is used for testing purposes only.
It cannot be used by the users. The bit1 and bit0 of the
ACSR are used to select A/D clock sources.
Label
(ACSR)
Bits
Function
ADCS0
ADCS1
0
1
Selects the A/D converter clock source
00= system clock/2
01= system clock/8
10= system clock/32
11= undefined #See other note3*
2~6 Unused bit, read as 0
TEST
7
For test mode used only
ACSR Register
Label
(ADCR)
Bits
Function
ACS0
ACS1
ACS2
0
1
2
Defines the analog channel select
PCR0
PCR1
PCR2
3
4
5
DefinestheportBconfigurationselect.
If PCR0, PCR1 and PCR2 are all zero,
the ADC circuit is power off to reduce
power consumption
EOCB
6
Provides response at the end of the
A/D conversion.
(0= end of A/D conversion)
START
7
Starts the A/D conversion. (0
start; 0
1= reset A/D converter)
1
0=
ADCR Register
ACS2
ACS1
ACS0
Analog Channel
0
0
0
A0
0
0
1
A1
0
1
0
A2
0
1
1
A3
1
0
0
A4
1
0
1
A5
1
1
0
A6
1
1
1
A7
Analog Input Channel Selection
When the A/D conversion is completed, the A/D inter-
rupt request flag is set. The EOCB bit is set to 1 when
the START bit is set from 0 to 1 .
Register Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0
ADRL
D1
D0
ADRH
D9
D8
D7
D6
D5
D4
D3
D2
Note:
D0~D9 is A/D conversion result data bit
LSB~MSB.