STM32 Forum Question Proxy Link [I2C weird read value return in STM32F429I Disco]

My post in the stm32f forum can be reached here: 

I2C weird read value return in STM32F429I Disco
[HERE]

[Please refresh the page if the full post doesn't show up]

If you are here, it's probably because I couldn't post the question up in stm32 forum and instead, had to rely on my blog to put forth my query properly. The forum does not allow me to post pictures more than 100kb and since making the image smaller brought in some ambiguity to the text in the picture, I have posted them up here. Apologies for that.  

Here's the hardware connection:


Since taking this picture, I bought a voltage regulator for 1.8V supply as well so that the ground is coming out from the same source. I read somewhere that the I2C value read return 0x00 is likely because of 1)Ground issues and 2)External resistors. I have added 4.7k to the SDA and SCL lines but no avail. Tried out with 1k and 10k resistors as well but the result's the same.

As you can see, I try to read Device ID I, Device ID 2 and Rev no. but somehow i always get the value 0x00. 



The read process of the image sensor is given here (cannot upload the whole document because of copyright issues) First the register group has to be accessed and then moved on to the actual register.

The Read/Write protocol for the camera is pretty straight forward as well.


Following what the datasheet says, I sniffed out the SDA and the SCL (bot) lines. This is for the write slave address (7+1 bit). This looks fine.

After that the register address sent to the slave (0x03 hex). the oscilloscope confirms. 


I then wrote the 0x00 value, as the document suggests. The oscilloscope confirms that.

With the first part of  the read instructions [Write 0x00 to 0x03] done, we now move on to Read part 


The read sequence asks us to first write the slave address to the register 0x00 (device_ID) and restart and then read out from the device_ID after sending the "read" 8 bit slave address. The weird looking signal is likely from read restart. 

As you can see, I first sent the write address and then the register 0x00 that I wanted to read from. After this part, the oscilloscope didn't respond to any triggers and couldn't sniff out after the portion highlighted above. 



There were times, however, using the same code I was able to receive the correct device_ID but somehow after turning the power off and on, I would not get the same result but get the boring 0x00 value again. 

If you think you can help me, please do reply back in the forum so that people might refer to it later

Thanks. 

Comments

Popular Posts