Because of the holidays, TI E2E™ design support forum responses will be delayed from Dec. 25 through Jan. 2. Thank you for your patience.

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.

LDC1612: No I2C acknowledge from the LDC1612 when connected to the F28069M

Part Number: LDC1612

I'm trying to communicate with the LDC1612 through an I2C interface, using my C2000 F28069M board. I've configured pins 9 and 10 (GPIO 33 and 32 respectively) to be the I2C SCL and SDA lines.

This is my GPIO configuration:

EALLOW;
GpioCtrlRegs.GPAMUX1.all = 0x00000000;  // GPIO0  - GPIO15
GpioCtrlRegs.GPAMUX2.all = 0x05000000;  // GPIO16 - GPIO31
GpioCtrlRegs.GPBMUX1.all = 0x00000005;  // GPIO32 - GPIO44
GpioCtrlRegs.GPBMUX2.all = 0x00000000;  // GPIO50 - GPIO58

GpioCtrlRegs.GPADIR.all  = 0x20030000;  // Direction of GPIO0  - GPIO31
GpioCtrlRegs.GPBDIR.all  = 0x00000087;  // Direction of GPIO32 - GPIO44

GpioCtrlRegs.GPAQSEL1.all = 0x00000000; // GPIO0  - GPIO15
GpioCtrlRegs.GPAQSEL2.all = 0x03000000; // GPIO16 - GPIO31
GpioCtrlRegs.GPBQSEL1.all = 0x00000003; // GPIO32 - GPIO44
GpioCtrlRegs.GPBQSEL2.all = 0x00000000; // GPIO45 - GPIO58

GpioCtrlRegs.GPAPUD.all = 0x00000000;   // GPIO0  - GPIO31
GpioCtrlRegs.GPBPUD.all = 0x00000084;   // GPIO32 - GPIO58
EDIS;

Other than that, I've defined the address of the LDC1612 here.

#define INDUCT_SLAVE_ADDR       0x2A

I've grounded both the ADDR and the GND pins on the LDC 1612, and I have Pin 9 (SCL) going to SCL on the sensor, with Pin 10 (SDA) also going directly into the sensor's SDA pin. And finally I have one of the 3.3V pins on the board going into the sensor (I've checked there is power going to the Inductance Sensor).

Now, my problem is that whenever I try to read or write to the LDC1612, I am unable to receive so much as an acknowledgement-bit, leaving my code infinitely looping while it waits for IcaRegs.I2CSTR.bit.XRDY to change to 1. This is the code I'm using to try and read the Data channel:

    unsigned int i             = 0;
    unsigned long registerData = 0;              // We need a long because the data is 28-bits, ints are 16
    while (I2caRegs.I2CSTR.bit.BB == 1) {};      // Wait for the I2C bus to free up

    I2caRegs.I2CSAR = INDUCT_SLAVE_ADDR;
    I2caRegs.I2CCNT = 1;

    I2caRegs.I2CDXR = (channel == 0) ? 0x00 : 0x02;
    I2caRegs.I2CMDR.bit.TRX  = 1;                // Set the module to transmission mode
    I2caRegs.I2CMDR.bit.MST  = 1;                // Set the module to Master mode
    I2caRegs.I2CMDR.bit.FREE = 1;                // Run in free mode (doesn't stop at debugger breakpoints)
    I2caRegs.I2CMDR.bit.STP  = 0;                // Don't release the bus after transmission
    I2caRegs.I2CMDR.bit.STT  = 1;                // Send a start bit

    while (I2caRegs.I2CSTR.bit.XRDY == 0) {};    // Do nothing until the previous command is processed
    I2caRegs.I2CCNT          = 4;                // Set read-count to four data bytes
    I2caRegs.I2CMDR.bit.TRX  = 0;                // Set the module to receive mode
    I2caRegs.I2CMDR.bit.MST  = 1;
    I2caRegs.I2CMDR.bit.FREE = 1;
    I2caRegs.I2CMDR.bit.STP  = 1;                // Tell the module to STOP when the I2CCNT value has been reached
    I2caRegs.I2CMDR.bit.STT  = 1;                // Repeated start, Reception will follow

    // The data registers are 4 sequences of 8-bits. The first 4 bits are error codes, i.e. not useful
    for (i = 0; i < 4; i++) {                    // Read the register (who's value is 2 bytes, so two I2C data sequences)
        while (I2caRegs.I2CSTR.bit.RRDY == 0){}; // Wait for the bus to be free
        I2CRxData[i] = I2caRegs.I2CDRR;          // Actually read the data
    }

    registerData = ((long)I2CRxData[0] & 0x07);
    registerData = registerData << 8;
    registerData = registerData + (long)I2CRxData[1];
    registerData = registerData << 8;
    registerData = registerData + (long)I2CRxData[2];
    registerData = registerData << 8;
    registerData = registerData + (long)I2CRxData[3];

Looking at the SDA channel on an oscilloscope, I see the Start bit -> 7 Address bits equaling 2A -> a LOW signal corresponding to a Write command -> high signal on the SDA line for the rest of the program.

This is my first program using I2C at this level, so I'm probably missing something very simple. Thanks in advanced!

  • And I almost forgot, I initially configure my I2C module with this function:

    // Initialize the I2C module
    void initializeI2CA(void){
    I2caRegs.I2CMDR.bit.IRS = 0; // Reset I2C

    I2caRegs.I2CSAR = INDUCT_SLAVE_ADDR;
    I2caRegs.I2CPSC.all = 8; // 8 Corresponds to 10MHz (100 nanosecond Period)
    I2caRegs.I2CCLKL = 60; // Counts clock is low
    I2caRegs.I2CCLKH = 40; // Counts clock is high
    I2caRegs.I2CIER.all = 0x00; // Interrupts
    I2caRegs.I2CFFTX.all = 0x0000; // Tx FIFO mode disabled
    I2caRegs.I2CFFRX.all = 0x0000; // Rx FIFO mode disabled

    I2caRegs.I2CMDR.bit.IRS = 1; // Take I2C out of reset
    }
  • Hi Collin,

    I'd like to make sure that you don't have a hardware issue. Based on the fact that you see the SDA line revert to a high signal, it sounds like you have the required pull-up resistors on your SCL and SDA lines. What values are these resistors?

    It also sounds like you connected a 3.3V power pin from the micro to the LC tank, is this correct? If this is the case, you will add a DC offset to the AC sensor voltage, which will likely turn on the internal ESD diodes. At some point this can damage the device. You do not need to connect power to the LC tank; the LDC1612 is built to drive the LC tank alone.

    It would be very helpful if you shared your schematic.

    Regards,
  • Sorry I accidentally clicked the resolved issue button! My apologies.

    The pull-up resistors I am using are 2.87 kΩ (1%).

    I've attached my schematic, sorry if it is not very technical, but it shows how I've wired each of the pins that are available on the LDC 1612. The coil I am using is one of the LDC reference coils (I believe Coil M).

  • Hi Collin,

    You do not need to connect INTB to ground. This pin has an internal pull-up resistor, so connecting it to ground will increase your current draw. However, this shouldn't cause the device to malfunction, and otherwise your schematic looks correct.

    Could use an oscilloscope to verify that the sensor oscillation amplitude is between 1.2-1.8V, with a frequency between 10kHz and 10MHz?

    Regards,
  • Thanks for the help, I was finally able to resolve the problem. After removing the Ground connection on the INTB pin and re-reading the Datasheet, I noticed that the SD (shutdown) pin cannot float. After grounding that as well, everything is working as intended.

    Thanks again!