HT46RU67 Holtek Semiconductor Inc., HT46RU67 Datasheet - Page 30

no-image

HT46RU67

Manufacturer Part Number
HT46RU67
Description
Ht46ru67/ht46cu67 -- A/d Type 8-bit Mcu With Lcd
Manufacturer
Holtek Semiconductor Inc.
Datasheet
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.00
mov
mov
mov
mov
clr
set
clr
sz
jmp
mov
mov
mov
mov
jmp
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
; setup the ACSR register to select f
; and select AN0 to be connected to the A/D converter
; As the Port B channel bits have changed the following START
; reset A/D
; start A/D
; save result to user defined memory
; save result to user defined memory
; setup ADCR register to configure Port PB0~PB3 as A/D inputs
; signal (0-1-0) must be issued within 10 instruction cycles
; 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
; read conversion result low byte value from the ADRL register
; start next A/D conversion
A/D Conversion Timing
30
SYS
/8 as the A/D clock
HT46RU67/HT46CU67
February 27, 2008

Related parts for HT46RU67