ISSUE READ AND WRITE AT24C32 WITH PIC18F45K80

hi, i try to read and write to at24c32 memory/ i am using pic technology. and every data that i read is 0xff. i cant read from the memory. please check my program. i have two version:

ver 1: StartI2C(); WriteI2C( 0xa0 | 0x00 );//MEMORY I2C ADDRESS IdleI2C(); StartI2C(); StopI2C();

StartI2C(); WriteI2C( 0xa0 | 0x00 ); IdleI2C(); WriteI2C( 0x00); IdleI2C(); WriteI2C( 0xff); IdleI2C();

WriteI2C(0x12); IdleI2C();

StopI2C();

StartI2C(); WriteI2C( 0xa0 | 0x00 ); IdleI2C(); WriteI2C( 0x00); IdleI2C(); WriteI2C( 0xff); IdleI2C(); WriteI2C( 0xa0 | 0x01 ); IdleI2C();

data=ReadI2C();

StopI2C(); ver 2: StartI2C(); WriteI2C( 0xa0 | 0x00 );//MEMORY I2C ADDRESS IdleI2C(); StartI2C(); StopI2C();

StartI2C(); WriteI2C( 0xa0 | 0x00 ); IdleI2C(); WriteI2C( 0x00); IdleI2C(); WriteI2C( 0xff); IdleI2C();

WriteI2C(0x12); IdleI2C();

StopI2C();

StartI2C();

WriteI2C( 0xa0 | 0x01 ); IdleI2C();

data=ReadI2C();

StopI2C();

ISSUE READ AND WRITE AT24C32 WITH PIC18F45K80

Why are you shouting?

How to use this forum

Your code does not compile.

Please use code tags.

Read this before posting a programming question

Please edit your post, select the code, and put it between [code[/code] tags.

You can do that by hitting the “Code” icon above the posting area. It is the first icon, with the symbol: </>

i am using pic technology.

Then a Pic forum would be where to ask your question. Arduino != Pic;