'How to write to a 16-bit I2C address using i2cset

Trying to write a byte to a 16-bit address on an I2C device (OV5640 camera) using i2cset. I can successfully read from the device registers using the following sequence (read byte from device address 0x3c and register address 0x3030):

i2cset -v -f 1 0x3c 0x30 0x30
i2cget -v -f 1 0x3c

To write to the device, I use this sequence (write byte 0x40 to device address 0x3c and register address 0x3030):

i2cset -v -f 1 0x3c 0x30 0x30
i2cset -v -f 1 0x3c 0x40

This sequence does not show any errors but when the address is read again, the value is unchanged. Can anyone provide any insight on the correct i2cset syntax to use when writing to this device?

i2c


Solution 1:[1]

SOLVED! I found the solution for this and it requires using the i2cset block write option (i) as follows:

i2cset -y -f 2 0x3c 0x30 0x30 0x40 i

This command writes the value 0x40 to register address 0x3030 at device address 0x3c.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 phuclv