Hi everyone. I am trying to simply interface a 12F629 with an external eeprom (24AA00) using PicBasic Pro's I2CWrite and I2CRead commands. However, it never seems to interface correctly. My circuit looks like this:

.................................................. ................
.................+5V.....1...8.....GND............ ....... 12F629
..................LED.....2...7.....--------------|......
..................LED.....3...6.....----------|....|......
.....+5V-->1k-->.....4...5...................|....|......
.................................................. ...|....|.....
.................GND.....1...8.....+5V.........|.. ..|..... 24AA00
.................GND.....2...7.....GND.........|.. ..|......
.................GND.....3...6.....----------|....|......
.................GND.....4...5.....--------------|......
.................................................. ................

Where SDA Pin7-->Pin5 and SCL Pin6-->Pin6
Also, I have a 4.7k resistor connected from +5V-->Pin6 on the 24AA00 to act as a pullup. Same thing for Pin5 on the 24AA00.

My code is very simple too. It is below:

value var byte
I2CWrite GPIO.0,GPIO.1,$A0,1,[3]
pause 20
I2CRead GPIO.0,GPIO.1,$A1,1,[value]
pause 20
if value=3 then
high 5
else
high 4
endif
End

This will simply write to the eeprom and read back from it. If it reads back the value it wrote, then the LED5 should turn on, if not, the LED4 should turn on. It only ever turns on LED4. I am not sure what the problem is. I have tried many many things, but nothing has worked. Please let me know what your thoughts are. Thankyou very much.



Chris

P.S. - Miscellaneous Information:
Programmer: IC-Prog 1.05C
Fuses: WDT, PWRT, MCLR, BODEN
Bandgap: Default
Oscillator: IntOSC GP4
Adding CMCON=7 doesn't seem to matter
Sending a word instead of a byte doesn't seem to matter