Hi Kai,
Thanks for your response.
I think either the datasheet for the EEPROM is incorrect, or I am doing something really stupid, but I do not see what it says I should be seeing.
e.g.
On page 14 (
http://ww1.microchip.com/downloads/en/DeviceDoc/21754M.pdf) it suggests that for each byte that I send to the EEPROM, it should ACK back - which is SDA low while SCL is high?
On my scope I see the opposite - I see SDA high while SCL is high which means NAK? This is the case for all 3 of the bytes that I send to the EEPROM (control work and high and low address bytes).
Ive also modified my code to send an initial control word with the read/write bit set low initially for write, followed by the high/low address bytes, then a restart, followed by the control word again but with the read/write bit high for read (that seems to be the suggested sequence per the datasheet, although it was working before anyway....). Each byte I want to receive is then communicated by me sending an ACK and that seems to be working just great.
So hmm, not sure. I think maybe the EEPROM doesnt operate correctly perhaps? It seems to be sending NAKs when it should be sending ACKs (you see in between the cursors, SDA is high but the datasheet says it should be low)? But my PIC does seem to detect the acknowledge condition seemingly correctly otherwise I think some of my loops would wait forever. Im totally confused.
Perhaps I will order some other EEPROMs and see whether the behaviour is the same or different.
Tom