The EEPROM stands for Electrically Erasable Programmable Read Only Memory. In an EEPROM the data can be written with the help of electrically programming the chip. Once programmed the data it will remain in the memory for a very long time even if there is no power applied to it. Hence the EEPROM memory is widely used in microcontroller systems where some particular data need to be retained each time the system is turned on.
The Arduino board has an AVR microcontroller in it which also has a built-in EEPROM memory. The memory size varies with the Arduino boards and the microcontroller used in them. Before writing the data to the EEPROM memory it is always recommended to check each and every memory locations of so that there won’t be any data error when the microcontroller tries to retain the data. This particular project explains how to perform a test on the built-in EEPROM of an Arduino microcontroller.



Project Source Code
### /*================================= EG LABS ======================================= Test the entire EEPROM storage locations and update the result in an LCD The circuit: * LED attached from pin 6 to ground through a 1K resistor * Potentiometer attached to analog input A0 * one side pin (either one) to ground * the other side pin to +5V LCD: * LCD RS pin to digital pin 12 * LCD Enable pin to digital pin 11 * LCD D4 pin to digital pin 5 * LCD D5 pin to digital pin 4 * LCD D6 pin to digital pin 3 * LCD D7 pin to digital pin 2 * LCD R/W pin to ground * 10K resistor: * ends to +5V and ground * wiper to LCD pin 3 * LED anode attached to digital output 6 * LED cathode attached to ground through a 1K resistor //================================= EG LABS =======================================*/ #include <EEPROM.h> #include <LiquidCrystal.h> LiquidCrystal lcd(12, 11, 5, 4, 3, 2); // initialize the LCD library with the numbers of the interface pins int address = 0; // the variable which holds the address in the eeprom int write_value = 100; // the variable which holds the data need to be written to the eeprom int read_value = 0; // the variable which holds the data which is read from the eeprom int led = 6; // variable which holds the pin number at which the LED is connected void setup() { pinMode(led, OUTPUT); // initialize the led pin as an output. lcd.begin(16, 2); // set up the LCD's number of columns and rows: lcd.print("ENGINEERS GARAGE"); delay(2000); lcd.clear(); lcd.print("TESTING EEPROM.."); delay(1000); for(address == 0; address < 1024; address ++) { EEPROM.write(address, write_value); // write the value to the EEPROM address read_value = EEPROM.read(address); // read the value from the address if(read_value != write_value) break; else; } lcd.setCursor(0, 1); if(read_value != write_value) lcd.print(" ERROR OCCURED"); else lcd.print(" EEPROM [ OK ]"); } void loop() { //---- blink LED -----// digitalWrite(led, HIGH); delay(1000); digitalWrite(led, LOW); delay(1000); //---- blink LED -----// } ###
Circuit Diagrams
Project Components
Project Video
Filed Under: Arduino Projects
Filed Under: Arduino Projects
Questions related to this article?
👉Ask and discuss on EDAboard.com and Electro-Tech-Online.com forums.
Tell Us What You Think!!
You must be logged in to post a comment.