
R8C/3MK Group
USB-to-Serial Communication Conversion Demo Board
R0K5R8C3MDU30BR Instruction Manual
R01AN1051EJ0100 Rev.1.00
Page 23 of 38
Mar 21, 2012
9. I
2
C demo communication protocol
9.1
USB Packet Specification
9.1.1
Structure of Command Packet
The command packet for controlling I
2
C device consists of five bytes. Figure 23 shows the structure of
command packet.
Control
0x01
DevAdr
0x02
RegAdr
0x03
Len(Lower)
0x64
Len(Upper)
0x00
O
U
T
A
C
K
The structure of Command Packet
Figure 23 Structure of Command Packet
Each field
1) Control : operation type (1 byte in binary format)
0x00: Write Access
0x01: Read Access
For the value other than the above, this product responses the error code (0xFFyy : yy is control field
in the error condition) as a command error.
2) DevAdr: Device address of I
2
C devices (1 byte in binary format)
0x00-0x7F
This field consists of 7bits in binary format, this product does Not perform an error judgment.
3) RegAdr: Register / Control / Memory Address of I
2
C devices (1bytes in binary format)
0x00-0xFF
This field consists of 7bits in binary format, and this product does not perform an error judgment.
The meaning of this field depends on the connected I
2
C device.
4) Len : Length of Data Packet (2bytes in binary format)
0x0000-0xFFFF
This field consists of 2 bytes in binary format. And this product does not perform an error judgment.
The byte order of this field is little endian (the first is lower byte, and the second is upper byte)
When you enter 0x0000 to this field, you can access 65536 bytes continuously.