HT46R068B/HT46R069B
Enhanced A/D Type 8-bit OTP MCU
A/D Programming Example
The following two programming examples illustrate how to setup and implement an A/D
conversion. In the first example, 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.
A
O
D
F
F
t
O
2
N
T
S
o
f
f
A
C
D
m
o
d
e
u
l
o
f
f
o
n
o
n
A
D
/
s
m
a
l
p
n
i
g
i
t
m
e
A
D
/
s
m
a
l
p
n
i
g
m
t
i
e
O
N
t
A
C
D
S
t
A
C
D
S
S
A
T
T
R
E
C
O
B
A
S
C
~
3
C
A
0
S
0
0
B
1
1
0
1
0
B
0
0
0
B
0
0
1
B
P
w
o
r
e
o
-
n
S
a
t
t
r
f
o
/
A
D
S
a
t
t
r
f
o
/
A
D
S
a
t
t
r
f
o
/
A
D
R
s
e
t
e
c
o
n
e
s
v
r
o
i
n
c
o
n
e
s
v
r
o
i
n
c
o
n
e
s
v
r
o
i
n
R
s
e
t
e
A
D
/
R
s
e
t
e
A
D
/
R
c
s
e
t
e
A
D
/
c
o
n
e
t
v
r
r
e
c
o
n
e
t
v
r
r
e
o
n
e
t
v
r
r
e
E
n
d
o
f
A
/
D
E
n
d
o
f
A
/
D
c
o
n
e
s
v
r
o
i
n
c
o
n
e
s
v
r
o
i
n
1
:
D
e
i
n
f
e
p
o
t
c
r
n
o
i
g
f
u
a
i
r
t
n
o
2
:
S
e
e
l
t
c
a
n
o
a
g
c
l
a
h
n
n
e
l
t
A
C
D
t
A
C
D
A
D
/
c
o
n
e
s
v
r
o
i
n
t
m
i
e
A
D
/
c
o
n
e
s
v
r
o
i
n
m
t
i
e
N
t
o
:
e
A
t
D
/
c
o
c
l
m
k
s
u
b
t
e
f
s
y
S
s
S
Y
/
,
,
2
f
S
f
S
Y
/
,
4
f
S
S
Y
/
,
8
f
S
S
Y
/
1
6
o
r
S
f
S
Y
/
2
3
A
C
D
=
S
t
4
A
D
t
A
C
D
=
1
6
A
D
t
A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