Summary of How to Save Data using EEPROM in PIC16F877A Microcontroller
This tutorial demonstrates how to save and retrieve data using the internal EEPROM of the PIC16F877A microcontroller. EEPROM allows non-volatile data storage, meaning data remains intact even when power is off. The PIC16F877A EEPROM has 256 bytes of storage, suitable for small data needs without requiring external memory like SD cards. The project involves reading analog input via a potentiometer on AN4, displaying data on an LCD, and saving data to EEPROM when a push button on RB0 is pressed, using the XC8 compiler for easy programming.
Parts used in the Saving Data using EEPROM in PIC16F877A:
- PIC16F877A Microcontroller
- LCD Display
- Potentiometer
- Push Button (connected to RB0)
- Connecting wires and breadboard
In this tutorial we will learn how easy it is to save data using the EEPROM present in the PIC16F877A Microcontroller. In most real time projects we might have to save some data which should not be erased even when the power is turned off. This might sound like a complicated process, but with the help of XC8 Compiler this task can be done by just using a single line of code. If the data is large in terms of Mega bytes then we can interface a storage device like an SD card and store those data on them. But we can avoid those tiring process if the data is small, we can simply use the EEPROM present in the PIC Microcontroller to save our data and retrieve it at anytime we want
EEPROM in PIC16F877A:
EEPROM stand for “Electronically Erasable and Programmable Read Only Memory”. As the name suggests it is a memory present inside the PIC Microcontroller in which we can write/read data by programming it to do so. The data saved in this will be erased only if it is mentioned to do so in the program. The amount of storage space available in EEPROM varies upon each microcontroller; the details will be given in Datasheet as usual. In our case for PIC16F877A the available space is 256 bytes as mentioned in its specification datasheet. Now let us see how we can use these 256 bytes to read/write data by using a simple experimental setup.
Circuit Diagram and Explanation:
The circuit diagram for the project is shown above. We have interfaced an LCD to visualize the data getting saved and retrieved. A normal potentiometer is connected to AN4 Analog channel so feed in variable voltage, this variable voltage will be used as the data to be saved in the EEPROM. We have also used a push button on RB0, when this button is pressed the data from the Analog channel will be saved in the EEPROM.
for more detail:How to Save Data using EEPROM in PIC16F877A Microcontroller