From: Dave H. <dhy...@gm...> - 2011-01-15 07:17:50
|
Hi Vaibhav, On Fri, Jan 14, 2011 at 8:03 PM, VaibhavGhadiok <vai...@gm...> wrote: > Hi Dave, I used an Arduino Diecimila w/ Atmega168, with the 5V->3.3V I2C > converter from sparkfun and the camera worked fine. The code for the Arduino > is actually much simpler than what I posted which was for a different > processor setup, the code I used is below. I took pictures of the SDA lines > on an oscilloscope (best I had at the moment) for both reads and writes > using the Arduino and the Gumstix. Device address - 0x58. The read command > is for register 0x37, with value meant to be 0xFF 0xFF 0xFF (3 registers > read at once). Write command is for address 0x30, value of 0x01 to write. It > looks like there's some clock skewing going on for both processors, so it's > hard to really tell how many same bits there are in a row, but I can't seem > to find anything suspect with the Gumstix read except that it doesn't get an > ack. Without the clock, it's hard to tell exactly where the bit transitions are. The bit widths don't have to be contant with i2c. Either side is allowed to stretch the clock. Given that the camera is not sending back ACKs suggests that the camera is in fact using SCCB rather than I2C. SCCB specifically treats the ACK bit as a don't care bit. The missing ACK is what's messing up the gumstix. You'd need to bit bang some GPIOs instead of using th i2c HW to read the registers from the camera. Dave Hylands |