Hi Guys,
I seem to be able to READ ok with I2CREAD,
but I'm having difficulty with my program, and I've narrowed it down to I2CWRITE.
I'm using a 24LC512 EEPROM, and I've also tried 256.
Code:
W0 var byte
epin var word
W0 = 0
FOR cntr = 0 TO 2000 '
I2CWRITE porte.1,porte.2,%10100000,epin,[W0,W0,W0,W0,W0],error '
pause 10 '
epin = epin + 5 '
NEXT cntr '
It would seem this code should write a lot of zeros, but when I read back the chip
there are some missing.
I have erased the EEPROM with my programmer which sets all $FF values,
and then run this code, then I find when I read back the EEPROM with my
pic programmer (or with picbasic code) there are some zero bytes.
They appear to be in groups of 2 or 3 bytes at addresses like:
100h, 180h, 200h, 280h, 300h, 380h, and so on.
Any ideas on this? Anyone else seen the same problem?
I'm using a 16F877A and Port e 1&2 to do the I2C stuff.
Art.
Bookmarks