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.

Compiler/EK-TM4C123GXL: I2C communication with TS0108E (level converter)

Part Number: EK-TM4C123GXL

Tool/software: TI C/C++ Compiler

I am trying to build an I2C Master interface using PCF8547(I/O Expander Module). When i am build circuit using level converter MH it working fine , Using TS0108E(TI - level converter ) SDA,SCL lines not working .

when i am checking with logic analyzer, Low end side getting data but in hand of High end side not receiving data , so I'm thinking this may be something I may be doing wrong with the use of the Level converter. 

Here's the initialization routine:

void initI2C0(void)
{
    //This function is for eewiki and is to be updated to handle any port

    //enable I2C module
    SysCtlPeripheralEnable(SYSCTL_PERIPH_I2C0);

    //reset I2C module
    SysCtlPeripheralReset(SYSCTL_PERIPH_I2C0);

    //enable GPIO peripheral that contains I2C
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);

    // Configure the pin muxing for I2C0 functions on port B2 and B3.
    GPIOPinConfigure(GPIO_PB2_I2C0SCL);
    GPIOPinConfigure(GPIO_PB3_I2C0SDA);

    // Select the I2C function for these pins.
    GPIOPinTypeI2CSCL(GPIO_PORTB_BASE, GPIO_PIN_2);
    GPIOPinTypeI2C(GPIO_PORTB_BASE, GPIO_PIN_3);

    // 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.
    I2CMasterInitExpClk(I2C0_BASE, SysCtlClockGet(), false);

    //clear I2C FIFOs
    HWREG(I2C0_BASE + I2C_O_FIFOCTL) = 80008000;
}

I have done things are TSTS0108E,

1.OE lines -HIGH (3.3V)

2.Checked Module is working fine

TM4C123GXL

1. I2C  clock frequency reduced .

2.Used external pullup resistors.

Any ideas what I may be doing wrong?

Thanks ;)
Any

  • Hello,

    You report "difficulty" (failure to boost I2C levels) when deploying I2C level converter, "TSTS0108E"

    Later you note:

    I have done things are TSTS0108E,

    1.OE lines -HIGH (3.3V)

    It is far more 'normal/customary' for OE to be driven LOW (~Gnd) to enable outputs.   Indeed - try that.   Should that change fail - add pull-up resistors (~10K) to both SDA & SCL (at both 'sides' of the level booster) & test again...

  • What voltage are you using for the PCF8547? Can you provide a schematic of your connections of the I2C lines showing the PCF8547, the TS0108E, the EK-TM4C123GXL and any external pullup resistors?

  • Thank you for the diagram. A couple of clarification questions. From the diagram it looks like you have two pull-ups on the uC SCL line. I suspect that is just a drawing error and you have one on SCL and the other on SDA. Is that correct? You mentioned  "when i am checking with logic analyzer, Low end side getting data but in hand of High end side not receiving data ".  Are the SCL and SDA lines on the B (5V) side stuck high or low? It would be helpful if you could post a scope shot or logic analyzer shot of SCL and SDA on both the 3.3V side and 5V sides. 

    That said, I want to point out that the I2C I/Os on the TM4C123 device are 5V tolerant. Since the SCL and SDA signals are open drain, you can connect them directly to the PCF8547 and use 5V pull-up resistors. No level translator is needed.