hi iam about to try and connect a 24lc256 to my pic 16f877a and am going to use the ccs 24256 driver but i have a copule of questions as this is my first a temp using this ic.
(1) using the ccs driver can i use port e by changing the pins defined at the top of the 24256 driver .
(2)can anyone point me in the right direction for some schematics to connect it up as the datasheet does not seem to give any appliction notes
many thanks for any help
sjbaxter
Joined: 26 Jan 2006 Posts: 141 Location: Cheshire, UK
Posted: Wed Mar 01, 2006 10:16 am
The driver should work by redefining the PIN_xx used for each of the control and data lines.
For a schematic, have a look at the microchip application note:
///////////////////////////////////////////////////////////////////////////
//// Library for a 24FC515 serial EEPROM ////
//// ////
//// write_ext_eeprom(a, d); Write the byte d to the address a ////
//// ////
//// d = read_ext_eeprom(a); Read the byte d from the address a ////
//// ////
//// The main program may define eeprom_sda ////
//// ////
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
#define EEPROM_ADDRESS long int
#define EEPROM_SIZE 65535
// Change this variables !!!
const int Write_Adress_24AA515 = 0xA0;
const int Read_Adress_24AA515 = 0xA1;
BOOLEAN Ext_Eeprom_Ready() {
int1 ack;
i2c_start(); // If the write command is acknowledged,
ack = i2c_write(Write_Adress_24AA515); // then the device is ready.
i2c_stop();
return !ack;
}
void Write_Ext_Eeprom(long int address, int data) {
i2c_start();
if (!i2c_write(Write_Adress_24AA515)) {
if (!i2c_write(address>>8)) {
if (!i2c_write(address)) {
if (!i2c_write(data)) {
}
}
}
}
i2c_stop();
while (!Ext_Eeprom_Ready());
}
int Read_Ext_Eeprom(long int address) {
int data;
//while (!Ext_Eeprom_Ready());
Delay_ms(1);
i2c_start();
if (!i2c_write(Write_Adress_24AA515)) {
if (!i2c_write(address>>8)) {
if (!i2c_write(address)) {
i2c_start();
if (!i2c_write(Read_Adress_24AA515)) {
data=i2c_read(0);
i2c_stop();
}
}
}
}
return(data);
}
_________________ *** A good forum is a forum where people respect eatch other ! ***
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum