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.

What is the conveniant way of retrieving i2c eeprom?

Status
Not open for further replies.
actually i can read and write the external eeprom :)

the problem i face is that

I CANNT get a value by specifying the varible name. instead, i have to supply memory address for that.

for example, i cannt read a value by simply writing
printf("%u", variable_name");
instead, i have to KNOW the address of the content in ADVANCE!.

What is the conventional way of retrieving data from eeprom?
 
janetsmith2000@yahoo.com said:
I CANNT get a value by specifying the varible name. instead, i have to supply memory address for that.

for example, i cannt read a value by simply writing
printf("%u", variable_name");
instead, i have to KNOW the address of the content in ADVANCE!.

What is the conventional way of retrieving data from eeprom?

The conventional way is reading it from the address you stored it at, an EEPROM is just a serial access memory chip - if you want to access it in some other way you would need to write some kind of access scheme - rather like a DOS or file system.

Generally knowing the addresses isn't a problem, and if you wanted to use labels for the addresses you could use equates for them.
 
hmm...
variable is stored in RAM
not in external eeprom

you could define an address to a variable
#define A 0xffff
then implement i2c read function
i2c_read(A)

overall, it could be written in this way
printf(i2c_read(A));
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top