Skip to content

Commit

Permalink
readme txt added and text added in cpp file
Browse files Browse the repository at this point in the history
  • Loading branch information
shuvangkardas committed Mar 27, 2020
1 parent f95c3fe commit a91678b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
11 changes: 9 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Hign Endurance EEEPROM
In many situation we need to write the EEPROM memory frequently. Think about an Energy meter application. The energy parameter needs to update frequently in EEPROM to persist the value for a long time.
## Problem Statement
In many situation we need to write the EEPROM memory frequently.For an energy meter application, The energy parameter needs to update frequently in EEPROM to persist the value for a long time.
Let's Think about a situation.
I need to write energy value in eeprom after 10s interval.
- total number of writes for one day would be 8640.
Expand All @@ -15,10 +16,16 @@ One more thing we need to clarify that 100k write/erase cycle for each cell, not

For solving the eeprom wear out problem, I have developed an Arduino library [RingEEPROM]().

The idea is simple. As I cannot write/erase each cell more than 100k times, I will store my value in different cells in each write cycle. So let's consider our buffer size i 8. I am planning to write a byte in EEPROM. As I am using 8 cells for a single byte. Now I get 8*100k = 800k write cycles. That's huge. The bigger buffer size is, the more I get write cycles.
## Solution
The idea is simple. I cannot write/erase safely each cell more than 100k times. Suppose I want to store a variable in EEPROM. What I will is, at First I will write the variable in first location, second time I will write the variable in the second location.Third time I will write the variable in the third location, Fourth time I will write the variable in the first location. I am repeating the pattern after 3 locatons. Thus I am getting 3 times endurance for a single variable.

I will store my value in different cells in each write cycle. So let's consider our buffer size i 8. I am planning to write a byte in EEPROM. As I am using 8 cells for a single byte. Now I get 8*100k = 800k write cycles. That's huge. The bigger buffer size is, the more I get write cycles.

In this library, I will not store a single variable, I have developed the library such a way so that I can handle any size of buffer.

So for saving value in eeprom, we need two types of buffer
1. Parameter Buffer : This is the intended value we want to store in EEPROM
2. Status Buffer: This buffer keeps track of my current location in buffer.

For more information please go through the Microchip [application note](http://ww1.microchip.com/downloads/en/appnotes/doc2526.pdf)

Expand Down
13 changes: 13 additions & 0 deletions src/eep.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/*
* The idea of the library is simple. I am Saving a particular parameters
* into multiple location of the eeprom. Suppose I want to store a variable
* in eeprom. Everytime I want to store the variable, I change my location.
* Thus i am using 4 location for my varibale. By this I am getting, 4 times
* endurance of eeprom for that variable.
*So for saving value in eeprom, we need two types of buffer
* 1. Parameter Buffer : This is the intended value we want to store in EEPROM
* 2. Status Buffer: This buffer keeps track of my current location in buffer.
*/


#include "eep.h"
#include <EEPROM.h>

Expand Down

0 comments on commit a91678b

Please sign in to comment.