what you suggest for managing eeprom space to store all kind of data?

Go To Last Post
22 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hi

i have 64KB eeprom

i want to store 20 user info on it and what each one of them does and save some information in it like saving some cars with their id and name and say this car is for who  and so on .

do u have any suggestion for managing eeprom space for a complicate project that i want store allot of data?

i can write to eeprom 32 Byte per write

thanks 

 

This topic has a solution.
Last Edited: Wed. Sep 20, 2017 - 11:01 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In that case the table of structs is a natural solution. Eventually two tables: one with persons, second with data for it. Think about it as about database and construct data structures as in dabase.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awit wrote:

In that case the table of structs is a natural solution. Eventually two tables: one with persons, second with data for it. Think about it as about database and construct data structures as in dabase.


It's more complicated than that.
There is allot of data . Person and car is two of them
Maybe I need genius idea I think.and maybe I'll manage it manual manual and with calculator of Windows to address everything

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yet again, this is where a proper, up-front analysis of the requirement is key.

 

Define exactly what data you need to store.

 

Design data structures to accommodate that.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:

Yet again, this is where a proper, up-front analysis of the requirement is key.

 

Define exactly what data you need to store.

 

Design data structures to accommodate that.

thanks

if i have some device with pc program that can read all eeprom data and show it to me in pc software in proper manner it would be awesome

do u know any?

i use 24Cxx as eeprom and maybe i need device that read eeprom data from I2C

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A bus pirate will read a write serial eeproms. There's also cheapy chinese modules based on the ch341 that do it as well. If your PC has a real printer port there are programs to read/write serial eproms methinks. Google is your friend.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

FTDI Application Note AN_113, "Interfacing FT2232H Hi-Speed Devices To I2C Bus" illustrates reading an EEPROM from a PC using their FT2232H chip.

 

http://www.ftdichip.com/Support/Documents/AppNotes/AN_113_FTDI_Hi_Speed_USB_To_I2C_Example.pdf

 

I'm sure google will find plenty of others for you ...

 

They will cover getting the data from the EEPROM to your PC.

 

Clearly, only you know your data format - so you are going to have to write the code that interprets it.

 

But interpreting the data should be entirely platform-independent - so the same code should be usable on the PC and the embedded microcontroller ...

Last Edited: Wed. Sep 20, 2017 - 08:06 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

navidrct wrote:
i use 24Cxx as eeprom
in which case when you say:

navidrct wrote:
i have 64KB eeprom
is that really 64 Kilobits or 64 Kilobytes? A 24C64 is really just 8KB of storage (64kb). To get 64KB of storage you need a 512kb part - the 24C512
navidrct wrote:
It's more complicated than that. There is allot of data . Person and car is two of them
I still don't see why that precludes a table of structs? If there really is 64KB and you need to hold 20 records (for ease of maths lets call it 32 to be generous) then you have 2KB per record. So you can easily do something like:

typedef struct {
    char name[80];
    int age;
    int birth_year;
    int birth_month;
    int birth_date;
    char car_make[50];
    char car_model[50];
    etc.
} record_t;

So far that is just 188 bytes per record out of a possible 2048.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:
A bus pirate will read a write serial eeproms. There's also cheapy chinese modules based on the ch341 that do it as well. If your PC has a real printer port there are programs to read/write serial eproms methinks. Google is your friend.

thanks

maybe if there is a pc program like pc logic analyzer software it would be great for someone that wanted to use EEPROM

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:

FTDI Application Note AN_113, "Interfacing FT2232H Hi-Speed Devices To I2C Bus" illustrates reading an EEPROM from a PC using their FT2232H chip.

 

http://www.ftdichip.com/Support/Documents/AppNotes/AN_113_FTDI_Hi_Speed_USB_To_I2C_Example.pdf

 

I'm sure google will find plenty of others for you ...

 

They will cover getting the data from the EEPROM to your PC.

 

Clearly, only you know your data format - so you are going to have to write the code that interprets it.

 

But interpreting the data should be entirely platform-independent - so the same code should be usable on the PC and the embedded microcontroller ...

thanks allot 

i just want PC software that have a table taht show hexa number that i save in eeprom

there is allot of hardware that can convert usb to i2c for reading the eeprom . i just want pc software

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This is an AVR forum?!? Surely the intention here is that you are going to connect the 24Cxx to an AVR? If so then why doesn't the AVR get to do the writing and reading? Why is a separate programming device required?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:

navidrct wrote:
i use 24Cxx as eeprom
in which case when you say:

navidrct wrote:
i have 64KB eeprom
is that really 64 Kilobits or 64 Kilobytes? A 24C64 is really just 8KB of storage (64kb). To get 64KB of storage you need a 512kb part - the 24C512
navidrct wrote:
It's more complicated than that. There is allot of data . Person and car is two of them
I still don't see why that precludes a table of structs? If there really is 64KB and you need to hold 20 records (for ease of maths lets call it 32 to be generous) then you have 2KB per record. So you can easily do something like:

typedef struct {
    char name[80];
    int age;
    int birth_year;
    int birth_month;
    int birth_date;
    char car_make[50];
    char car_model[50];
    etc.
} record_t;

So far that is just 188 bytes per record out of a possible 2048.

till now i thouth that i have 64Kbit but when u say 512Kb, thanks, man i didnt focus on it and i did not know.

i dont have problem with waht to do to manage data that want store in EEPROM

i want the best way to manage addresses. 

if u have the clever idea of how to manage addressing ill be so thankful

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:

This is an AVR forum?!? Surely the intention here is that you are going to connect the 24Cxx to an AVR? If so then why doesn't the AVR get to do the writing and reading? Why is a separate programming device required?

i want to check all data that user stored in eeprom to be able to debug it

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

navidrct wrote:
i want the best way to manage addresses. if u have the clever idea of how to manage addressing ill be so thankful
Eh? If you define:

typedef struct {
    char name[80];
    int age;
    int birth_year;
    int birth_month;
    int birth_date;
    char car_make[50];
    char car_model[50];
    etc.
} record_t;

record_t data[32];

then if I am right and sizeof(record_t) is 188 bytes then I can tell you now that data[5] is at address 1,128 (assuming nothing else in the address space(. I can even tell you that data[2].birth_month is at (sizeof(record_t) * 2) + 80 + 2 + 2 = 460

 

So what "address management" is it you need exactly??

navidrct wrote:
i want to check all data that user stored in eeprom to be able to debug it
yes, so you attach the I2C to an AVR (or any other micro for that matter) and then you can read/write any of the bytes in it.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

clawson wrote:

navidrct wrote:
i want the best way to manage addresses. if u have the clever idea of how to manage addressing ill be so thankful
Eh? If you define:

typedef struct {
    char name[80];
    int age;
    int birth_year;
    int birth_month;
    int birth_date;
    char car_make[50];
    char car_model[50];
    etc.
} record_t;

record_t data[32];

then if I am right and sizeof(record_t) is 188 bytes then I can tell you now that data[5] is at address 1,128 (assuming nothing else in the address space(. I can even tell you that data[2].birth_month is at (sizeof(record_t) * 2) + 80 + 2 + 2 = 460

 

So what "address management" is it you need exactly??

navidrct wrote:
i want to check all data that user stored in eeprom to be able to debug it
yes, so you attach the I2C to an AVR (or any other micro for that matter) and then you can read/write any of the bytes in it.

let me explain

there is a board that have atmega32 on it and have 24cx64 as eeprom and there is wifi ic that phone can connect to it and do all sort of stuff

up to 32 user can register on this that every user have username and password and user id and ....

up to 128 relay can connect to device that every relay have its location and its name and every relay have 8 alarm that should be save in eeprom

up to 128 sensor can connect to device that have their location name and their Local id and ...

so there is allot of stuff that can connect to device and need to be saved in eeprom

what is the best way to manage all addresses in atmega with atmel studio as compiler 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

navidrct wrote:
24cx64
Ah finally you tell us some actual details - so that is just 8KB of storage.

 

You really need tdo a "memory budget" to work out whether 8KB is sufficient.

 

You say things like:

navidrct wrote:
up to 32 user can register on this that every user have username and password and user id and ....
but how long are the names? "John Smith" is a lot less than "Djamolidine Abdoujaparov" for instance (I always used to use the latter as my "worst case" when doing this kind of thing! (he's a cyclist))

navidrct wrote:
up to 128 relay can connect to device that every relay have its location and its name and every relay have 8 alarm that should be save in eeprom
But you need to think about this in more detail. These 128 entries - how many bytes do you actually need for "location", "name" and these 8 alarms per entry - in what form are you holding the alarms. I guess you might use "unixtime" which in 32 bits can hold any date/time down to 1 second accuracy in the next 100 odd years.

 

So continue the process you have started and give more and more detail about each thing to be stored - then simply add up all the bytes. Is it 8192 bytes ore more?

 

And still an array of struct is looking like the best option. If you "dynamically allocate" then you face the possibility of storage running out at some time.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:

navidrct wrote:
24cx64
Ah finally you tell us some actual details - so that is just 8KB of storage.

 

You really need tdo a "memory budget" to work out whether 8KB is sufficient.

 

You say things like:

navidrct wrote:
up to 32 user can register on this that every user have username and password and user id and ....
but how long are the names? "John Smith" is a lot less than "Djamolidine Abdoujaparov" for instance (I always used to use the latter as my "worst case" when doing this kind of thing! (he's a cyclist))

navidrct wrote:
up to 128 relay can connect to device that every relay have its location and its name and every relay have 8 alarm that should be save in eeprom
But you need to think about this in more detail. These 128 entries - how many bytes do you actually need for "location", "name" and these 8 alarms per entry - in what form are you holding the alarms. I guess you might use "unixtime" which in 32 bits can hold any date/time down to 1 second accuracy in the next 100 odd years.

 

So continue the process you have started and give more and more detail about each thing to be stored - then simply add up all the bytes. Is it 8192 bytes ore more?

 

And still an array of struct is looking like the best option. If you "dynamically allocate" then you face the possibility of storage running out at some time.

so i decide to use 1024Kb eeprom . thanks for saying that . its part number is

24XX1025

it has 1024000 bit / 8 = 128000 Byte right?(I desolder the old one and replace it with 24cx1024)

if there is any suggestion please tell me

say every data(Names IDs and etc...) has 20 byte in it . its just for simplification

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

@navidrct:  there's no need to quote the entire post - just give enough to show the context of what you're replying to.

 

You are just filling the thread with unnecessary and confusing clutter.

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

navidrct wrote:
you need to think about this in more detail. These 128 entries - how many bytes do you actually need for "location", "name" and these 8 alarms per entry - in what form are you holding the alarms ...

 

See #4 !

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks allot

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A Spreadsheet is a useful tool here.

 

You can write down the things you need to store, an how much space each one takes - and have the Spreadsheet add it all up for you; and work out how many will fit into a given size of EEPROM; or work out what size of EEPROM you need for a given number of "entries" 

 

etc, etc, ...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I must be a luddite - I would write some C and print some sizeof()s to get an idea of how much space things would take - at the end of the day you then have a typedef you can use directly in the project.

 

(I'd do this on a PC but make sure packing and alignment are the same as for AVR - also use stdint types rather than vague things like "int", "long, "short" etc).