R8C/3MK Group
USB-to-Serial Communication Conversion Demo Board
R0K5R8C3MDU30BR Instruction Manual
R01AN1051EJ0100 Rev.1.00
Page 29 of 38
Mar 21, 2012
10.1.2
The Structure of Data Packet
The data length is n bytes according to the connected SSU 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 31 shows the structure of Data packet.
Data(D001)
0x01
・・・・・・・・
The structure of Data Packet
Data(D002)
0x02
Data(D003)
0x03
Data(D001)
0x01
・・・・・・・・
Data(D002)
0x02
Data(D003)
0x03
or
Data(D064)
0x40
O
U
T
I
N
A
C
K
A
C
K
Figure 31 The 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 10.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.
10.1.3
Structure of Combined Packet
If the data length is less or equal 59bytes, you can combine command packet and data packet.
Figure 32shows the structure of combined packet.
Control
0x00
Dummy
0x00
Instruction
0x03
Len(Lower)
0x2
Len(Upper)
0x00
Data(D001)
0x01
The structure of Combined Packet
Data(D002)
0x02
Command part
Data part
O
U
T
A
C
K
Figure 32 The structure of Combined Packet
10.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 SCS signal 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 control command packet is less than 5bytes, this product judges an error packet
and sends an error reply.
When the length of Write Access command packet is more than 5bytes, this product judges the packet
as a combined packet.
When the length of Memory Read/Write command packet is other than 7 bytes, this product judges an
error packet and sends an error reply.