HT46R52A Holtek Semiconductor, HT46R52A Datasheet - Page 18

no-image

HT46R52A

Manufacturer Part Number
HT46R52A
Description
(HT46R51A / HT46R52A) A/D Type 8-Bit OTP MCU
Manufacturer
Holtek Semiconductor
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Company:
Part Number:
HT46R52A
Quantity:
1 345
www.DataSheet4U.com
DataSheet
4
U
.com
The following two programming examples illustrate how to setup and implement an A/D conversion. In the first exam-
ple, the method of polling the EOCB bit in the ADCR register is used to detect when the conversion cycle is complete,
whereas in the second example, the A/D interrupt is used to determine when the conversion is complete.
Example: using EOCB Polling Method to detect end of conversion
Start_conversion:
Polling_EOC:
Rev. 1.00
clr
mov
mov
mov
mov
clr
set
clr
sz
jmp
mov
mov
mov
mov
PCR2
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
PCR1
0
0
1
1
0
0
1
1
PCR0
0
1
0
1
0
1
0
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
; As the Port B channel bits have changed the following START
; signal (0-1-0) must be issued within 10 instruction cycles
A/D Conversion Timing
Port B Configuration
AN4
PB4
PB4
PB4
PB4
PB4
4
18
PB3
PB3
PB3
PB3
AN3
AN3
3
Undefined, cannot be used
SYS
/8 as the A/D clock
AN2
AN2
AN2
PB2
PB2
PB2
2
HT46R51A/HT46R52A
PB1
PB1
AN1
AN1
AN1
AN1
1
August 24, 2006
PB0
AN0
AN0
AN0
AN0
AN0
0

Related parts for HT46R52A