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.

I2C Example in SW-TM4C-DRL-UG-2.1.0.12573.pdf

Hi,  I was trying to run the I2C example in the SW-TM4C-DRL-UG-2.1.0.12573.pdf.   The problem is it only send out the address.  Below is the code and test results.  There must be something very simple that I am missing.

Thank you

void TEST () {
    //
    // Initialize Master and Slave
    //
    I2CMasterInitExpClk(I2C0_BASE, 120000000, true);
    //
    // Specify slave address
    //
    I2CMasterSlaveAddrSet(I2C0_BASE, 0x3B, false);
    //
    // Place the character to be sent in the data register
    //
    I2CMasterDataPut(I2C0_BASE, 'Q');
    //
    // Initiate send of character from Master to Slave
    //
    I2CMasterControl(I2C0_BASE, I2C_MASTER_CMD_SINGLE_SEND);
    //
    // Delay until transmission completes
    //
    while(I2CMasterBusBusy(I2C0_BASE))
    {
    }
}


  • Hi All,

    I think I figured it out, because their was nothing at address.  The I2C master did not continue.  This is my best guest.

  • Hello Daniel,

    Yes, you guessed it correct. In the LA snapshot the ACK bit value is '1', which means there is no Slave device on the bus with the address being sent out by I2C Master

    Regards

    Amit

  • Pardon - but is not the "real issue" here - "Why is the Slave Address unrecognized?"

    Note that I2C chip vendors are not fully consistent in defining/describing their I2C address formats.  Vendor here employs a 7 bit address field - the lsb is "auto-filled" by the MCU's assertion of "read or write."  Often - this causes confusion. 

    Careful review of your bus transaction address vs. the Slave's address reveals the correctness (or not) of your MCU's address mastery.  We most always begin with a very simple, known-good I2C Slave.  (i.e. a small capacity, EEPROM)  Too many here "start" with a complex I2C Slave - and their avoidance of the (necessary, confidence building ,baby step) eats time, effort, morale - funds if they're "in business."

    Proper, external I2C pull-up resistors are required - as is your inspection that signal routing is short, direct and "free" from foreign/unwanted signal/component intrusions...  (i.e. launchpads "famed" for (unwanted/unwise) MCU to MCU pre-routed/enabled connections!)