HT46R068B/HT46R069B
Enhanced A/D Type 8-bit OTP MCU
D
t
a
a
B
u
s
2
I
C
D
t
a
a
R
e
i
g
t
s
r
e
S
a
l
e
v
A
d
d
e
r
s
R
s
g
e
s
i
e
t
r
(
I
S
M
D
)
(
I
S
M
A
)
A
d
d
e
s
r
s
A
d
d
e
s
r
M
s
t
a
h
c
2
I
C
I
t
n
r
e
u
r
t
p
C
m
o
a
p
a
r
o
t
r
H
A
A
S
B
i
t
H
X
T
B
t
i
D
r
i
c
e
i
o
t
n
C
n
o
r
t
l
o
S
L
C
P
n
i
D
t
a
a
n
i
L
B
S
S
A
D
P
n
i
S
i
f
h
t
e
s
g
R
e
t
i
r
R
e
a
w
d
i
r
e
t
/
S
a
l
e
v
D
t
a
a
O
u
t
M
S
B
M
S
W
R
B
t
i
U
E
n
a
e
b
D
/
s
l
a
i
e
b
A
l
c
k
n
l
d
e
o
g
w
e
X
8
b
-
t
i
a
D
a
t
C
m
o
l
p
t
e
e
H
F
C
B
t
i
T
a
r
n
m
t
s
i
/
e
R
e
c
v
i
e
D
t
e
c
e
t
t
S
r
a
t
o
r
S
o
t
p
C
o
n
r
l
o
t
U
i
n
t
H
B
B
B
t
i
I2C Block Diagram
I2C Bus Communication
Communication on the I2C bus requires four separate steps, a START signal, a slave device address
transmission, a data transmission and finally a STOP signal. When a START signal is placed on
the I2C bus, all devices on the bus will receive this signal and be notified of the imminent arrival
of data on the bus. The first seven bits of the data will be the slave address with the first bit being
the MSB. If the address of the slave device matches that of the transmitted address, the HAAS bit
in the SIMC1 register will be set and an I2C interrupt will be generated. After entering the interrupt
service routine, the slave device must first check the condition of the HAAS bit to determine
whether the interrupt source originates from an address match or from the completion of an 8-bit
data transfer. During a data transfer, note that after the 7-bit slave address has been transmitted, the
following bit, which is the 8th bit, is the read/write bit whose value will be placed in the SRW bit.
This bit will be checked by the slave device to determine whether to go into transmit or receive
mode. Before any transfer of data to or from the I2C bus, the microcontroller must initialise the
bus, the following are steps to achieve this:
Step 1
●
●
●
Set the SIM2~SIM0 and SIMEN bits in the SIMC0 register to "1" to enable the I2C bus.
Step 2
Write the slave address of the device to the I2C bus address register SIMA.
Step 3
Set the SIME and SIM Muti-Function interrupt enable bit of the interrupt control register to
enable the SIM interrupt and Multi-function interrupt.
Rev. 1.00
9ꢃ
�anꢀaꢁꢂ ꢃꢄꢅ ꢃ011