HT46RU25 Holtek Semiconductor Inc., HT46RU25 Datasheet - Page 26

no-image

HT46RU25

Manufacturer Part Number
HT46RU25
Description
Ht46ru25/ht46cu25 -- A/d Type 8-bit Mcu
Manufacturer
Holtek Semiconductor Inc.
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
HT46RU25
Manufacturer:
HOLTEK/合泰
Quantity:
20 000
Note:
The following programming example illustrates how to setup and implement an A/D conversion. The method of polling
the EOCB bit in the ADCR register is used to detect when the conversion cycle is complete.
Example: using EOCB Polling Method to detect end of conversion
Start_conversion:
Polling_EOC:
Rev. 1.30
clr
mov
mov
mov
mov
clr
set
clr
sz
jmp
mov
mov
mov
mov
jmp
Register
ADRH
ACS2
ADRL
D0~D11 is A/D conversion result data bit LSB~MSB.
0
0
0
0
1
1
1
1
EADI
a,00000001B
ACSR,a
a,00100000B
ADCR,a
:
:
:
START
START
START
EOCB
polling_EOC
a,ADRH
adrh_buffer,a
a,ADRL
adrl_buffer,a
:
:
start_conversion
Bit7
D11
D3
ACS1
0
0
1
1
0
0
1
1
; disable ADC interrupt
; setup the ACSR register to select f
; setup ADCR register to configure Port PB0~PB3 as A/D inputs
; and select AN0 to be connected to the A/D converter
; reset A/D
; start A/D
; poll the ADCR register EOCB bit to detect end of A/D conversion
; continue polling
; read conversion result high byte value from the ADRH register
; save result to user defined memory
; read conversion result low byte value from the ADRL register
; save result to user defined memory
; start next A/D conversion
; As the Port B channel bits have changed the following START
; signal (0-1-0) must be issued within 10 instruction cycles
Bit6
D10
D2
ADRL (24H), ADRH (25H) Register
Analog Input Channel Selection
Bit5
D1
D9
ACS0
0
1
0
1
0
1
0
1
26
Bit4
D0
D8
SYS
Bit3
D7
/8 as the A/D clock
HT46RU25/HT46CU25
Analog Channel
Bit2
D6
AN0
AN1
AN2
AN3
AN4
AN5
AN6
AN7
Bit1
D5
March 9, 2007
Bit0
D4

Related parts for HT46RU25