PIC16F84A internal EEPROM code and Proteus simulation

Summary of PIC16F84A internal EEPROM code and Proteus simulation


This article details C language code for reading and writing the PIC16F84A microcontroller's internal EEPROM using MPLAB and HI-TECH C. It assumes prior knowledge of LED blinking on this chip and includes a Proteus simulation where an LED on RA0 indicates successful EEPROM programming status.

Parts used in the PIC16F84A Internal EEPROM Project:

  • PIC16F84A microcontroller
  • LED attached to RA0
  • MPLAB v8.85 software
  • HI-TECH C v9.83 compiler
  • Proteus v7.10 simulator

This post provides the internal EEPROM reading and writing code for PIC16F84A microcontroller. As we know[1], PIC16F84A microcontroller has 64 bytes of built in EEPROM data space with an address range of 0x00 to 0x3F. This code is written in C language using MPLAB with HI-TECH C compiler. You can download this code from the ‘Downloads‘ section at the bottom of this page.

PIC16F84A internal EEPROM

It is assumed that you know how to blink an LED with PIC16F84A microcontroller. If you don’t then please read this page first, before proceeding with this article.

The result of simulating the code in Proteus is shown below.

In the above circuit[2], LED attached on RA0 indicates weather a byte was successfully written in the internal EEPROM or not. In the above figure, LED is ON which indicates that EEPROM was successfully programmed.

PIC16F84A internal EEPROM Schematic

Code

The code for the main function is shown below.

Downloads

EEPROM code for PIC16F84A was compiled in MPLAB v8.85 with HI-TECH C v9.83 compiler and simulation was made in Proteus v7.10. To download code and Proteus simulation click here.

 

For more detail: PIC16F84A internal EEPROM code and Proteus simulation

Quick Solutions to Questions related to PIC16F84A Internal EEPROM Project:

  • What is the size of the built-in EEPROM data space in the PIC16F84A?
    The PIC16F84A has 64 bytes of built-in EEPROM data space.
  • What is the address range of the PIC16F84A EEPROM?
    The address range is 0x00 to 0x3F.
  • In which programming language was the provided code written?
    The code is written in C language.
  • Which compilers and software versions were used for compilation and simulation?
    The code was compiled with MPLAB v8.85 and HI-TECH C v9.83, while simulation was done in Proteus v7.10.
  • How does the circuit indicate if a byte was successfully written to the EEPROM?
    An LED attached on RA0 indicates success; it turns ON when the EEPROM is successfully programmed.
  • What prerequisite knowledge is required before proceeding with this project?
    You must know how to blink an LED with the PIC16F84A microcontroller.

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter