README

Example Summary

Sample application to demonstrate I2C Master and I2C Slave communication

Peripherals Exercised

Resources & Jumper Settings

If you’re using an IDE (such as CCS or IAR), please refer to Board.html in your project directory for resources used and board-specific jumper settings. Otherwise, you can find Board.html in the directory <SDK_INSTALL_DIR>/source/ti/boards/<BOARD>.

Master P6.4 –> 10k –> P1.6 Slave Master P6.5 –> 10k –> P1.7 Slave

Master GND –> GND Slave

Example Usage

The counterpart of this example at the I2C master end is i2cmasterexample1.c

  1. Download the i2cslaveexample1.c one the first board(SLAVE). Unplug the first board.

  2. Download the i2cmasterexample1.c on the second board(MASTER). Pause the code in main.

  3. Plug the first board(SLAVE) in another usb port so that the slave application is now running and waiting on the master.

  4. Run the second board(MASTER)

  5. Open a serial session (e.g. PuTTY, etc.) to the appropriate COM port. The COM port can be determined via Device Manager in Windows or via ls /dev/tty* in Linux.

The connection will have the following settings:

    Baud-rate:     115200
    Data bits:          8
    Stop bits:          1
    Parity:          None
    Flow Control:    None

The expected value is

I2C Initialized!

Master: x Hello this is master

I2C master/slave transfer complete

Slave: o Hello this is slave

I2C closed!

Application Design Details

mirrorRegister is the memory block that is used to store sent/received data mirrorRegister[0] holds the status byte that GETSTATUS and SETSTATUS point to.

TI-RTOS:

FreeRTOS: