I have very strange problem in my circuit. Namely, I have 24LC01 EEPROM connected to my PIC32. I made "library" for reading from and writing to the memory. What is happening is that only first reading of data gives me correct data, while every later attempt gives me wrong data. The experiment is following. I wrote one page with 0x30 (0 Ascii character), so from address 0 - 7. Next I read 8 bytes starting from address 0. First reading is correct and I print 00000000. Next attempt to read fives me 0 and 7 unknown characters. This happens in the same manner until MC is restarted.
Here are some waveforms.
On the first wave, you can see that control word is sent, it was ACKed by the slave, then comes the memory address at which to start, in this case 0. Then comes ACK and repeated start event. Next, control word is sent again, but this time with reading flag set. After follows first charcter 0x30, and so on, till the 8th.
At the end if the first reading attempt, you can see that NACK after the last byteis sent, followed by the STOP condition on the bus.
Next, you can see start of communication of the second attempt. First control word is sent correct and was ACKed. Next came address where the data should be read from (again 0), it was also ACKed. Next master sends repeated reading command, and the second control word with reading flag set (btw address of the device is 1010xxx). The second control word was also ACKed, and the came first byte from the memory location 0, which is 0x30 and as you can see it is also ok, but at the end of that byte SDL goes high and stays there till the end of the reception.
On the next photo is shown the end of the wave. As you can see SDL was always high, and only STOp condition is sent at the end.
What might be the problem here?