2016-11-25 12:35 AM
I have a slave device which is address 0x78 for write and address 0x79 for read.
I want to confirm that why the below I2C transaction is difference?I want to reset the slave device and the mapping register information as the below shown.Reset register (R/W)register address:0x3008register default value:0x021.The return data=0x00 is success when the address doesn't shift left 1bit#define OV5642_DEVICE_WRITE_ADDRESS 0x782016-11-25 04:43 AM
This is an often recurring confusion resulting from the unfortunate way how the I2C address is defined. Quoting from the specification, UM10204 rev.6, ch.3.1.10 ''The slave address and R/W bit'':
After the START condition (S), a slave address is sent.
This address is seven bits long followed by an eighth bit which is a data direction bit (R/W) [...]
So, the definition of address is 7 bits, in your case 0x3C. From that, you construct the first transmitted byte so that you left-shift it by one and then add the read/write bit. The problem is, that some people don't read the specification, or don't understand it, or take inappropriate shortcuts. So then you have datasheets incorrectly specifying ''read and write address'' which is the case here; and you have functions which incorrectly expect ''shifted address'', which is again the case here, coincidentally matching in their incorrectness... JW
2016-11-27 07:08 PM
Dear JW:
Thanks for your responsed and the I2C can work after I stuied the RM0090 and the F427's spec. for I2C.Now, the I2C can access our device.