--- In AVR-Chat@yahoogroups.com, "James Wagner" <jim_d_wagner@a...> wrote: > You really DON'T need to think of "constants". > > There are only two issues. > > 1. Where is the value stored? It can be stored as part of a > table in program code and that is a real constant, for most > practical purposes unchangeable. It can be stored in SRAM. > In this case, it is highy changeable and goes away every > time power is turned off. It can be stored in EEPROM. It is > still changeable, but you don't want to do it really often. > And, it stays when the power goes off. The operations used > to read each is similar but slightly different. > > 2. What determines the value? A constant is determined at > the time that code is written. While it can be changed > later, it makes little sense in this kind of application. > All of the other kinds of data have to be determined some > other way; it might be by receiving data over the serial > port. It might by by reading a constant at startup and copy > to the memory location (ie, a "default" value). > > My point is that thinking about "constants" is not really > very useful or productive in this kind of application. A > number is a number. > > Jim > > > --------------------------------------------------------------- > The Think Different Store > http://www.thinkdifferentstore.com/ > For All Your Mac Gear > --------------------------------------------------------------- Hi Jim, I am just on low end of the learnig curve. To me, at this point, a variable is something that changes all the time, like soil moisture or air temperature. A constant is a more fixed number that I am thinking is a set value that does not change unless the chip is re- programmed. As far as the place it is stored, I would not have a problem if I needed to use a button battery to keep an a memory chip from losing any values. But if the internal eeprom is similar to eeprom chips the limit is something on the order of 100,000 writes ? That would allow three changes every day for the next --- 100 years ? I would expect a change once or twice a week. I guess simplicity would be a key factor. what is the easiest way to send the AVR the data and what is the easiest way to keep it thru a power loss. The button battery would keep a memory chip alive for some 10 or more years so that would eleminate any power issues if sram was much easier. Eventually, this will be connected to a memory card like a MMC or SD or CF, but I think one could not put program variables on that ? Dave (realizing the trees have branches......)
Message
Re: variable/constant input from a PC ?
2004-07-14 by Dave Mucha
Attachments
- No local attachments were found for this message.