The AVR microcontroller boards which are provided with all the basic circuitry for the operation of the microcontroller which has been flashed with the arduino boot-loader are called arduino boards. The arduino can communicate with the other devices using its digital I/O, serial port, I2C port, SPI port etc.The arduino IDE is so simple to use that anyone who has basic knowledge of c programming can quickly get started with it. The project on how to get started with the arduino explains about the steps required to get start with an arduino board.The arduino board used in this project is the arduino pro-mini board and the IDE version of the arduino is 1.0.3 for windows. The Arduino pro-mini board has ATMEGA328 microcontroller inside it which has an internal EEPROM memory of 1Kb. The image of the arduino pro-mini board and the arduino IDE are shown below;
Fig. 2: Typical Arduino Pro-Mini Board
Fig. 3: Arduino IDE Software Window
Since the arduino pro-mini board has no circuitary for interfacing it with the serial port or the USB port of the PC, an external USB to TTL converter board is required to connect it with the PC. This hardware helps in programming the arduino board and also helps in the serial communication with the USB port of the PC.
Fig. 4: External USB to TTL converter board for programming Arduino and serial communication
It is assumed that the reader has gone through the project how to get started with the arduino and tried out all the things discussed there.The Arduino IDE provides some functions to access the built-in EEPROM using with the EEPROM read and write can be performed very easily. The functions are available from the library called <EEPROM.h>. The library provides functions for write a data into the EEPROM and read data from the EEPROM. The functions used in the code written for this projects are EEPROM.write() and EEPROM.read() from the library <EEPROM.h> which can be used for writing a data into the EEPROM memory and reading a data from the EEPROM memory. The details of the functions are discussed in the following section
The function EEPROM.write() is used to write a data byte into a particular address of the EEPROM memory mentioned by the parameters passed to the function. The function has two parameters where the first one should be provided with the address of the EEPROM location into which the data need to be written into and the second parameter should be provided with actual data byte. For example if the data ‘A’ need to be written into the address mentioned by the variable ‘addr’ the following statement can be used.
The function EEPROM.read() is used to read a particular data byte from the internal EEPROM of the Arduino’s microcontroller. The function has a single parameter which is the address from which the data should be read from. The function has a return value which is the actual data byte which it read from the address mentioned by the parameter passed into it. For example if the data byte is to be read from the location mentioned by the variable ‘addr’ the following statement can be used.
The ATMEGA328 microcontroller in the Arduino pro-mini board has a built-in EEPROM memory of 1Kb. This project checks all the memory locations of the EEPROM memory starting from 0th location till the 1023th location. Even though there are lot of standard algorithms to perform memory check, in this particular project the checking is performed by simply writing a data into each and every memory location and reading back the same data and verifies whether they are same.
The code writes a particular data into a memory location with the help of EEPROM.write() function and reads back the data from the same memory location using the function EEPROM.read() both provided by the library <EEPROM.h> and then advances to the next memory location.
Both the value written into the location and read from the location is shown in a 16*2 LCD with the help of functions from the library <LiquidCrystal.h>. Few functions from the library <LiquidCrystal.h> including those which are used in this particular project are already discussed in the previous projects on how to interface an LCD, how to display sensor value on LCD, how to connect the LCD with the PC and how to make an LCD scrolling display.
The code displays the data which is written into the EEPROM in the first line of the 16*2 LCD and the data which is read back from the same location in the second line of the LCD. Once the display on the second line of the 16*2 LCD is done the code starts blinking an LED connected to the pin number 6 continuously with the help of pinMode(), delay() and digitalWrite() functions explained in the previous projects on how to start with Arduino and how to use digital input and output of arduino.
When the coding is finished one can verify and upload the code to the Arduino board as explained in the project how to get started with the Arduino and the test result will be updated in the 16*2 LCD. If there is no problems found in the entire EEPROM memory locations the LCD reads “EEPROM [ OK ]” otherwise “ERROR OCCURED”.