
R8C/3MK Group
USB-to-Serial Communication Conversion Demo Board
R0K5R8C3MDU30BR Instruction Manual
R01AN1051EJ0100 Rev.1.00
Page 24 of 38
Mar 21, 2012
9.1.2
Structure of Data Packet
The data length is n bytes according to the connected I
2
C device. The maximum of the data length is the
value of the Len field of the command packet. When the data length is more than 64bytes, the data is divided
into multiple data packets. Figure 24 shows the structure of the data packet.
Data(D001)
0x01
・・・・・・・・
A
C
K
IN
The structure of Data Packet
Data(D002)
0x02
Data(D003)
0x03
Data(D001)
0x01
・・・・・・・・
A
C
K
O
U
T
Data(D002)
0x02
Data(D003)
0x03
or
Data(D064)
0x40
Figure 24 Structure of Data Packet
Data : Data body ( n bytes in binary format)
The range of n is from 1 to 65536 bytes
The field consists of n bytes in binary format, and this product does not perform an error judgment
In the case of Write Access:
This product can continue receiving data from USB host until the USB data length is equal to Len
field of packet command or USB short packet is received.
If the total length of command packet and data packet is less or equal 64bytes, you can send a
combined packet. (The detail is refer to 9.1.3)
In the case of Read Access:
This product keeps on sending data to USB Host until the USB data length is equal to Len field of
packet command.
9.1.3
Structure of Combined Packet
If the data length is less or equal 59bytes, you can combine command packet and data packet. Figure 25
shows the structure of combined packet.
Control
0x01
DevAdr
0x02
RegAdr
0x03
Len(lower)
0x2
Len(upper)
0x00
O
U
T
A
C
K
Data(D001)
0x01
The Structure of Combined Packet
Data(D002)
0x02
Command part
Data part
Figure 25 Structure of Combined Packet
9.1.4 Other
rules
1) Error : Response of error condition
0xFEFF
:
Command Packet Error
0xFFyy : Command Error (yy is the control field in error condition )
2) Bus mastership during the data writing
The I
2
C bus holds low level between each packet. This product does not release the mastership by the
end of writing all data.
3) The length of the command packet
When the length of command packet is less than 5bytes, this product judges an error packet and sends
an error reply.
When the length of command packet is more than 5bytes, this product judges a combined packet.