so just to clarify:
if i have only 1 eeprom chip with a0-2 tied to gnd then the address will be 0xA0 for both read and write operations?
if you run this on the sim you will notice that when you use 0xA0 it say receiving... and then use the 0xA1 then it says transmitting...
that is what happens when i run the code i posted in the 1st post of this thread.
pin6 / 7 i read somewhere on the few hundred posts i have read, so i might be mistaken / have misread.
another sunny cape town morning - and back to the drawing board. will keep u posted.
hi,
Your links to 0V of A0,1,2 are correct for EEprom address '000'.
The EEprom I2C string "I2CWrite sda, scl, 0xa0, addr, data"
0xa0 is the address, in bit format it is: '1010,d3,d2,d1,R/W
So the 0xa is followed by 3 address bits,d3,d2,d1 [able to address up to 8 EEproms] and the least significant bit is the Read/Write bit.,,, Read is '1' and Write is '0'.
I have checked the datasheets for the B.6 & B.7 and I cannot see any reference to not using them for I2C, perhaps other members may know.???
Are you saying the Basic test program I posted is working in a PIC.??? its still connected up here and it works every time.
BTW: Dont use the word 'data' as a standard variable in your programs, MPLAB and OS get confused.
Use 'dta' or 'dat'