How to Data Write into Internal EEPROM of PIC16F877A

The following code demonstrate how to write data on internal EEPROM. The built-in library function is used. The code is written in “mikroC PRO for PIC v.6.6.3” IDE and simulation is done with Proteus 8.0 SP0. At the end of code, you can find complete project files for download.
Note: Pause the simulation, and click on the following option.
eeprom option
Picture 2017-12-18 20_09_03

Code in mikroC

sbit LED_Dir at TRISC.B0;
sbit LED at PORTC.B0;
void main()
{
char write_buffer[] = {“This data is written to internal EEPROM“};
unsigned short addr = 0;
LED_Dir = 0;
LED = 0;
for(addr=0;addr<strlen(write_buffer);addr++)
{
EEPROM_Write(addr,write_buffer[addr]);
}
LED = 1;
while(1)
{
}
}

Download Files

For download “mikroC PRO for PIC” project and “Proteus 8.0” simulation files, click here.

Comments

Popular posts from this blog

How to Program Parallel Slave Port (PSP) in PIC16F877A

How to Program Interrupts in PIC16F877A

How to Program SPI in PIC16F877A (Slave Mode)