2015-02-16 01:52 AM
Hey everyone,
I am trying to get the Device ID of an I2C connected image sensor for our project but somehow the value keeps returning 0x00. I did recieve the Device ID (0xA0) a couple of times but could not do so once I turned off the sensor and turned it back on. I read in one of the I2C related forum that the ground might be an issue, so changed that too using a single source supply instead of the double source I was using before. No change. I placed some external resistors and experimented with it too, same. I need a couple of pictures to explain what I have managed to sniff out from the oscilloscope so far but the problem with this forum is that the image size is limited to 100kb which, frankly, is really annoying as my resized picture ends up coming at around 130kb. Any smaller than that, the text in the picture are unreadable.I am really sorry, but I have posted the question up in blogger to allow me to illustrate the problem properly.If you have any other suggestions, feel free to let me know how I can put forth the question. Here's the link to the post:http://www.madeinepal.com/2015/02/stm32-forum-question-proxy-link-i2c.html
If you feel like you can help me out, please do reply here so that people with similar issues might benefit later on.2015-02-16 05:00 AM
Hi,
What you need to care is that some devices have a startup time after power up. If you try to contact the device during this time, the device could hang until the next power up. If this happen, you get always garbage.Next: your I2C clock is 100KHz. It could be that you are below the min frequency for clock. Check that with data sheet.Next: the rising time of your clock is ~1µs. Use 470R or 220R pullups. It could be a problem of rising time of data and clock.Next: Your protocol says: Either S-Adr-W-A-RegAdr-A-Data-A-P or S-Adr-W-A-RegAdr-A Sr-Adr-R-A-Data-NA-P but you sendS-Adr-W-A-RegAdr-A Sr-Adr-W-A-Data........Your second write seems to need and stop before. because after restart follows a read cycle and not a write cycle. Double check that with your data sheet.I hope it helps.Mehrdad