1. Introduction ........................................................................................................ 2
2. Electrical connection ............................................................................................ 2
3. Bus characteristics............................................................................................... 7
4. Data transfer .................................................................................................... 12
5. Read/write RAM/EEPROM sequences .................................................................... 16
6. Limitations ....................................................................................................... 19
7. Flowchart of controller operation and error handling .............................................. 20
8. Sensor memory guide ........................................................................................ 23
9. Appendix A, Checksum calculation example: ......................................................... 27
10.
Appendix B, I2C bus transaction examples ......................................................... 28.................................................... 31Sensor microprocessor
GND

I2C terminal
DVCC

DVCC
G0
DC/DC converter
G+  DVCC

SCL
2IC

RP_SCL

Rint_SCL

I2C_SCL

I2C_SCL
RS_SCL

RP_SDA
SDA
Rint_SDAI2C_SDAG+

RS_SDAI2C_SDAI2C terminal

I2C_SDAI2C_SCLG+
G0
DVCC

Figure 4. I2C terminal on K30 sensor────────────1.
2.

Write I2C
Wait time slot
RequestSDA

Read
Response

Request

Wait time slot

Response

tRQ

tWAITtRS

SCLtS

Pulse to Wake
Up Meter

Wait to Wake
Up Meter

SDAtWU

Write I2C
Wait time slot
RequestRead
Response

Request

Wait time slot

Response

tRQ

tWAIT

tRS

tWUD

SCLtS

Wait to Wake
Up Meter

Pulse to Wake
Up Meter

SDA
Up to 8 clocks while
SDA stays LowtWU

Write I2C
Wait time slot
RequestRead
Response

Request

Wait time slot

Response

tRQ

tWAITtRStWUD

SCLtS

Write RAM/EEPROM
Start
condition

7 bit address+
Commanddirection bit
Byte(write)
1 byte1 byteAddress

Data to write

Checksum2 bytes

1..16 bytes

1 byteStopcondition

Master Wait Delay
ProcessI2C on Sesnor
Set operation status tocomplete
Disable IRQ

Startcondition

7 bit address+
Operation
direction bit
Checksum Stop
statusconditi(read)
on
1 byte1 byte1 byteEnable IRQ

Read RAM/EEPROM
Start
condition

7 bit address+
Commanddirection bit
Address Checksum Stop
Byte
conditi(write)on
1 byte1 byte2 bytes
1 byteMaster Wait DelayProcessI2C on Sesnor
Set operation status tocomplete
Disable IRQ

Enable IRQ

Startcondition

7 bit address+Operation
direction bit
Read data Checksum Stopstatusconditi(read)
on
1 byte1 bytes 1-16 bytes
1 byte───START(Call by high-level function)

Wake-Up Sensor(models PO and 4B)
Make pulse 1-0-1 on line SDA(~300us)--- OR --Send Start Condition, byte
0x00, then Stop Condition
Delay 1 ms for Sensor
WakeUp from SleepMode

Send Request.
Timeout 120ms

Send I2C StartCondition(checked by I2C-Master)Send 7-bit I2C address
and Direction bit(0=Write)

Example:Send byte 0xD0 for
default address 0x68 orbyte 0xFE for ”anysensor” address 0x7F

Check ACK
NotACK

Comm. Error

ACK

Send next Byte
NoAll bytes was sent?
Yes

Delay 20 ms forprocessing Request
on Sensor
Continue on next page

Timeout

Send Stop Condition

Comm. Error

Continue
Receive Response.
Timeout 120ms(Checked bySend I2C Start
I2C-Master.)
Condition
Example:Send byte 0xD1 fordefault address 0x68 orbyte 0xFF for ”anysensor” address 0x7F

Send 7-bit I2C addressand Direction bit(1=Read)

Check ACK
NotACK

Comm. Error

ACK

Receive Bytewith ACK

Last byte will
be received?

NoYes

Receive last Byte
without ACK

Send Stop Condition

Incorrect

Format Error

Checkfield “Command”
in Operation
StatusEqual to the field“Command” in Request

Checkfield “Completion”
in Operation
StatusIncomplete(Responseis not ready)

Incorrect

Format Error

Check Checksum

TimeoutCompleteComm. Error
Correct

END(Return data and status ”OK” to highlevel function)

Error HandlingComm. Error

Send Stop Condition

END(Return to high-level with Error)

Communication Error – wrong
Slave address, timeout, orNotACK. I2C-Master should
send Stop Condition after thiserror. Master can do several
retries.

Format Error
END(Return to high-level with Error)

Error of Request’s format wrong checksum or Request
is not processed. Master cando several retries.

Table 15

I2C address

typedef unsigned char BYTE;
BYTE CheckSum(BYTE * buf, BYTE count) {BYTE sum=0;
while (count>0) {sum += *buf;
buf++;
count--;}
return sum;}