void save() //save in EEPROM
{
start();
send_byte(0xA0); //device address
aknowledge();
send_byte(0x00); //word address
aknowledge();
//send data
send_byte(hour1);
aknowledge();
send_byte(min1);
aknowledge();
send_byte(sec1);
aknowledge();
send_byte(hour2);
aknowledge();
send_byte(min2);
aknowledge();
send_byte(sec2);
aknowledge();
stop();
}
Hello!
Answer of all of the above questions are present in datasheet.:|
Enjoy!!!
You have to send 2 bytes for address if larger eeproms are used. Send address byte, send data address high, send data address low...
This is the device address. The eeprom will have three address pins A0, A1, A2. If they are all grounded then address is 0b000 and it is written as 0x00. It is device address and not address of memory location.
The memory size of the 24C16 is 16k bits (!) which makes 2k bytes. They are organised in 128 pages with 16 bytes each. The upper three page address(A0..A2) bits are transferred together with the slave address (which is 0xA0 for writing and 0xA1 for reading).
Sorry, address byte is sent in this format. 1 0 1 0 A1 A2 A3 R/W.
Thanks for the reply.....
24c16 has 2 K bytes memory space.....
can I use all 2 K byte space using same program....
Connect another eeprom A0 to +5V and A1 and A2 to ground so it willl have value 0x01
Use address bytes
1 0 1 0 A0 A1 A2 R/W (r/w=0 for write operation and r/w=1 for read )
1 0 1 0 A0 A1 A2 R/W (r/w=0 for write operation and r/w=1 for read )
1 0 1 0 1 0 0 R/W (r/w=0 for write operation and r/w=1 for read )
1 0 1 0 1 0 0 R/W (r/w=0 for write operation and r/w=1 for read )
All data are stored in binary format. You can wrote data as binary, hex, decimal in your program. when data is written to eeprom memory cells turn ON or OFF depending upon the bit value.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?