Tutorial 19:  Copying a 24LC64 EEPROM using I2C Master mode communications.

The PIC16F877 has an onboard I2C hardware module that can be used to communicate and control I2C devices such as the 24LC64 EEPROM. In this tutorial, two 24LC64 EEPROMS share the I2C bus as slaves and the PIC16F877 controls the bus as the master. The PIC copies the information in source EEPROM [1010000] to the destination EEPROM [1010001] in 32 byte pages for optimal efficiency.

Download FEATURE877_Tutorial19.zip and unzip into folder <your path>\Tutorial 19

Filename Version Description
tut19.pjt 1.0 MPLAB Project
tut19.asm 1.0 PIC16F877 Assembler code
copyFrom.csv 1.0 24LC64 EEPROM Image in Comma Seperated Variable Format
copyTo.csv 1.0 24LC64 EEPROM Image in Comma Seperated Variable Format
tut19.hex 1.0 Precompiled HEX
tut19.lst 1.0 Precompiled LST
tut19.vbb 1.0 Virtual Breadboard simulation

Running the Simulation

Open tut19.vbb and press RUN.

Code Walk Through

 

Features Demonstrated

TRISB/PORTB

TRISC/PORTC

TRISD/PORTD

I2C MasterMode

Components Used

PIC16F877

EEPROM24LC64

WIREDAND

NETLABEL

DIGITAL8

2 CHANNEL DSO

LED

LEDN

DIPN