2012-11-28 09:22 PM
2012-11-29 12:36 AM
Hello all,
I did observe this while testing. I am able to generate start condition, (SB is set) and when i send the address , i get Acknoweledge failure. Could any one let me know what might be the cause for this. Or is there any problem with my code. Thanks2012-11-29 02:25 AM
I did observe this while testing.
Good idea....and when i send the address , i get Acknoweledge failure.
You probably mean, SDA stays high while the 9.th SCL clock. Just for reference, make sure you measure all signals at least once ALSO on the slave side, i.e. on the pins of your sensor IC. Your sensor might not feel addressed. I2C addresses are often specified as 7 bit, while the LSB is used to differ between read and write access. Some specs. implicitly assume you to left-shift this value by one bit. Check this with the address you see on the bus.
2012-11-29 04:05 AM
2012-11-29 04:27 AM
I2C needs the pins in Open-Drain (OD) not Push-Pull (PP)
If the I2C is BUSY someone on the bus is driving it LOW.2012-11-29 04:45 AM
Is this a clock issue or timing?
Not obviously, albeit you use an undisclosed define I2C_SPEED. I would start with standard speed. But I would check the address first. Is 0x40 the correct address of the sensor (TI wouldn't let me see the datasheet...) ? Is it specified there as 7 bit or 8 bit value ? And using the scope, you should see the address you are sending in the bus.2012-11-29 05:01 AM
Thanks
I am using 2MHz . 7 bit address with a bit inteded to read or write is what is given in the data sheet2012-11-29 05:35 AM
Is it possible to watch the data i send on SDA in GPIO to which it is connected?
If yes, i cannot see any thing in my ODR register, its always 0.2012-11-29 05:55 AM
Is it possible to watch the data i send on SDA in GPIO to which it is connected?
No, no way I know of. i2c is a serial protocol, the value written to the data register is serialized by the i2c peripheral, and streamed out over SCL/SDA. You will need a scope to see what actually happens on the bus. And, as said, I would start with 100kHz (i2c ''standard'' speed).
2012-11-29 06:19 AM
Thanks
Il check with it and get back if the problem still persists.