App note: Slave I2C communication and setup on PIC devices with MSSP modules

Here is an app note from Microchip describing how to setup, and implement slave I2C communication on Pic devices with MSSP modules. It also features assembler code for PIC18s and PIC16s.

Many devices in the PICmicro family have a Synchronous Serial Port (SSP) or Master Synchronous Serial Port (MSSP). These peripherals can be used to implement the SPI TM or I2C communication protocols. The purpose of this application note is to provide the reader with a better understanding of the I2C protocol and to show how PICmicro devices with the SSP or MSSP modules are used as a Slave device on an I 2 C bus.

Join the Conversation

3 Comments

  1. Be careful with the source code provided. Also note differences in different versions of MSSP realization in PIC devices (some flags do not go off in newer MSSP module used eg in some PIC18s and PIC24th). Check conditions, be careful with clock stretching and learn exactly when to release the clock line – otherwize it’s not going to work.

  2. Seconded. Read the app note carefully, determine if your pic has an SSP or MSSP, and study the sample code. It’s better to follow the state machine model given than to be clever and roll your own.

Leave a comment

Your email address will not be published. Required fields are marked *

Notify me of followup comments via e-mail. You can also subscribe without commenting.