Data logger/memory question
Uwe
Posts: 18
I am working on a device which will record temperature and possibly additional values over a period of time for later retrival.
By reading the posts here I got my BS2p to store and recall numbers from an 24LC32 but the following questions came up:
Is an eeprom the best device to store data of this kind, 500 to 1000 r/w per day?
Also, I'd like to store the number of events recorded in a memory location on the memory chip, so that upon retrival I first read that number and then I know how much to download.
But the numbers may get very big, up to the number of memory locations on the memory chip, how do I manage this??
Uwe
By reading the posts here I got my BS2p to store and recall numbers from an 24LC32 but the following questions came up:
Is an eeprom the best device to store data of this kind, 500 to 1000 r/w per day?
Also, I'd like to store the number of events recorded in a memory location on the memory chip, so that upon retrival I first read that number and then I know how much to download.
But the numbers may get very big, up to the number of memory locations on the memory chip, how do I manage this??
Uwe
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
count=count +1. This way, each time an event occurs, count is incremented by one and uses only 2 bytes in which to store the value. A· WORD sized variable can hold a value up to 65,000 or so.
I tried and it gave me problems not wanting to store more than 255.
In the I2COUT command there is a provision for longer addresses, but not for longer data.
Also, would you recommend an eeprom for this application?
Uwe
· I2COUT·SDA, slaveAddr, eeAddr.BYTE1\eeAddr.BYTE0, [noparse][[/noparse]myData.BYTE0, myData.BYTE1]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
means : you can store the counter in RAM (as "count" variable) and if you really need persistance, you can write it down in eeprom before power off (soft power off), since RAM looses data when unpowered.
++
Practically every data logger of this sort needs a real time clock (RTC) so that your readings can be time stamped and coordinated with real clock time. Many RTCs (Such as the popular DS1302 or DS1307) include provision for backup power, from a capacitor or lithium coin cell, to keep the clock running even when power is down. Those RTCs also include a few bytes of general purpose RAM, which is the perfect place to store the pointer to keep track of where you are in the log file. It is RAM, so you can write to it without any worry of wearing it out, but it is battery backed, so you won't lose it during a reset or power failure.
For EEPROM, if the eeprom inside the BS2p is not enough, try the 24LC256 or 24LC512. There are lots of app notes here, and they give you 32kbytes or 64kbytes of memory for your log file.
Another way to approach the memory pointer is to start with all locations erased to $ff. Then as the memory becomes filled, it is possible to search the memory at startup to locate the last record written and position the pointer to the next free record location. However, it is much easier to maintain a pointer in a battery backed clock chip.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com