Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] how to address an eeprom...

Status
Not open for further replies.

Sudhp

Member level 4
Member level 4
Joined
Oct 11, 2013
Messages
69
Helped
0
Reputation
0
Reaction score
0
Trophy points
6
Location
India
Visit site
Activity points
528
hii.

I am working on EEPROM 24c16.......
my programming to write a byte to EEPROM is....(download from net)
Code:
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();
	}


I just wanna know how addressing of word address is done ?....
and how much data I can store to this word address....
and how can I address next word address(if possible).........
 
Last edited by a moderator:

Hello!

Answer of all of the above questions are present in datasheet.:|

Enjoy!!!

Hii babar...
I don't get u.....
what r u exactly wanna say......

- - - Updated - - -

You have to send 2 bytes for address if larger eeproms are used. Send address byte, send data address high, send data address low...

Thanks...
I exactly wanna know about this line....

send_byte(0x00); //word address
aknowledge();

why this line is used.....and it holds which address.....
 

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.
 
  • Like
Reactions: Sudhp

    Sudhp

    Points: 2
    Helpful Answer Positive Rating
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.

Thanks for reply......
but 0xA0 is also used for the device address(studied at net)
as 1 0 1 0 A1 A2 A3 R/W (r/w=0 for write operation and r/w=1 for read )
here A1,A2,A3 r zero...
so device address is 0xA0.....
if 0x00 is used for device address thn why 0xA0 is used....
waiting for reply.......thanks again
 

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).
 

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).

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 )
 
  • Like
Reactions: Sudhp

    Sudhp

    Points: 2
    Helpful Answer Positive Rating
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 )

thanks.....

- - - Updated - - -

EEPROM store the data in hex format......
when we take the data from eeprom then data has which format......
 

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.
 
  • Like
Reactions: Sudhp

    Sudhp

    Points: 2
    Helpful Answer Positive Rating
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.


I have to know about these things.....
can u suggest me any book or send me any link......
 
Last edited:

Refer to books

"8051 Microcontroller and Embedded Systems: Using Assembly and C"

"PIC Microcontrollers and Embedded Systems: Using Assembly and C"

"AVR Microcontrollers and Embedded Systems: Using Assembly and C"

by Muhammad Ali Mazidi and others.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top