User Guide
User Guide
©2008-2020 Seeed Technology Co., Ltd. All rights reserved. solution.seeedstudio.com
12 / 21
Slave
address
0x01
Functio
n Code
is 3
Returns
16
bytes
of
register
data
Returns
the
value
of
register
0x0000
Returns
the
value
of
register
0x0001
Returns
the
value
of
register
0x0002
Returns
the
value
of
register
0x0003
Returns
the
value
of
register
0x0004
Returns
the
value
of
register
0x0005
Returns
the
value
of
register
0x0006
Returns
the
value
of
register
0x0007
CRC
check
4.4.2 Example of Function Code 6
Request: AA 06 RRRR NNNN CCCC
AA
06
RRRR
NNNN
CCCC
1 Byte
1 Byte
2 Bytes
2 Bytes
2 Bytes
Slave address,
range 0-247
Function Code is 6
Write to the
register address,
high byte first
Write the value of
the register, high
byte first
CRC check
Response: AA 06 RRRR VVVV CCCC
AA
06
RRRR
VVVV
CCCC
1 Byte
1 Byte
2 Bytes
2 Bytes
2 Bytes
Slave address,
range 0-247
Function Code is 6
Write to the register
address, high byte
first
Write the value of
the register, high
byte first
CRC check
For example: Write register 0x0010 and modify the slave address of the device to 0x02.
Request: 01 06 0010 0002 09CE
01
06
0010
0002
09CE
1 Byte
1 Byte
2 Bytes
2 Bytes
2 Bytes
Slave address,
range 0-247
Function Code is 6
Write to the register
address, high byte
first
Write the value of
the register, high
byte first
CRC check
Response: 01 06 0010 0002 09CE
01
06
0010
0002
09CE
1 Byte
1 Byte
2 Bytes
2 Bytes
2 Bytes
Slave address,
range 0-247
Function Code is 6
Write to the register
address, high byte
first
Write the value of
the register, high
byte first
CRC check