PDA

View Full Version : RTC with date and EEPROM



Christopher4187
- 4th March 2013, 21:33
I'm making a datalogger and need date and time. The data (20 bytes) will be stored at 1 second intervals and I need to keep 7 days worth of information. The system will only be on approximately 1/3 of the day.

First question, would a 256KB EEPROM be sufficient for this? I may be misunderstanding it but you can write 256KB a million times? Is that pretty much how it works?

The other question is regarding a RTC. Would DT's INT program work as a RTC with calendar? Seems to me that the hardest part would be keeping track of the date, not the time. Just looking for the easiest (not necessarily the one that costs the least) method to do this.

SteveB
- 4th March 2013, 23:03
You ask about a "256KB EEPROM", but do you mean 256Kb? (Like the 24LC256?) If so, there is no way that would be big enough to hold all of the data. It only holds 32,767 Bytes. For your task, you will need...

7days * 8hrs * 60min * 60sec * 20Bytes = 4,032,000Bytes (about 32Mbit)

There are some serial (I2C and SPI) flash devices that I think are that big. (Microchip SST25VF032B)

Christopher4187
- 5th March 2013, 01:49
Thanks for the information. I have to look at the data more closely. Maybe I can get away with using some bits but I may end up needing word sized variables too. It's not NASA critical information, maybe I can just use bytes and round off since none of the data is over 2000.

There is this one chip that has 2G of EEPROM and it's not terribly expensive:

http://www.toshiba.com/taec/components/Datasheet/TC58NVG1S3ETA00.pdf

What is the best thing to do if I wanted to store sentences? Meaning:

"Today is the very best day to program PIC's"

"I have questions but I can't think of any answers"

"ummmmmmmmmmmmmmmmmmmmmmmm"

SteveB
- 5th March 2013, 16:35
That EEPROM is certianly big enough. I'm sure there are a number of options, just depends on cost vs. what mets you needs for size/package/interface/etc.

What is the 'Best' thing for storing strings? Depends ;)

You could just store them in the commands used, ie:

LCDOUT "Today is the very best day to program PIC's"
LCDOUT "I have questions but I can't think of any answers"
LCDOUT "u", REP "m"\24
Or, use ARRAYWRITE:

ARRAYWRITE MyArray, ["Today is the very best day to program PIC's"]
ARRAYWRITE MyArray, ["I have questions but I can't think of any answers"]
ARRAYWRITE MyArray, ["u", REP "m"\24]
Although simple, these methods use up code space.

If code space is limited or your not talking about predetermined strings, and since you have to get a large storage device for the data anyway, storing the strings there would work well. If you want to preserve all of the space for data, and the chip has an internal EEPROM, use that.