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.

CCS/TM4C1231D5PM: I2C on TM4C123

Part Number: TM4C1231D5PM

Tool/software: Code Composer Studio

I am transmitting 4 bytes over I2C and for some reason I2CMasterErr is returning a value of 12. A return error status of 12 is not defined and it should be one of the following:

Transmit function:

  

Any explanation for a I2CMasterErr return of 12?

  • Hello Joe,

    Did the I2CMasterErr function get modified in any way?

    An error of 0x12 just means Arbitration Lost and an Error occurred. The 0x10 is the Arbitration Lost, and the 0x02 is the indicator of an I2C error. The I2CMasterErr function masks out the I2C error indicator so you only get back one of the flags you mentioned:

        //
        // Check for errors.
        //
        if(ui32Err & (I2C_MCS_ERROR | I2C_MCS_ARBLST))
        {
            return(ui32Err & (I2C_MCS_ARBLST | I2C_MCS_DATACK | I2C_MCS_ADRACK));
        }
        else
        {
            return(I2C_MASTER_ERR_NONE);
        }

    I suspect that the above code was modified in driverlib.

    Anyways, the 0x12 means Arbitration Lost so you can debug from there.

    By the way you can see the full description of bits from that register on page 981 and 982 of the device datasheet.