The Engineer Tutor PIC24FJ Library – I2C Slave

This tutorial is going to show you how to take the master I2C device we worked on last time and turn it into a slave I2C device.  This is really powerful as now we can interface none I2C devices to the I2C bus.  There is a really good example of this and that is  GPS module.  These modules are typically interfaced using what is known as TTL RS232.  That is to say the protocol is async serial but at TTL levels.  We have all the tools we need to do this.  We have the serial port and the slave I2C device.

The setup of this device is very similar to the master I2C device.  The pins are fixed and are the same pins as the master uses except the SCL pin is an input when you run the device in as a slave I2C device.