Maybe you'll find some good info at the following
http://www.picbasic.co.uk/forum/showthread.php?t=1453&
Just make sure your pull-ups are ~=1.8K
all EEPROMs A<2:0> pins goes somewhere
all EEPROMs WP pins are connected to GND, and it should work.
I just tried something like this with a 16F88 and 2 X 24LC64
Code:
<font color="#000000"> <font color="#000080">ASM
LIST W=-207
cfg1 = _INTRC_IO & _WDT_OFF & _PWRTE_ON & _MCLR_ON & _BODEN_ON & _LVP_OFF & _CCP1_RB0
cfg2 = _CP_OFF & _CPD_OFF & _WRT_PROTECT_OFF & _DEBUG_OFF
__CONFIG _CONFIG1, cfg1 & cfg2</font>
<font color="#008000">; Program Configuration Register 2
</font><font color="#000080">__CONFIG _CONFIG2, _IESO_OFF & _FCMEN_OFF
ENDASM
</font>OSCCON=%01110000 <font color="#008000">' 8mhZ
</font><font color="#000080">DEFINE </font>OSC 8
PORTA = 0
PORTB = 0
TRISB = 0
TRISA = 0
ANSEL = 0
CMCON = 7
<font color="#000080">DEFINE </font>HSER_RCSTA 90h <font color="#008000">' Enable serial port & continuous receive
</font><font color="#000080">DEFINE </font>HSER_TXSTA 20h <font color="#008000">' Enable transmit, BRGH = 0
</font><font color="#000080">DEFINE </font>HSER_SPBRG 12 <font color="#008000">' 9600 Baud @ 8MHz, 0.16%
</font><font color="#000080">DEFINE </font>HSER_CLROERR 1 <font color="#008000">' Clear overflow automatically
</font>SCL <font color="#000080">VAR </font>PORTB.0
SDA <font color="#000080">VAR </font>PORTB.1
EEP1 <font color="#000080">CON </font>%10100000 <font color="#008000">' First EEPROM A<2:0>=Gnd
</font>EEP2 <font color="#000080">CON </font>%10100010 <font color="#008000">' Second EEPROM, A<2:1>=Gnd, A0=Vcc
</font>Addr <font color="#000080">VAR WORD
</font>ByteA <font color="#000080">VAR BYTE
</font>ByteB <font color="#000080">VAR BYTE
PAUSE </font>50
<font color="#000080">HSEROUT </font>["Programming...",13,10]
<font color="#000080">FOR </font>Addr=0 <font color="#000080">TO </font>10
ByteA=Addr
<font color="#000080">I2CWRITE </font>SDA,SCL,EEP1,Addr,[ByteA]
<font color="#000080">PAUSE </font>10
ByteA=Addr+20
<font color="#000080">I2CWRITE </font>SDA,SCL,EEP2,Addr,[ByteA]
<font color="#000080">PAUSE </font>10
<font color="#000080">NEXT
HSEROUT </font>["ADDR EEP1 EEP2", 13,10]
<font color="#000080">FOR </font>Addr=0 <font color="#000080">TO </font>10
<font color="#000080">I2CREAD </font>SDA,SCL,EEP1,Addr,[ByteA]
<font color="#000080">I2CREAD </font>SDA,SCL,EEP2,Addr,[ByteB]
<font color="#000080">HSEROUT </font>[<font color="#000080">DEC </font>Addr," ",_
<font color="#000080">DEC </font>ByteA," ",_
<font color="#000080">DEC </font>ByteB,13,10]
<font color="#000080">NEXT
</font>@ <font color="#000080">GOTO </font>$
and the output is...
Code:
Programming...
ADDR EEP1 EEP2
0 0 20
1 1 21
2 2 22
3 3 23
4 4 24
5 5 25
6 6 26
7 7 27
8 8 28
9 9 29
10 10 30
Bookmarks