I have problem with i2c communication.
At begining of main() I initialize i2c and read RTC DS1337 and my program gets stuck. SCL and SDA are toggling.
Datasheet says (http://datasheets.maximintegrated.com/en/ds/DS1337-DS1337C.pdf):
The I2C interface is accessible whenever VCC is at a valid level. If a microcontroller connected to the DS1337 resets while reading from the DS1337 during an I2C read, the two could become unsynchronized. The microcontroller must terminate the last byte read with a Not-Acknowledge (NACK) to properly terminate the read. When the microcontroller resets, the DS1337 I2C interface may be placed into a known state by toggling SCL until SDA is observed to be at a high level. At that point the microcontroller should pull SDA low while SCL is high, generating a START condition.
Not all chips datasheets say what to do if i2c becomes unsynchronized.
What do you guys do in such situations?
Thank you !