Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Reading and writing from eeprom

Status
Not open for further replies.
I have just started using eeprom and I need to write and read using i2c. I studied that address of slave to be sent , but I don't understand how to get the address of eeprom? Is it a standard? Will it be same for all eeprom memory irrespective of size?
 
If it's a 24LCxxx series, you set the address using pins A0-A2. If you're only using one, ground all 3 pins. With this setup, 0xA0 is your write address while 0xA1 is your read address.

To read the EEPROM you first send the start bit, then the write address 0xA0 (keep sending while checking for acknowledge until you get a slave acknowledge), then two octets that represent the memory location you wish to read. Then resend the start bit, send the read address 0xA1, then initiate I2C receive. After receiving the byte from EEPROM, send a NACK bit, then send the stop bit.
 
I have just started using eeprom and I need to write and read using i2c. I studied that address of slave to be sent , but I don't understand how to get the address of eeprom? Is it a standard? Will it be same for all eeprom memory irrespective of size?
Normally yes! I2C Eeprom are all addressed 0x50 ( 7 bit ) the eight bit is read write... S0 0xA0 = Read and 0xA1 = write..

But as Jon said there is an external address for multiple devices... You can have up to 2Mbit...

Devices with 16 bit addressing--
8 * 32Kbit --> all externally addressed . 24LC32a
8 * 64Kbit --> all externally addressed . 24LC64
8 * 128Kbit --> all externally addressed . 24LC128
8 * 256Kbit --> all externally addressed . 24LC256
4 * 512Kbit --> each chip has two sections . 24LC512
2 * 1Mbit --> each chip has four sections .
Devices with 8 bit addressing are all different.. There are datasheets available for each.

The 16Kbit is a solo device as the A1, A2 and A3 are used internally to select the block!!

8, 4 and 2 Kbit are normally 16bit ( word ) the word pointer ( wrongly phrased ) is the address counter and is 8 bit.

This information is only for I2C devices... EEprom is also available in parallel and in an SPI variant..

Also other manufacturers tend to change devices from time to time..
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top