Tutorial 20: I2C Master/Slave Communication

The PIC16F877 has an onboard I2C hardware module that can operate as a Master or Slave. This example demonstrates a master exchanging port information with slave devices over a SIMMSTICK Bus.

Download FEATURE877_Tutorial20.zip and unzip into folder <your path>\Tutorial 20

Filename Version Description
tut20.pjt 1.0 MPLAB Project
tut20.asm 1.0 PIC16F877 Assembler code
tut20.hex 1.0 Precompiled HEX
tut20.lst 1.0 Precompiled LST
tut20slv.asm 1.0 PIC16F877 Assembler code for I2C Slaves
tut20slv.hex 1.0 Precompiled HEX code for I2C Slaves
tut20slv.lst 1.0 Precompiled LST code for I2C Slaves
tut20.vbb 1.0 Virtual Breadboard simulation
tut20Daughter0.vbb 1.0 Virtual Breadboard simulation for daughter board
tut20Daughter1.vbb 1.0 Virtual Breadboard simulation for daughter board
tut20Daughter2.vbb 1.0 Virtual Breadboard simulation for daughter board
tut20Daughter3.vbb 1.0 Virtual Breadboard simulation for daughter board

Running the Simulation

Open tut20.vbb and press RUN.

Code Walk Through

Features Demonstrated

Components Used

PIC16F877