English
Language : 

W79E825A Datasheet, PDF (104/127 Pages) Winbond – 8-BIT MICROCONTROLLER
W79E825A/824A/823B/822B Data Sheet
25 I2C SERIAL CONTROL
The I2C bus uses two wires (SDA and SCL) to transfer information between devices connected to the
bus. The main features of the bus are:
– Bidirectional data transfer between masters and slaves
– Multimaster bus (no central master)
– Arbitration between simultaneously transmitting masters without corruption of serial data on the bus
– Serial clock synchronization allows devices with different bit rates to communicate via one serial bus
– Serial clock synchronization can be used as a handshake mechanism to suspend and resume serial
transfer
– The I2C bus may be used for test and diagnostic purposes
SDA
SCL
STOP
START
tBUF
tLOW
tHD;STA
tHIGH
tHD;DAT
tr
tf
Figure 25-1: I2C Bus Timing
tSU;DAT
Repeated
START
tSU;STA
STOP
tSU;STO
The device’s on-chip I2C logic provides the serial interface that meets the I2C bus standard mode
specification. The I2C logic handles bytes transfer autonomously. It also keeps track of serial
transfers, and a status register (I2STATUS) reflects the status of the I2C bus.
The I2C port, SCL and SDA are at P1.2 and P1.3. When the I/O pins are used as I2C port, user must
set the pins to logic high in advance. When I2C port is enabled by setting ENS to high, the internal
states will be controlled by I2CON and I2C logic hardware. Once a new status code is generated and
stored in I2STATUS, the I2C interrupt flag (SI) will be set automatically. If both EA and EI2C are also
in logic high, the I2C interrupt is requested. The 5 most significant bits of I2STATUS stores the internal
state code, the lowest 3 bits are always zero and the content keeps stable until SI is cleared by
software.
25.1 SIO Port
The SIO port is a serial I/O port, which supports all transfer modes from and to the I2C bus. The
SIO port handles byte transfers autonomously. To enable this port, the bit ENS1 in I2CON
should be set to '1'. The CPU interfaces to the SIO port through the following six special
function registers: I2CON (control register, C0H), I2STATUS (status register, BDH), I2DAT (data
register, BCH), I2ADDR (address registers, C1H), I2CLK (clock rate register BEH) and I2TIMER
(Timer counter register, BFH). The SIO H/W interfaces to the I2C bus via two pins: SDA (P1.3,
serial data line) and SCL (P1.2, serial clock line). Pull up resistor is needed for Pin P1.2 and
P1.3 for I2C operation as these are 2 open drain pins.
- 104 -