NO:
W90P710 Programming Guide
VERSION:
2.0
PAGE:
205
The above information is the exclusive intellectual property of Winbond Electronics and shall not be disclosed, distributed or reproduced without permission
from Winbond.
Table No.: 2005-W90P710-11-A
A
f rom master to slav e
f rom slav e to master
A = acknowledge (SDA low)
A = not acknowledge (SDA high)
S = START condition
P = STOP condition
S
Slave Address
(7b'1010001)
A
Data Address
(0x12)
A
A/A
P
Data Address
(0x34)
A
Data 1
data transf er
(n by tes + acknowledge)
Data n
R/W
'0'(write)
.............
Commands:
1. Write a value into
DIVIDER
register to determine the frequency of serial clock.
2. Set
Tx_NUM
= 0x2 and set
I2C_EN
= 1 of
CSR
register to enable I2C core.
3. Write 0xA2 (slave a write bit 0) to
TxR
register (TxR[23:16]).
4. Write address high byte (0x12) to
TxR
register (
TxR[15:8]
), and address low byte (0x34) to
TxR
register (
TxR[7:0]
).
5. Set
START
bit, and
WRITE
bit of
CMDR
register.
6. Wait for interrupt or
I2C_TIP
flag to negate
7. Read
I2C_RxACK
bit of
CSR
register, it should be '0'. If it is not ‘0’, there are some errors
happened.
8. Write data to
TxR
register (
TxR[7:0]
).
9. Set
WRITE
bit of
CMDR
register.
10. Wait for interrupt or
I2C_TIP
flag to negate
11. Read
I2C_RxACK
bit of
CSR
register, it should be '0'. If it is not ‘0’, there are some errors
happened.
12. Continue step 8 -11 before the final byte transmit
13. Write final byte to
TxR
register (
TxR[7:0]
).
14. Set
WRITE
bit, and
STOP
bit of
CMDR
register for final byte transmit.
15. Wait for interrupt or
I2C_TIP
flag to negate
16. Read
I2C_RxACK
bit of
CSR
register, it should be '0'. If it is not ‘0’, there are some errors
happened.
17.4.5.3
Read a byte of data from an I2C memory device (Random read)
Slave address = 0x4E (7'b1001110)
Memory location to read from = 0x20