EmbeddedRelated.com
Forums

Storing variables

Started by Richard December 28, 2004
Is there an easy way to save 12 bit values in eeprom as effeciently as
possible?
Basically, I have to store tons of data.

If I could afford to loose the resolution,is there a way to convert 12 bit
values into 8 bits,  kind of like if I had an 8 bit adc to begin with?







----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
Sure. Just right shift by 4. That will throw out the 4 least significant 
digits. If you are measuring signals that are small compared to the 
reference then you could throw away the 4 most significant bits by casting 
the value to a uint8_t (unsigned char).


"Richard" <rwskinner ATawesomenet Dot net> wrote in message 
news:41d157b4_4@127.0.0.1...
> Is there an easy way to save 12 bit values in eeprom as effeciently as > possible? > Basically, I have to store tons of data. > > If I could afford to loose the resolution,is there a way to convert 12 bit > values into 8 bits, kind of like if I had an 8 bit adc to begin with? > > > > > > > > ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet > News==---- > http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 > Newsgroups > ---= East/West-Coast Server Farms - Total Privacy via Encryption =---
You might consider some compression if the data is not random. If it is
slowly changing then you might consider just recording the change or
delta. Depending on the shape of the data you could use a lot less bits
for the deltas.

Peter

"Richard" <rwskinner ATawesomenet Dot net> wrote in message 
news:41d157b4_4@127.0.0.1...
> Is there an easy way to save 12 bit values in eeprom as effeciently as > possible? > Basically, I have to store tons of data.
It should be hard. Take two 12-bit values and store in 3 8-bit bytes. What kind of CPU? You might do something like this: AAAAaaaaaaaa BBBBbbbbbbbb => aaaaaaaa AAAABBBB bbbbbbbb or other arrangements.
> > If I could afford to loose the resolution,is there a way to convert 12 bit > values into 8 bits, kind of like if I had an 8 bit adc to begin with?
Shift right 4 bits?
"peterk" <peterk.vt80@gmail.com> wrote

> You might consider some compression if the data is not random.
And if it is random, why then you can ignore it completely: after all it's only noise, so why bother storing it. (ob smiley) Funny how the most densely compacted information looks just like complete gibberish. -- Nicholas O. Lindan, Cleveland, Ohio Consulting Engineer: Electronics; Informatics; Photonics. Remove spaces etc. to reply: n o lindan at net com dot com psst.. want to buy an f-stop timer? nolindan.com/da/fstop/
> > AAAAaaaaaaaa BBBBbbbbbbbb => aaaaaaaa AAAABBBB bbbbbbbb > > or other arrangements.
This is the preferred method which I already thought about doing. It's a datalogger project which has to store 8 channels of a 12 bit adc once per second for 24 hours. I take it some large battery backed SRam would be the best way to store it since flash would burn out pretty quick? I would store the actual bit values then do the conversion to engineering units on the pc when downloaded. Haven't picked a Pic yet. Thinking about a Pic Micro or an Atmega. Richard ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups ---= East/West-Coast Server Farms - Total Privacy via Encryption =---
"Richard" <rwskinner ATawesomenet Dot net> wrote:

> Is there an easy way to save 12 bit values in eeprom as effeciently as > possible? > Basically, I have to store tons of data. > > If I could afford to loose the resolution,is there a way to convert 12 bit > values into 8 bits, kind of like if I had an 8 bit adc to begin with? > > > > > > > > ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet > News==---- http://www.newsfeeds.com The #1 Newsgroup Service in the World! > >100,000 Newsgroups ---= East/West-Coast Server Farms - Total Privacy via > Encryption =---
As other suggestions, '...depending upon the actual data being stored...' If it is analog data, you may be able to get by with storing deltas in lieu of the actual values. 12-bit values could be stored as 8-bit deltas. You may want to include a full 12-bits in there every once in a while to keep things sane. You could also map 12-bit the samples into an 8-bit range in a non-linear way. This would maintain proper resolution when the signal level is small but still provide the capability of large-signal output. Noel
 >  It's a
> datalogger project which has to store 8 channels of a 12 bit adc once per > second for 24 hours. > > I take it some large battery backed SRam would be the best way to store it > since flash would burn out pretty quick?
If you have enough capacity for 24 hours of recording, that means that each byte can be written once per day. At that rate, 100,000 flash erase/write cycles will last you quite a long time. Even lowly 10k cycle flash will last for over 20 years. Thad
"Thad Smith" <ThadSmith@acm.org> wrote in message
news:41d22a17$1_1@omega.dimensional.com...
> > It's a > > datalogger project which has to store 8 channels of a 12 bit adc once
per
> > second for 24 hours. > > > > I take it some large battery backed SRam would be the best way to store
it
> > since flash would burn out pretty quick? > > If you have enough capacity for 24 hours of recording, that means that > each byte can be written once per day. At that rate, 100,000 flash > erase/write cycles will last you quite a long time. Even lowly 10k > cycle flash will last for over 20 years. > > Thad >
See if this is something that would provide you with your storage ... http://focus.ti.com/lit/ds/slus121/slus121.pdf 128K * 8 NVSRAM -- will store data for up to 10 years on it's internal lithium cell. Digikey ( http://www.digikey.com ) has them for about $14 each. Static CMOS ram tends to be very low power -- it may be less than the power required to write to flash for that matter. mikey