Go Down

Topic: What happens when address is bigger than EEPROM (Read 2249 times) previous topic - next topic

tochinet

Hi,

Can someone tell me what happens if I continue writing to the EEPROM with a too large address.
For example, I use a MEGA (4096 bytes) and then I move the sketch to UNO. When I reach the end of the EEPROM,
will the write simply not occur, or will it overwrite location 0 ?

retrolefty

Quote
or will it overwrite location 0 ?


Yes, it will just wrap around to address 0 and keep on going, round and round.


Lefty

chiru42

hi folks!
I hav a doubt. can i store the input values(sensor) and calulated values(obtained during compiling) within the controller memory and access when needed? or do i need to use registers for storing the values? i'm using Arduino(Duemilanov). how can i access registers in IDE? or is there anyother way for the purpose?
---need help


thanx
chiru

PaulS

Quote
can i store the input values(sensor) and calulated values(obtained during compiling) within the controller memory and access when needed?

You can store data in EEPROM. That data can be read from sensors, or computed (at run time, not at compile time). You can not store them in Flash memory.

What are you trying to store? Saving data from the sensors for later use doesn't seem like a usefule thing to do, to me.

Don't forget that EEPROM has a limited number of write cycles (although it is a fairly large number, if you write every pass through loop you will hit that limit soon).
The art of getting good answers lies in asking good questions.

chiru42

[font=Verdana][font=Verdana]#You can store data in EEPROM. That data can be read from sensors, or computed (at run time, not at compile time). You can not store them in Flash memory.#[/font][/font]

    why cant I store it in flash memory? i wish i can create FLASH_ARRAY() and store the values. how far can i succeed on this line?

#What are you trying to store? Saving data from the sensors for later use doesn't seem like a usefule thing to do, to me.#

   I'm trying to store the sensor readings for every loop. I'm using RPM sensor and Temp sensor as of now. For every loop I want to save these sensor readings and use them for calulations/comparisions during the program exection(system operation).

#Don't forget that EEPROM has a limited number of write cycles (although it is a fairly large number, if you write every pass through loop you will hit that limit soon).#

    As i need the Arduino as a standalone scontroller, i dnt want to use EEPROM because it has got limited lifetime. I may need a permanent solution for this issue

need help

thanx
chiru

PaulS

Quote
why cant I store it in flash memory?

Because flash memory is read only.

Quote
i wish i can create FLASH_ARRAY() and store the values.

Wish all you want.

Quote
how far can i succeed on this line?

No distance at all.

Quote
I'm using RPM sensor

Never heard of an RPM sensor. I'm aware of sensors that detect when a rotation has occurred (if the sensor and sensed object are properly positioned) that can be used to determine the time that a rotation took, which can be used to determine the number of rotations per minute.

As you might detect, precision is important (to me).

Quote
For every loop I want to save these sensor readings and use them for calulations/comparisions during the program exection(system operation).

If the number of values to save is reasonable, an array in SRAM will work. Flash memory is used for larger read-only arrays. EEPROM is used when the data needs to persist past a power loss. What you want to do hardly seems to fit that criteria.

However, it really isn't that clear what you want to do. How much data are you talking about storing? For how long?

The art of getting good answers lies in asking good questions.

chiru42

there are some functions about FLASH_ARRAY(), we can create an array of values and can have access to those values. isnt it true?

i may be in need to store a set of values by temp sensor, speed sensor in the controller memory and point to them for comparision as and when a particular control loop needs it. so every time the sensors read inputs, i wanted to replace the old values by the newer ones(new speed and new temp)

can i make this possible?

PaulS

There are 3 kinds of memory available on the Arduino. Flash memory, where the code and PROGMEM arrays goes; SRAM, where other arrays, variables, and literal strings, goes; and EEPROM, where user stored data, that needs to persist even after power loss, goes.

Flash memory is read-only. Get over it.
The art of getting good answers lies in asking good questions.

AWOL

Quote
we can create an array of values and can have access to those values. isnt it true?

Quite true - you can create arrays of values in flash memory, at compile/upload time and not subsequently modifiable.

Go Up