View previous topic :: View next topic |
Author |
Message |
shalts
Joined: 20 Oct 2006 Posts: 17 Location: Ankara
|
multiple external eeproms with one pic |
Posted: Sat Feb 24, 2007 8:39 am |
|
|
hi,
what I Am tryign to do is a simple EEPROM copier (24LC65) with LCD.
I connected 2 EEPROMs to my pic. One is A2-A1-A0 = 0-0-0 . And other is A2-A1-A0 = 0-0-1 . And I couldnt manage to change this A2-A1-A0 from the PIC to select which EEPROM I am going to work with .
Anyone has any idea about that ?
Regards ,
Shalt _________________ Murat Shalt Unal |
|
|
SimpleAsPossible
Joined: 19 Jun 2004 Posts: 21
|
Sample code? |
Posted: Sun Feb 25, 2007 7:27 pm |
|
|
You seem to be on the right track. Take a look at EX_EXTEE.C and 2416.C. I found this function in 2416.C:
Code: | void write_ext_eeprom(long int address, BYTE data) {
while(!ext_eeprom_ready());
i2c_start();
i2c_write((0xa0|(BYTE)(address>>7))&0xfe);
i2c_write(address);
i2c_write(data);
i2c_stop();
} |
The IC expects the address as part of the read/write commands. |
|
|
Shalt Guest
|
still working on it |
Posted: Mon Feb 26, 2007 10:18 am |
|
|
Thank you for the reply. It gave me some clues.
From the datasheet of 24LC65 (what I am working with) I understood today as I have to mkae A0=1, A1=0, A2=0 from the hardware and from the software inorder to make A0=1 I have to set the 13th bit of the long int address.
but still couldnt run both of the EEPROMs together yet .
I am going to keep working on it.
regards,
shalt |
|
|
shalts
Joined: 20 Oct 2006 Posts: 17 Location: Ankara
|
Problem Solved |
Posted: Fri Mar 02, 2007 9:57 am |
|
|
Hi there ,
I solved the problem . Everything is working with my EEPROM copier now.
I am going to write the solution soon .
regards&Peace
Shalt _________________ Murat Shalt Unal |
|
|
|