Addressing an eeprom

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
djenn
Posts: 3
Joined: Mon Dec 03, 2012 9:27 am
Has thanked: 1 time

Addressing an eeprom

Post by djenn »

This question is not directly related to Flowcode, but I'm struggeling with this question:
I have an 24C04 eeprom and want to write/read some data , I understand that i have to use a device address to get the eeprom responding to my request.
I only have the slightest idea how to become that adress, is it somewhere in the datasheet or what?
Hope someone can tell me.

dazz
Posts: 1314
Joined: Sun Jan 15, 2012 3:15 pm
Has thanked: 474 times
Been thanked: 458 times

Re: Addressing an eeprom

Post by dazz »

Hi djen

As i understand it the pins 1-2-3 they will be labeled either A0 A1 A2 or E1 E2 E2 for are used to set the device address, so if your using only 1 then these 3 pins should be grounded which gives address 000
so you would need to send

10100000(write)
the 4 bits 7-6-5-4 are 1010 (this tells the i2c bus its looking for the 24c02
the next 3 bits 3-2-1 are 000 (this is the hardwired device address you set earlier
le last bit 0 is 0 (this tells the bus you want to write to the device)
or

10100001 (read)
the 4 bits 7-6-5-4 are 1010 (this tells the i2c bus its looking for the 24c02
the next 3 bits 3-2-1 are 000 (this is the hardwired device address you set earlier
le last bit 0 is (this tells the bus you want to read the device)

those two will be sent as a hex number
so for a read 0xA1 and for a write 0xA0

if your writing you send 0xA0 then you would send the data address you want to write to the you would send the data, for a read you would send 0XA1 and the address you want to read from

As this is not flowcode related i cant offer anymore help but that should get you started

Regards
Dazz
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php

Post Reply