
Rev. 1.00
177 of ���
�an�a�� 1�� �01�
Standard 8051 8-Bit Flash MCU
HT85F2260/HT85F2270/HT85F2280
I2C Serial Interface
I2C Serial Interface
I
2
C Registers
There are three control registers associated with the I
2
C bus, I2CCON, I2CADR and I2CSTA and
one data register, I2CDAT. The I2CDAT register is used to store the data being transmitted and
received on the I
2
C bus. Before the microcontroller writes data to the I
2
C bus, the actual data to be
transmitted must be placed in the I2CDAT register. After the data is received from the I
2
C bus, the
microcontroller can read it from the I2CDAT register. Any transmission or reception of data from
the I
2
C bus must be made via the I2CDAT register. The I2CADR register holds the address of the
device slave interface. This address is used by an external device when attempting to access it via
I
2
C bus. The complete I
2
C interface operation is controlled by the I2CCON register. The I2CLK
register controls the I
2
C clock frequency. In addition, the I
2
C Bus status can be reflected by the
I2CSTA register.
I
2
C Register List
Register
Name
Bit
7
6
5
4
3
2
1
0
I�CCON
—
ENS1
STA
STO
SI
AA
—
—
I�CLK
I�CLK.7
I�CLK.6
I�CLK.�
I�CLK.4
I�CLK.3
I�CLK.�
I�CLK.1
I�CLK.0
I�CSTA
IICS7
IICS6
IICS�
IICS4
IICS3
—
—
—
I�CDAT
D7
D6
D�
D4
D3
D�
D1
D0
I�CADR
IICA6
IICA�
IICA4
IICA3
IICA�
IICA1
IICA0
GC
I2CCON Register
SFR Address: D8h
Bit
7
6
5
4
3
2
1
0
Name
—
ENS1
STA
STO
SI
AA
—
—
R/W
—
R/W
R/W
R/W
R/W
R/W
—
—
POR
—
0
0
0
0
0
—
—
Bit 7
Unimplemented, read as “0”
Bit 6
ENS1:
I
2
C Enable Control
0: Disable
1: Enable
When the ENS1 bit is cleared to zero, the I
2
C interface will be disabled and will become
high impedance and not affect the original pin-shared I/O pin function. When the ENS1
bit is set high, the I
2
C function is enabled and care should be taken regarding the related
pin-shared I/O structure settings, such as disabling any internal pull up functions and
any other circuits connected to these pins.
Bit 5
STA:
I
2
C Start flag
0: No START condition on the I
2
C bus
1: START condition
When the STA bit is set high, the master device will check the I
2
C bus status first and if
the bus is free a START condition will be generated.
Bit 4
STO:
I
2
C Stop flag
0: No STOP condition on the I
2
C bus
1: Set STOP condition
When the STO bit is set high, the master device will transmit a STOP condition to the
I
2
C bus.