This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TM4C1294KCPDT: TM4C1294 EVK

Part Number: TM4C1294KCPDT
Other Parts Discussed in Thread: EK-TM4C1294XL, DRV2605L

HI TEAM

I am trying to up the I2C0 in the TM4C1294 EVK , but I2C master clock is not working , I have use the demo  code (master_slave_loopback.c) provided by TI SDK , can you please help me to up the I2C clock 

pull up is given from the I2C slave to the EVK I2C master, so there is no problem in pull up

PFA of the code I used for testing , please suggest us what need to done from software or hardware side to fix the I2C clock issue.

Basically the code i have taken is form SDK provided by TI for TIVA series

please response

//*****************************************************************************
//
// master_slave_loopback.c - Example demonstrating a simple I2C message
//                           transmission and reception.
//
// Copyright (c) 2010-2020 Texas Instruments Incorporated.  All rights reserved.
// Software License Agreement
// 
//   Redistribution and use in source and binary forms, with or without
//   modification, are permitted provided that the following conditions
//   are met:
// 
//   Redistributions of source code must retain the above copyright
//   notice, this list of conditions and the following disclaimer.
// 
//   Redistributions in binary form must reproduce the above copyright
//   notice, this list of conditions and the following disclaimer in the
//   documentation and/or other materials provided with the  
//   distribution.
// 
//   Neither the name of Texas Instruments Incorporated nor the names of
//   its contributors may be used to endorse or promote products derived
//   from this software without specific prior written permission.
// 
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// 
// This is part of revision 2.2.0.295 of the Tiva Firmware Development Package.
//
//*****************************************************************************

#include <stdbool.h>
#include <stdint.h>
#include "inc/hw_i2c.h"
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "driverlib/gpio.h"
#include "driverlib/i2c.h"
#include "driverlib/pin_map.h"
#include "driverlib/sysctl.h"
#include "driverlib/uart.h"
#include "utils/uartstdio.h"

//*****************************************************************************
//
//! \addtogroup i2c_examples_list
//! <h1>I2C Master Loopback (i2c_master_slave_loopback)</h1>
//!
//! This example shows how to configure the I2C0 module for loopback mode.
//! This includes setting up the master and slave module.  Loopback mode
//! internally connects the master and slave data and clock lines together.
//! The address of the slave module is set in order to read data from the
//! master.  Then the data is checked to make sure the received data matches
//! the data that was transmitted.  This example uses a polling method for
//! sending and receiving data.
//!
//! This example uses the following peripherals and I/O signals.  You must
//! review these and change as needed for your own board:
//! - I2C0 peripheral
//! - GPIO Port B peripheral (for I2C0 pins)
//! - I2C0SCL - PB2
//! - I2C0SDA - PB3
//!
//! The following UART signals are configured only for displaying console
//! messages for this example.  These are not required for operation of I2C.
//! - UART0 peripheral
//! - GPIO Port A peripheral (for UART0 pins)
//! - UART0RX - PA0
//! - UART0TX - PA1
//!
//! This example uses the following interrupt handlers.  To use this example
//! in your own application you must add these interrupt handlers to your
//! vector table.
//! - None.
//
//*****************************************************************************

//*****************************************************************************
//
// Number of I2C data packets to send.
//
//*****************************************************************************
#define NUM_I2C_DATA 3

//*****************************************************************************
//
// Set the address for slave module. This is a 7-bit address sent in the
// following format:
//                      [A6:A5:A4:A3:A2:A1:A0:RS]
//
// A zero in the "RS" position of the first byte means that the master
// transmits (sends) data to the selected slave, and a one in this position
// means that the master receives data from the slave.
//
//*****************************************************************************
#define SLAVE_ADDRESS 0x3C

//*****************************************************************************
//
// This function sets up UART0 to be used for a console to display information
// as the example is running.
//
//*****************************************************************************
void
InitConsole(void)
{
    //
    // Enable GPIO port A which is used for UART0 pins.
    // TODO: change this to whichever GPIO port you are using.
    //
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);

    //
    // Configure the pin muxing for UART0 functions on port A0 and A1.
    // This step is not necessary if your part does not support pin muxing.
    // TODO: change this to select the port/pin you are using.
    //
    GPIOPinConfigure(GPIO_PA0_U0RX);
    GPIOPinConfigure(GPIO_PA1_U0TX);

    //
    // Enable UART0 so that we can configure the clock.
    //
    SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);

    //
    // Use the internal 16MHz oscillator as the UART clock source.
    //
    UARTClockSourceSet(UART0_BASE, UART_CLOCK_PIOSC);

    //
    // Select the alternate (UART) function for these pins.
    // TODO: change this to select the port/pin you are using.
    //
    GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);

    //
    // Initialize the UART for console I/O.
    //
    UARTStdioConfig(0, 115200, 16000000);
}

//*****************************************************************************
//
// Configure the I2C0 master and slave and connect them using loopback mode.
//
//*****************************************************************************
int
main(void)
{
#if defined(TARGET_IS_TM4C129_RA0) ||                                         \
    defined(TARGET_IS_TM4C129_RA1) ||                                         \
    defined(TARGET_IS_TM4C129_RA2)
    uint32_t ui32SysClock;
#endif
    uint32_t pui32DataTx[NUM_I2C_DATA];
    uint32_t pui32DataRx[NUM_I2C_DATA];
    uint32_t ui32Index;

    //
    // Set the clocking to run directly from the external crystal/oscillator.
    // TODO: The SYSCTL_XTAL_ value must be changed to match the value of the
    // crystal on your board.
    //
#if defined(TARGET_IS_TM4C129_RA0) ||                                         \
    defined(TARGET_IS_TM4C129_RA1) ||                                         \
    defined(TARGET_IS_TM4C129_RA2)
    ui32SysClock = SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ |
                                       SYSCTL_OSC_MAIN |
                                       SYSCTL_USE_OSC), 25000000);
#else
    SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN |
                   SYSCTL_XTAL_16MHZ);
#endif

    //
    // The I2C0 peripheral must be enabled before use.
    //
    SysCtlPeripheralEnable(SYSCTL_PERIPH_I2C0);

    //
    // For this example I2C0 is used with PortB[3:2].  The actual port and
    // pins used may be different on your part, consult the data sheet for
    // more information.  GPIO port B needs to be enabled so these pins can
    // be used.
    // TODO: change this to whichever GPIO port you are using.
    //
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);

    //
    // Configure the pin muxing for I2C0 functions on port B2 and B3.
    // This step is not necessary if your part does not support pin muxing.
    // TODO: change this to select the port/pin you are using.
    //
    GPIOPinConfigure(GPIO_PB2_I2C0SCL);
    GPIOPinConfigure(GPIO_PB3_I2C0SDA);

    //
    // Select the I2C function for these pins.  This function will also
    // configure the GPIO pins pins for I2C operation, setting them to
    // open-drain operation with weak pull-ups.  Consult the data sheet
    // to see which functions are allocated per pin.
    // TODO: change this to select the port/pin you are using.
    //
    GPIOPinTypeI2CSCL(GPIO_PORTB_BASE, GPIO_PIN_2);
    GPIOPinTypeI2C(GPIO_PORTB_BASE, GPIO_PIN_3);

    //
    // Enable loopback mode.  Loopback mode is a built in feature that is
    // useful for debugging I2C operations.  It internally connects the I2C
    // master and slave terminals, which effectively let's you send data as
    // a master and receive data as a slave.
    // NOTE: For external I2C operation you will need to use external pullups
    // that are stronger than the internal pullups.  Refer to the datasheet for
    // more information.
    //
    I2CLoopbackEnable(I2C0_BASE);

    //
    // Enable and initialize the I2C0 master module.  Use the system clock for
    // the I2C0 module.  The last parameter sets the I2C data transfer rate.
    // If false the data rate is set to 100kbps and if true the data rate will
    // be set to 400kbps.  For this example we will use a data rate of 100kbps.
    //
#if defined(TARGET_IS_TM4C129_RA0) ||                                         \
    defined(TARGET_IS_TM4C129_RA1) ||                                         \
    defined(TARGET_IS_TM4C129_RA2)
    I2CMasterInitExpClk(I2C0_BASE, ui32SysClock, false);
#else
    I2CMasterInitExpClk(I2C0_BASE, SysCtlClockGet(), false);
#endif

    //
    // Enable the I2C0 slave module. This module is enabled only for testing
    // purposes.  It does not need to be enabled for proper operation of the
    // I2Cx master module.
    //
    I2CSlaveEnable(I2C0_BASE);

    //
    // Set the slave address to SLAVE_ADDRESS.  In loopback mode, it's an
    // arbitrary 7-bit number (set in a macro above) that is sent to the
    // I2CMasterSlaveAddrSet function.
    //
    I2CSlaveInit(I2C0_BASE, SLAVE_ADDRESS);

    //
    // Tell the master module what address it will place on the bus when
    // communicating with the slave.  Set the address to SLAVE_ADDRESS
    // (as set in the slave module).  The receive parameter is set to false
    // which indicates the I2C Master is initiating a writes to the slave.  If
    // true, that would indicate that the I2C Master is initiating reads from
    // the slave.
    //
    I2CMasterSlaveAddrSet(I2C0_BASE, SLAVE_ADDRESS, false);

    //
    // Set up the serial console to use for displaying messages.  This is
    // just for this example program and is not needed for I2C operation.
    //
    InitConsole();

    //
    // Display the example setup on the console.
    //
    UARTprintf("I2C Loopback Example ->");
    UARTprintf("\n   Module = I2C0");
    UARTprintf("\n   Mode = Single Send/Receive");
    UARTprintf("\n   Rate = 100kbps\n\n");

    //
    // Initalize the data to send.
    //
    pui32DataTx[0] = 'I';
    pui32DataTx[1] = '2';
    pui32DataTx[2] = 'C';

    //
    // Initalize the receive buffer.
    //
    for(ui32Index = 0; ui32Index < NUM_I2C_DATA; ui32Index++)
    {
        pui32DataRx[ui32Index] = 0;
    }

    //
    // Indicate the direction of the data.
    //
    UARTprintf("Tranferring from: Master -> Slave\n");

    //
    // Send 3 peices of I2C data from the master to the slave.
    //
    for(ui32Index = 0; ui32Index < NUM_I2C_DATA; ui32Index++)
    {
        //
        // Display the data that the I2C0 master is transferring.
        //
        UARTprintf("  Sending: '%c'  . . .  ", pui32DataTx[ui32Index]);

        //
        // Place the data to be sent in the data register
        //
        I2CMasterDataPut(I2C0_BASE, pui32DataTx[ui32Index]);

        //
        // Initiate send of data from the master.  Since the loopback
        // mode is enabled, the master and slave units are connected
        // allowing us to receive the same data that we sent out.
        //
        I2CMasterControl(I2C0_BASE, I2C_MASTER_CMD_SINGLE_SEND);

        //
        // Wait until the slave has received and acknowledged the data.
        //
        while(!(I2CSlaveStatus(I2C0_BASE) & I2C_SLAVE_ACT_RREQ))
        {
        }

        //
        // Read the data from the slave.
        //
        pui32DataRx[ui32Index] = I2CSlaveDataGet(I2C0_BASE);

        //
        // Wait until master module is done transferring.
        //
        while(I2CMasterBusy(I2C0_BASE))
        {
        }

        //
        // Display the data that the slave has received.
        //
        UARTprintf("Received: '%c'\n", pui32DataRx[ui32Index]);
    }

    //
    // Reset receive buffer.
    //
    for(ui32Index = 0; ui32Index < NUM_I2C_DATA; ui32Index++)
    {
        pui32DataRx[ui32Index] = 0;
    }

    //
    // Indicate the direction of the data.
    //
    UARTprintf("\n\nTranferring from: Slave -> Master\n");

    //
    // Modifiy the data direction to true, so that seeing the address will
    // indicate that the I2C Master is initiating a read from the slave.
    //
    I2CMasterSlaveAddrSet(I2C0_BASE, SLAVE_ADDRESS, true);

    //
    // Do a dummy receive to make sure you don't get junk on the first receive.
    //
    I2CMasterControl(I2C0_BASE, I2C_MASTER_CMD_SINGLE_RECEIVE);

    //
    // Dummy acknowledge and wait for the receive request from the master.
    // This is done to clear any flags that should not be set.
    //
    while(!(I2CSlaveStatus(I2C0_BASE) & I2C_SLAVE_ACT_TREQ))
    {
    }

    for(ui32Index = 0; ui32Index < NUM_I2C_DATA; ui32Index++)
    {
        //
        // Display the data that I2C0 slave module is transferring.
        //
        UARTprintf("  Sending: '%c'  . . .  ", pui32DataTx[ui32Index]);

        //
        // Place the data to be sent in the data register
        //
        I2CSlaveDataPut(I2C0_BASE, pui32DataTx[ui32Index]);

        //
        // Tell the master to read data.
        //
        I2CMasterControl(I2C0_BASE, I2C_MASTER_CMD_SINGLE_RECEIVE);

        //
        // Wait until the slave is done sending data.
        //
        while(!(I2CSlaveStatus(I2C0_BASE) & I2C_SLAVE_ACT_TREQ))
        {
        }

        //
        // Read the data from the master.
        //
        pui32DataRx[ui32Index] = I2CMasterDataGet(I2C0_BASE);

        //
        // Display the data that the slave has received.
        //
        UARTprintf("Received: '%c'\n", pui32DataRx[ui32Index]);
    }

    //
    // Tell the user that the test is done.
    //
    UARTprintf("\nDone.\n\n");

    //
    // Return no errors
    //
    return(0);
}
asap 

  • This is the same example I run on EK-TM4C1294XL LaunchPad. Below is the terminal output.

    What do you see on the terminal output? 

    When you said you run EVK board, do you mean you run on EK-TM4C1294XL board?

    I also want to make sure in your project property, you are NOT selecting a TM4C123 device. Below is selecting TM4C129. 

  • this is the print iam getting

     

    yes i run on  EK-TM4C1294XL board only

    this is my predefined symbols settings

    please correct me any changes need to be done 

  • can you also tell the difference between RA0 and RA1 etc...

  • After this terminal output program gets aborted

    getting into the error here and aborted

    please help to resolve the issue

  • Your code is running normal. The reason in mine, I put a while(1) to repeat the I2C transactions. If I were to remove the while(1) to repeat the transactions, I would have also exited to abort() which is absolutely normal. main() is no different from any other function from C language stand point of view. When it finishes the last line of code in main() it needs to go somewhere and it just go abort routine. In a real application, you would not have the program exited main().

     Refer to this link about return(0) from main(). 

    https://www.tutorialspoint.com/What-should-main-return-in-C-and-Cplusplus#:~:text=The%20return%20value%20for%20main,non%2Dzero%20codes%20are%20interpreted.

  • I tried to run inside while but it get struck here after first set of data transmitted and could not able to transmit  data second time 

    can you please suggest what need to be done further

    debug log for your refernce

  • Why don't you try this attached code.

    //*****************************************************************************
    //
    // master_slave_loopback.c - Example demonstrating a simple I2C message
    //                           transmission and reception.
    //
    // Copyright (c) 2010-2020 Texas Instruments Incorporated.  All rights reserved.
    // Software License Agreement
    //
    //   Redistribution and use in source and binary forms, with or without
    //   modification, are permitted provided that the following conditions
    //   are met:
    //
    //   Redistributions of source code must retain the above copyright
    //   notice, this list of conditions and the following disclaimer.
    //
    //   Redistributions in binary form must reproduce the above copyright
    //   notice, this list of conditions and the following disclaimer in the
    //   documentation and/or other materials provided with the
    //   distribution.
    //
    //   Neither the name of Texas Instruments Incorporated nor the names of
    //   its contributors may be used to endorse or promote products derived
    //   from this software without specific prior written permission.
    //
    // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
    // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    //
    // This is part of revision 2.2.0.295 of the Tiva Firmware Development Package.
    //
    //*****************************************************************************
    
    #include <stdbool.h>
    #include <stdint.h>
    #include "inc/hw_i2c.h"
    #include "inc/hw_memmap.h"
    #include "inc/hw_types.h"
    #include "driverlib/gpio.h"
    #include "driverlib/i2c.h"
    #include "driverlib/pin_map.h"
    #include "driverlib/sysctl.h"
    #include "driverlib/uart.h"
    #include "utils/uartstdio.h"
    
    //*****************************************************************************
    //
    //! \addtogroup i2c_examples_list
    //! <h1>I2C Master Loopback (i2c_master_slave_loopback)</h1>
    //!
    //! This example shows how to configure the I2C0 module for loopback mode.
    //! This includes setting up the master and slave module.  Loopback mode
    //! internally connects the master and slave data and clock lines together.
    //! The address of the slave module is set in order to read data from the
    //! master.  Then the data is checked to make sure the received data matches
    //! the data that was transmitted.  This example uses a polling method for
    //! sending and receiving data.
    //!
    //! This example uses the following peripherals and I/O signals.  You must
    //! review these and change as needed for your own board:
    //! - I2C0 peripheral
    //! - GPIO Port B peripheral (for I2C0 pins)
    //! - I2C0SCL - PB2
    //! - I2C0SDA - PB3
    //!
    //! The following UART signals are configured only for displaying console
    //! messages for this example.  These are not required for operation of I2C.
    //! - UART0 peripheral
    //! - GPIO Port A peripheral (for UART0 pins)
    //! - UART0RX - PA0
    //! - UART0TX - PA1
    //!
    //! This example uses the following interrupt handlers.  To use this example
    //! in your own application you must add these interrupt handlers to your
    //! vector table.
    //! - None.
    //
    //*****************************************************************************
    
    //*****************************************************************************
    //
    // Number of I2C data packets to send.
    //
    //*****************************************************************************
    #define NUM_I2C_DATA 3
    
    //*****************************************************************************
    //
    // Set the address for slave module. This is a 7-bit address sent in the
    // following format:
    //                      [A6:A5:A4:A3:A2:A1:A0:RS]
    //
    // A zero in the "RS" position of the first byte means that the master
    // transmits (sends) data to the selected slave, and a one in this position
    // means that the master receives data from the slave.
    //
    //*****************************************************************************
    #define SLAVE_ADDRESS 0x3C
    
    #define I2C_BASE                I2C1_BASE
    #define I2C_SYSCTL              SYSCTL_PERIPH_I2C1
    
    #define I2C_SCL_SYSCTL_PERIPH   SYSCTL_PERIPH_GPIOG
    #define I2C_SCL_GPIO_PORT_BASE  GPIO_PORTG_BASE
    #define I2C_SCL                 GPIO_PIN_0
    #define I2C_SCL_CFG             GPIO_PG0_I2C1SCL
    
    #define I2C_SDA_SYSCTL_PERIPH   SYSCTL_PERIPH_GPIOG
    #define I2C_SDA_GPIO_PORT_BASE  GPIO_PORTG_BASE
    #define I2C_SDA                 GPIO_PIN_1
    #define I2C_SDA_CFG             GPIO_PG1_I2C1SDA
    
    //*****************************************************************************
    //
    // This function sets up UART0 to be used for a console to display information
    // as the example is running.
    //
    //*****************************************************************************
    void
    InitConsole(void)
    {
        //
        // Enable GPIO port A which is used for UART0 pins.
        // TODO: change this to whichever GPIO port you are using.
        //
        SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
    
        //
        // Configure the pin muxing for UART0 functions on port A0 and A1.
        // This step is not necessary if your part does not support pin muxing.
        // TODO: change this to select the port/pin you are using.
        //
        GPIOPinConfigure(GPIO_PA0_U0RX);
        GPIOPinConfigure(GPIO_PA1_U0TX);
    
        //
        // Enable UART0 so that we can configure the clock.
        //
        SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);
    
        //
        // Use the internal 16MHz oscillator as the UART clock source.
        //
        UARTClockSourceSet(UART0_BASE, UART_CLOCK_PIOSC);
    
        //
        // Select the alternate (UART) function for these pins.
        // TODO: change this to select the port/pin you are using.
        //
        GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);
    
        //
        // Initialize the UART for console I/O.
        //
        UARTStdioConfig(0, 115200, 16000000);
    }
    
    //*****************************************************************************
    //
    // Configure the I2C0 master and slave and connect them using loopback mode.
    //
    //*****************************************************************************
    int
    main(void)
    {
    #if defined(TARGET_IS_TM4C129_RA0) ||                                         \
        defined(TARGET_IS_TM4C129_RA1) ||                                         \
        defined(TARGET_IS_TM4C129_RA2)
        uint32_t ui32SysClock;
    #endif
        uint32_t pui32DataTx[NUM_I2C_DATA];
        uint32_t pui32DataRx[NUM_I2C_DATA];
        uint32_t ui32Index;
    
        //
        // Set the clocking to run directly from the external crystal/oscillator.
        // TODO: The SYSCTL_XTAL_ value must be changed to match the value of the
        // crystal on your board.
        //
    #if defined(TARGET_IS_TM4C129_RA0) ||                                         \
        defined(TARGET_IS_TM4C129_RA1) ||                                         \
        defined(TARGET_IS_TM4C129_RA2)
        ui32SysClock = SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ |
                                           SYSCTL_OSC_MAIN |
                                           SYSCTL_USE_OSC), 25000000);
    #else
        SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN |
                       SYSCTL_XTAL_16MHZ);
    #endif
    
        //
        // The I2C0 peripheral must be enabled before use.
        //
        SysCtlPeripheralEnable(I2C_SYSCTL);
        SysCtlPeripheralReset(I2C_SYSCTL);
    
        //
        // For this example I2C0 is used with PortB[3:2].  The actual port and
        // pins used may be different on your part, consult the data sheet for
        // more information.  GPIO port B needs to be enabled so these pins can
        // be used.
        // TODO: change this to whichever GPIO port you are using.
        //
        SysCtlPeripheralEnable(I2C_SCL_SYSCTL_PERIPH);
        SysCtlPeripheralEnable(I2C_SDA_SYSCTL_PERIPH);
        while(!SysCtlPeripheralReady(I2C_SCL_SYSCTL_PERIPH));
        while(!SysCtlPeripheralReady(I2C_SDA_SYSCTL_PERIPH));
    
        //
        // Configure the pin muxing for I2C0 functions on port B2 and B3.
        // This step is not necessary if your part does not support pin muxing.
        // TODO: change this to select the port/pin you are using.
        //
        GPIOPinConfigure(I2C_SCL_CFG);
        GPIOPinConfigure(I2C_SDA_CFG);
    
        //
        // Select the I2C function for these pins.  This function will also
        // configure the GPIO pins pins for I2C operation, setting them to
        // open-drain operation with weak pull-ups.  Consult the data sheet
        // to see which functions are allocated per pin.
        // TODO: change this to select the port/pin you are using.
        //
        GPIOPinTypeI2CSCL(I2C_SCL_GPIO_PORT_BASE, I2C_SCL);
        GPIOPinTypeI2C(I2C_SDA_GPIO_PORT_BASE, I2C_SDA);
    
        //
        // Enable loopback mode.  Loopback mode is a built in feature that is
        // useful for debugging I2C operations.  It internally connects the I2C
        // master and slave terminals, which effectively let's you send data as
        // a master and receive data as a slave.
        // NOTE: For external I2C operation you will need to use external pullups
        // that are stronger than the internal pullups.  Refer to the datasheet for
        // more information.
        //
        I2CLoopbackEnable(I2C_BASE);
    
        //
        // Enable and initialize the I2C0 master module.  Use the system clock for
        // the I2C0 module.  The last parameter sets the I2C data transfer rate.
        // If false the data rate is set to 100kbps and if true the data rate will
        // be set to 400kbps.  For this example we will use a data rate of 100kbps.
        //
    #if defined(TARGET_IS_TM4C129_RA0) ||                                         \
        defined(TARGET_IS_TM4C129_RA1) ||                                         \
        defined(TARGET_IS_TM4C129_RA2)
        I2CMasterInitExpClk(I2C_BASE, ui32SysClock, false);
    #else
        I2CMasterInitExpClk(I2C_BASE, SysCtlClockGet(), false);
    #endif
    
        //
        // Enable the I2C0 slave module. This module is enabled only for testing
        // purposes.  It does not need to be enabled for proper operation of the
        // I2Cx master module.
        //
        I2CSlaveEnable(I2C_BASE);
    
        //
        // Set the slave address to SLAVE_ADDRESS.  In loopback mode, it's an
        // arbitrary 7-bit number (set in a macro above) that is sent to the
        // I2CMasterSlaveAddrSet function.
        //
        I2CSlaveInit(I2C_BASE, SLAVE_ADDRESS);
    
        //
        // Set up the serial console to use for displaying messages.  This is
        // just for this example program and is not needed for I2C operation.
        //
        InitConsole();
    
        //
        // Display the example setup on the console.
        //
        UARTprintf("I2C Loopback Example ->");
        UARTprintf("\n   Module = I2C0");
        UARTprintf("\n   Mode = Single Send/Receive");
        UARTprintf("\n   Rate = 100kbps\n\n");
    
        while(1){
            //
            // Tell the master module what address it will place on the bus when
            // communicating with the slave.  Set the address to SLAVE_ADDRESS
            // (as set in the slave module).  The receive parameter is set to false
            // which indicates the I2C Master is initiating a writes to the slave.  If
            // true, that would indicate that the I2C Master is initiating reads from
            // the slave.
            //
            I2CMasterSlaveAddrSet(I2C_BASE, SLAVE_ADDRESS, false);
    
            //
            // Initalize the data to send.
            //
            pui32DataTx[0] = 'I';
            pui32DataTx[1] = '2';
            pui32DataTx[2] = 'C';
    
            //
            // Initalize the receive buffer.
            //
            for(ui32Index = 0; ui32Index < NUM_I2C_DATA; ui32Index++)
            {
                pui32DataRx[ui32Index] = 0;
            }
    
            //
            // Indicate the direction of the data.
            //
            UARTprintf("Tranferring from: Master -> Slave\n");
    
            //
            // Send 3 peices of I2C data from the master to the slave.
            //
            for(ui32Index = 0; ui32Index < NUM_I2C_DATA; ui32Index++)
            {
                //
                // Display the data that the I2C0 master is transferring.
                //
                UARTprintf("  Sending: '%c'  . . .  ", pui32DataTx[ui32Index]);
    
                //
                // Place the data to be sent in the data register
                //
                I2CMasterDataPut(I2C_BASE, pui32DataTx[ui32Index]);
    
                //
                // Initiate send of data from the master.  Since the loopback
                // mode is enabled, the master and slave units are connected
                // allowing us to receive the same data that we sent out.
                //
                I2CMasterControl(I2C_BASE, I2C_MASTER_CMD_SINGLE_SEND);
    
                //
                // Wait until the slave has received and acknowledged the data.
                //
                while(!(I2CSlaveStatus(I2C_BASE) & I2C_SLAVE_ACT_RREQ))
                {
                }
    
                //
                // Read the data from the slave.
                //
                pui32DataRx[ui32Index] = I2CSlaveDataGet(I2C_BASE);
    
                //
                // Wait until master module is done transferring.
                //
                while(I2CMasterBusy(I2C_BASE))
                {
                }
    
                //
                // Display the data that the slave has received.
                //
                UARTprintf("Received: '%c'\n", pui32DataRx[ui32Index]);
            }
    
            //
            // Reset receive buffer.
            //
            for(ui32Index = 0; ui32Index < NUM_I2C_DATA; ui32Index++)
            {
                pui32DataRx[ui32Index] = 0;
            }
    
            //
            // Indicate the direction of the data.
            //
            UARTprintf("\n\nTranferring from: Slave -> Master\n");
    
            //
            // Modifiy the data direction to true, so that seeing the address will
            // indicate that the I2C Master is initiating a read from the slave.
            //
            I2CMasterSlaveAddrSet(I2C_BASE, SLAVE_ADDRESS, true);
    
            for(ui32Index = 0; ui32Index < NUM_I2C_DATA; ui32Index++)
            {
                //
                // Display the data that I2C0 slave module is transferring.
                //
                UARTprintf("  Sending: '%c'  . . .  ", pui32DataTx[ui32Index]);
    
                //
                // Tell the master to read data.
                //
                I2CMasterControl(I2C_BASE, I2C_MASTER_CMD_SINGLE_RECEIVE);
    
    
                //
                // Wait until the slave is done sending data.
                //
                while(!(I2CSlaveStatus(I2C_BASE) & I2C_SLAVE_ACT_TREQ))
                {
                }
    
                //
                // Place the data to be sent in the data register
                //
                I2CSlaveDataPut(I2C_BASE, pui32DataTx[ui32Index]);
    
                while(I2CMasterBusy(I2C_BASE))
                    ;
    
                //
                // Read the data from the master.
                //
                pui32DataRx[ui32Index] = I2CMasterDataGet(I2C_BASE);
    
                //
                // Display the data that the slave has received.
                //
                UARTprintf("Received: '%c'\n", pui32DataRx[ui32Index]);
            }
    
    
            //
            // Tell the user that the test is done.
            //
            UARTprintf("\nDone.\n\n");
    
            SysCtlDelay(ui32SysClock/6);
        }
    
        //
        // Return no errors
        //
        return(0);
    }
    

  • I could to able to see data transfer in I2C1 in terminal , but some times it got struck need to check why

    But when I tried to check in digital oscilloscope (DSO) with pull up (10 k resistor in I2C1 CLK  and I2C1 DATA, PG0 and PG1 pins) i could not see any wave forms  and frequency value , can you confirm that if we probe those lines we could able see I2C waveform since it is internal loopback code.

    if possible can you please share I2C waveforms using this code 

  • could not able to capture 100 Kbps I2C clock waveform , any adjustments in system clock or PLL calculation need to be made in function I2CMasterInitExpClk(),

    so that will get capture clear I2C clock and data waveform

  • Hi,

    But when I tried to check in digital oscilloscope (DSO) with pull up (10 k resistor in I2C1 CLK  and I2C1 DATA, PG0 and PG1 pins) i could not see any wave forms  and frequency value , can you confirm that if we probe those lines we could able see I2C waveform since it is internal loopback code.

    if possible can you please share I2C waveforms using this code 

    If you are in loopback mode then you cannot see bus activities. The example I showed was for I2C0. Do you have any problem running it?

  • HI 

    I am using this code but still I could not send the data in I2c  iam getting the following error 

    when I tried to write first time the data is written to the slave which i could able to capture in I2c analayzer

    but when i continuously try to write the next configuration register 

    iam getting I2c error  

    Can you please help me to  check the code any changes to be made in the code

    //============================================================================
    // Name        : i2cAPI.c
    // Author      :
    // Version     :
    // Copyright   : Your copyright notice
    // Description : Tiva i2c in C++, Ansi-style
    //============================================================================
    /*
     * i2cAPI.c
     * Implementation of a i2c interface
     *
     * Copyright
     *
     * Redistribution and use in source and binary forms, with or without modification,
     * are permitted provided that the following conditions are met:
     * 1. Redistributions of source code must retain the above copyright
     *    notice, this list of conditions and the following disclaimer.
     * 2. Redistributions in binary form must reproduce the above copyright
     *    notice, this list of conditions and the following disclaimer in the
     *    documentation and/or other materials provided with the distribution.
     *
     * THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
     * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
     * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL I
     * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
     * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
     * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
     * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     */
    
    
    #include <stdbool.h>
    #include <stdint.h>
    #include "inc/hw_i2c.h"
    #include "inc/hw_memmap.h"
    #include "inc/hw_types.h"
    #include "driverlib/gpio.h"
    #include "driverlib/i2c.h"
    #include "driverlib/pin_map.h"
    #include "driverlib/sysctl.h"
    #include "driverlib/uart.h"
    #include "utils/uartstdio.h"
    #include "i2cAPI.h"
    #include "drivers/pinout.h"
    
    
    // TivaWare includes
    #include "driverlib/sysctl.h"
    #include "driverlib/debug.h"
    #include "driverlib/rom.h"
    #include "driverlib/rom_map.h"
    
    
    #define SLAVE_ADDRESS 0x14
    
    #define I2C_BASE                I2C1_BASE
    #define I2C_SYSCTL              SYSCTL_PERIPH_I2C1
    
    #define I2C_SCL_SYSCTL_PERIPH   SYSCTL_PERIPH_GPIOG
    #define I2C_SCL_GPIO_PORT_BASE  GPIO_PORTG_BASE
    #define I2C_SCL                 GPIO_PIN_0
    #define I2C_SCL_CFG             GPIO_PG0_I2C1SCL
    
    #define I2C_SDA_SYSCTL_PERIPH   SYSCTL_PERIPH_GPIOG
    #define I2C_SDA_GPIO_PORT_BASE  GPIO_PORTG_BASE
    #define I2C_SDA                 GPIO_PIN_1
    #define I2C_SDA_CFG             GPIO_PG1_I2C1SDA
    
    uint32_t i2c_init(uint32_t ui32SysClock)
    {
    
    
    
        //
        // Set the clocking to run directly from the external crystal/oscillator.
        // TODO: The SYSCTL_XTAL_ value must be changed to match the value of the
        // crystal on your board.
        //
    /*
    #if defined(TARGET_IS_TM4C129_RA0) ||                                         \
        defined(TARGET_IS_TM4C129_RA1) ||                                         \
        defined(TARGET_IS_TM4C129_RA2)
        ui32SysClock = SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ |
                                           SYSCTL_OSC_MAIN |
                                           SYSCTL_USE_PLL |
                                           SYSCTL_CFG_VCO_240), 80000000);
    #else
        SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN |
                       SYSCTL_XTAL_16MHZ);
    #endif
    */
    
        //
        // The I2C0 peripheral must be enabled before use.
        //
        SysCtlPeripheralDisable(I2C_SYSCTL);
        SysCtlPeripheralReset(I2C_SYSCTL);
        SysCtlPeripheralEnable(I2C_SYSCTL);
    
        while(!SysCtlPeripheralReady(I2C_SYSCTL));
        //
        // For this example I2C0 is used with PortB[3:2].  The actual port and
        // pins used may be different on your part, consult the data sheet for
        // more information.  GPIO port B needs to be enabled so these pins can
        // be used.
        // TODO: change this to whichever GPIO port you are using.
        //
        SysCtlPeripheralEnable(I2C_SCL_SYSCTL_PERIPH);
        SysCtlPeripheralEnable(I2C_SDA_SYSCTL_PERIPH);
        while(!SysCtlPeripheralReady(I2C_SCL_SYSCTL_PERIPH));
        while(!SysCtlPeripheralReady(I2C_SDA_SYSCTL_PERIPH));
    
    
        //
        // Configure the pin muxing for I2C0 functions on port B2 and B3.
        // This step is not necessary if your part does not support pin muxing.
        // TODO: change this to select the port/pin you are using.
        //
        GPIOPinConfigure(I2C_SCL_CFG);
        GPIOPinConfigure(I2C_SDA_CFG);
    
        //
        // Select the I2C function for these pins.  This function will also
        // configure the GPIO pins pins for I2C operation, setting them to
        // open-drain operation with weak pull-ups.  Consult the data sheet
        // to see which functions are allocated per pin.
        // TODO: change this to select the port/pin you are using.
        //
        GPIOPinTypeI2CSCL(I2C_SCL_GPIO_PORT_BASE, I2C_SCL);
        GPIOPinTypeI2C(I2C_SDA_GPIO_PORT_BASE, I2C_SDA);
    
    
    
        I2CMasterGlitchFilterConfigSet(I2C_BASE, I2C_MASTER_GLITCH_FILTER_2);
    
        //
        // Enable and initialize the I2C0 master module.  Use the system clock for
        // the I2C0 module.  The last parameter sets the I2C data transfer rate.
        // If false the data rate is set to 100kbps and if true the data rate will
        // be set to 400kbps.  For this example we will use a data rate of 100kbps.
        //
    
    #if defined(TARGET_IS_TM4C129_RA0) ||                                         \
        defined(TARGET_IS_TM4C129_RA1) ||                                         \
        defined(TARGET_IS_TM4C129_RA2)
        I2CMasterInitExpClk(I2C_BASE, ui32SysClock, false);
    #else
        I2CMasterInitExpClk(I2C_BASE, SysCtlClockGet(), false);
    #endif
    
        //
        // Enable the I2C0 slave module. This module is enabled only for testing
        // purposes.  It does not need to be enabled for proper operation of the
        // I2Cx master module.
        //
        //I2CSlaveEnable(I2C_BASE);
    
        //
        // Set the slave address to SLAVE_ADDRESS.  In loopback mode, it's an
        // arbitrary 7-bit number (set in a macro above) that is sent to the
        // I2CMasterSlaveAddrSet function.
        //
        //I2CSlaveInit(I2C_BASE, SLAVE_ADDRESS);
    
    }
    
    
    //read specified register on slave device
    uint32_t I2CReceive(uint32_t slave_addr, uint8_t reg)
    {
        //specify that we are writing (a register address) to the
        //slave device
        I2CMasterSlaveAddrSet(I2C_BASE, slave_addr, false);
    
        //specify register to be read
        I2CMasterDataPut(I2C_BASE, reg);
    
        //send control byte and register address byte to slave device
    //    I2CMasterControl(I2C_BASE, I2C_MASTER_CMD_BURST_SEND_START);
        I2CMasterControl(I2C_BASE, I2C_MASTER_CMD_SINGLE_SEND);
        SysCtlDelay(3000);
        //wait for MCU to finish transaction
        while(I2CMasterBusy(I2C_BASE));
    //    //Check for errors in the I2C8 Module
    //    while (I2CMasterErr(I2C_BASE)){
    //        UARTprintf("I2c_errror\r\n");
    //    }
        //specify that we are going to read from slave device
        I2CMasterSlaveAddrSet(I2C_BASE, slave_addr, true);
    
        //send control byte and read from the register we
        //specified
        I2CMasterControl(I2C_BASE, I2C_MASTER_CMD_SINGLE_RECEIVE);
    
        //wait for MCU to finish transaction
        while(I2CMasterBusy(I2C_BASE));
    
        //return data pulled from the specified register
        return I2CMasterDataGet(I2C_BASE);
    }
    
    //sends an I2C command to the specified slave
    void I2CSend(uint8_t slave_addr, uint8_t num_of_args, ...)
    {
        // Tell the master module what address it will place on the bus when
        // communicating with the slave.
        I2CMasterSlaveAddrSet(I2C_BASE, slave_addr, false);
    
        //stores list of variable number of arguments
        va_list vargs;
    
        //specifies the va_list to "open" and the last fixed argument
        //so vargs knows where to start looking
        va_start(vargs, num_of_args);
    
        //put data to be sent into FIFO
        I2CMasterDataPut(I2C_BASE, va_arg(vargs, uint32_t));
    
        //if there is only one argument, we only need to use the
        //single send I2C function
        if(num_of_args == 1)
        {
            //Initiate send of data from the MCU
            I2CMasterControl(I2C_BASE, I2C_MASTER_CMD_SINGLE_SEND);
    
            SysCtlDelay(1000);
            // Wait until MCU is done transferring.
            while(I2CMasterBusy(I2C_BASE));
    
            //Check for errors in the I2C8 Module
            while (I2CMasterErr(I2C_BASE)){
                UARTprintf("I2c_errror\r\n");
            }
    
            //"close" variable argument list
            va_end(vargs);
        }
    
        //otherwise, we start transmission of multiple bytes on the
        //I2C bus
        else
        {
            //Initiate send of data from the MCU
            I2CMasterControl(I2C_BASE, I2C_MASTER_CMD_BURST_SEND_START);
            SysCtlDelay(1000);
            // Wait until MCU is done transferring.
            while(I2CMasterBusy(I2C_BASE));
    
            while (I2CMasterErr(I2C_BASE)){
                        UARTprintf("I2c_errror\r\n");
                    }
    
            //send num_of_args-2 pieces of data, using the
            //BURST_SEND_CONT command of the I2C module
            uint8_t i = 0;
            for (i = 1; i < (num_of_args - 1); i++)
            {
                //put next piece of data into I2C FIFO
                I2CMasterDataPut(I2C_BASE, va_arg(vargs, uint32_t));
                //send next data that was just placed into FIFO
                I2CMasterControl(I2C_BASE, I2C_MASTER_CMD_BURST_SEND_CONT);
    
                SysCtlDelay(1000);
    
                // Wait until MCU is done transferring.
                while(I2CMasterBusy(I2C_BASE));
    
                while (I2CMasterErr(I2C_BASE)){
                                    UARTprintf("I2c_errror\r\n");
                                }
    
            }
    
            //put last piece of data into I2C FIFO
            I2CMasterDataPut(I2C_BASE, va_arg(vargs, uint32_t));
            //send next data that was just placed into FIFO
            I2CMasterControl(I2C_BASE, I2C_MASTER_CMD_BURST_SEND_FINISH);
            // Wait until MCU is done transferring.
    
            SysCtlDelay(1000);
            while(I2CMasterBusy(I2C_BASE));
    
            while (I2CMasterErr(I2C_BASE)){
                UARTprintf("I2c_errror\r\n");
             }
    
            //"close" variable args list
            va_end(vargs);
        }
    }
    
    //sends an array of data via I2C to the specified slave
    void I2CSendString(uint32_t slave_addr, char array[])
    {
    
        // Tell the master module what address it will place on the bus when
        // communicating with the slave.
        I2CMasterSlaveAddrSet(I2C_BASE, slave_addr, false);
    
        //put data to be sent into FIFO
        I2CMasterDataPut(I2C_BASE, array[0]);
    
        //if there is only one argument, we only need to use the
        //single send I2C function
        if(array[1] == '\0')
        {
            //Initiate send of data from the MCU
            I2CMasterControl(I2C_BASE, I2C_MASTER_CMD_SINGLE_SEND);
    
            // Wait until MCU is done transferring.
            while(I2CMasterBusy(I2C_BASE));
        }
    
        //otherwise, we start transmission of multiple bytes on the
        //I2C bus
        else
        {
            //Initiate send of data from the MCU
            I2CMasterControl(I2C_BASE, I2C_MASTER_CMD_BURST_SEND_START);
    
            // Wait until MCU is done transferring.
            while(I2CMasterBusy(I2C_BASE));
    
            //initialize index into array
            uint8_t i = 1;
    
            //send num_of_args-2 pieces of data, using the
            //BURST_SEND_CONT command of the I2C module
            while(array[i + 1] != '\0')
            {
                //put next piece of data into I2C FIFO
                I2CMasterDataPut(I2C_BASE, array[i++]);
    
                //send next data that was just placed into FIFO
                I2CMasterControl(I2C_BASE, I2C_MASTER_CMD_BURST_SEND_CONT);
    
                // Wait until MCU is done transferring.
                while(I2CMasterBusy(I2C_BASE));
            }
    
            //put last piece of data into I2C FIFO
            I2CMasterDataPut(I2C_BASE, array[i]);
    
            //send next data that was just placed into FIFO
            I2CMasterControl(I2C_BASE, I2C_MASTER_CMD_BURST_SEND_FINISH);
    
            // Wait until MCU is done transferring.
            while(I2CMasterBusy(I2C_BASE));
        }
    }
    
    

  • Iam using the following function to write the data to slave

  • Hi,

    when I tried to write first time the data is written to the slave which i could able to capture in I2c analayzer

    I think it is a good improvement. Earlier, I thought you said it didn't work at all. 

    Can you at every place where you have while(I2CMasterBusy(I2C_BASE)) in your code,  add another line before it highlighted in red. Does it make a difference? Please refer to this post too. https://e2e.ti.com/support/power-management-group/power-management/f/power-management-forum/844446/tpsm846c23evm-806-why-ic2-needs-certain-delay-in-tpsm846c23evm-806-for-every-data-byte-transmission

    while(!I2CMasterBusy(I2C_BASE)); // Add this line before wherever you have the below line. 

    while(I2CMasterBusy(I2C_BASE));

  • HI charles

    I am trying to access the I2C  from the DRV2605L haptics  EVM-CT with the changes you ask to make but still I could not access the slave (0xA5)

    when i tried to write the mode register (0x01) to "0"  the write is not working ,the code struck at this place which you ask to add.

    when i tried to capture the with I2c beagle analyzer i am getting like this data transaction, but no data is available 

    This is the haptic EVK we are used for testing

    https://www.digikey.in/en/products/detail/texas-instruments/DRV2605EVM-CT/3902120?cur=INR&lang=en&utm_adgroup=&utm_source=google&utm_medium=cpc&utm_campaign=PMax%20Shopping_Product_High%20ROAS&utm_term=&productid=3902120&gclid=Cj0KCQjwi7GnBhDXARIsAFLvH4k8Bd09PYBjO3qScILr9iTHxg_zlhPL4jx7rOR1WIPPLFwkyPqUQtIaAqB-EALw_wcB

    please help me to solve the issue 

    I don't know any connection between tm4c129x EVK and haptic EVK which causing the I2C busy issue ?

  • Hi,

      Can you use preferably a logic analyzer or a scope to capture the I2C bus waveforms.   They are an invaluable tool to debug I2C.  Please show both SCL and SDA buses.