HT45RM03 Holtek Semiconductor, HT45RM03 Datasheet - Page 26

no-image

HT45RM03

Manufacturer Part Number
HT45RM03
Description
Brushless DC Motor Type 8-Bit OTP MCU
Manufacturer
Holtek Semiconductor
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Company:
Part Number:
HT45RM03A
Quantity:
2 200
Company:
Part Number:
HT45RM03B
Quantity:
10 000
A/D Converter
The 8 channels and 9-bit resolution A/D converter are implemented in this microcontroller. The reference voltage is
VDD. The A/D converter contains 4 special registers which are; ADRL (20H), ADRH (21H), ADCR (22H) and ACSR
(23H). The ADRH and ADRL are A/D result register higher-order byte and lower-order byte and are read-only. After the
A/D conversion 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 conversion con-
trol 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 1 0). At the end of A/D conver-
sion, the EOCB bit is 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.
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 config-
urations. 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 ana-
log 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 com-
pleted. The START bit of the ADCR is used to begin the conversion of the A/D converter. Giving START bit a rising edge
and falling edge means that the A/D conversion has started. In order to ensure the A/D conversion is completed, the
START should remain at 0 until the EOCB is cleared to 0 (end of A/D conversion).
Rev. 1.00
Bit No.
Bit No.
PCR2
2~7
0
0
0
0
1
1
1
1
0
1
0
1
2
3
4
5
6
7
ADCS0
ADCS1
START
PCR1
EOCB
Label
Label
ACS0
ACS1
ACS2
PCR0
PCR1
PCR2
0
0
1
1
0
0
1
1
Selects the A/D converter clock source
00= system clock/2
01= system clock/8
10= system clock/32
11= undefined
Unused bit, read as 0
Defines the analog channel select.
Defines the port B configuration select. If PCR0, PCR1 and PCR2 are all 0, the ADC circuit is
power off to reduce power consumption
Indicates end of A/D conversion. (0 = end of A/D conversion)
Each time bits 3~5 change state the A/D should be initialized by issuing a START signal, oth-
erwise the EOCB flag may have an undefined condition. See Important note for A/D initializa-
tion .
Starts the A/D conversion. (0 1 0= start; 0 1= Reset A/D converter and set EOCB to 1 )
PCR0
0
1
0
1
0
1
0
1
AN7
PB7
PB7
PB7
PB7
PB7
PB7
PB7
7
PB6
PB6
PB6
PB6
PB6
PB6
PB6
AN6
ACSR (23H) Register
ADCR (22H) Register
Port B Configuration
6
26
PB5
PB5
PB5
PB5
PB5
PB5
AN5
AN5
5
Function
Function
PB4
PB4
PB4
PB4
PB4
AN4
AN4
AN4
4
AN3
AN3
AN3
AN3
PB3
PB3
PB3
PB3
3
PB2
PB2
PB2
AN2
AN2
AN2
AN2
AN2
2
PB1
PB1
AN1
AN1
AN1
AN1
AN1
AN1
HT45RM03
January 11, 2007
1
PB0
AN0
AN0
AN0
AN0
AN0
AN0
AN0
0

Related parts for HT45RM03