MSPM0C1104: Issue in i2C

Part Number: MSPM0C1104
Other Parts Discussed in Thread: SYSCONFIG, , MSPM0C1106, OPT3001, HDC2010

We are trying bebug I2c as SCL remain high &SDA plled low,guess clock is not getting configured.

Please advise solution.

  • I2C controller TXFIFO size is how much max! we want to transmit 6 byte configuration, FIFO  full happens with 3 bytes only.

  • Hi Seema,
    What examples are you running in the SDK? You should be able to modify the FIFO trigger levels in SYSCONFIG as the example bellow.

    Best Regards,

    Diego Abad

  • Hi Diego ,

    In the example code i2c_sensors_to_uart_LP_MSPM0C1104_nortos_ticlang default FIFO trigger levels set to 0 we tried setting the same to 6 as we want to transfer 6 bytes ,found transfer happens for 4 bytes only.

    on the I2C pin SDA remain Low SCL High,no clock found.We have connected pull up resistors 2.2k on SCL SDA.

    Please  guide to start I2C.

    Regards

    Seema Joshi

  • Hi Seema,

    I'll evaluate the example and let you know what I find out.

    Best Regards,

    Diego Abad

  • Hi Seema,
    I tried the example from my side and it seems to be working fine. I tried with our SDK example with a 6 size message, and I was able to see an issue similar to your behavior. I believe you can use the following function to avoid this issue:

    DL_I2C_ClockConfig gI2CclockConfig; // Declare this as a global 
    void sendI2CTxMsg(uint8_t *I2CTransmitGroup, uint32_t address, uint8_t size){

        /* Get I2C clock source and clock divider to use for delay cycle calculation */
        DL_I2C_getClockConfig(I2C_INST, &gI2CclockConfig);
        /*Calculate number of clock cycles to delay after controller transfer initiated
         * gDelayCycles = 3 I2C functional clock cycles
         * gDelayCycles = 3 * I2C clock divider * (CPU clock freq / I2C clock freq)
         */
        uint32_t delayCycles = (3 * (gI2CclockConfig.divideRatio + 1)) * (CPUCLK_FREQ / 24000000);

        uint8_t txCount = DL_I2C_fillControllerTXFIFO(I2C_INST, &I2CTransmitGroup[0], size);                        /* Fills TX FIFO with I2C Buffer data*/
        while (!(DL_I2C_getControllerStatus(I2C_INST) & DL_I2C_CONTROLLER_STATUS_IDLE));                            /* Wait for I2C to finish filling the FIFOs */
        DL_I2C_startControllerTransfer(I2C_INST, address, DL_I2C_CONTROLLER_DIRECTION_TX, size);                    /* Send the packet to the controller. This function will send Start + Stop automatically. */
        while(txCount < size){                                                                                      /* Repeats filling the Fifo is the message is not yet finished*/
            txCount += DL_I2C_fillControllerTXFIFO(I2C_INST, &I2CTransmitGroup[txCount], size - txCount);
            delay_cycles(delayCycles);    /* I hate that we cannot write without delays */
        }
        while (DL_I2C_getControllerStatus(I2C_INST) &DL_I2C_CONTROLLER_STATUS_BUSY_BUS);                            /* Wait for I2C to finish sending data */
        DL_I2C_flushControllerTXFIFO(I2C_INST);                                                                     /* Flushes I2C TX FIFO */
    }
  • Dear Diego,

    We found no transition on SCL,SDA   output ,as we tried to monitor during function ,after the changes mentioned.

    setMeasurementConfigurationsForSensors();
    Please guide how to debug check the I2C  in CCS
    Regards
    Seema Joshi
     
  • Hi Seema,
    Just to confirm, which sensor device are you using? Can you share a capture of your I2C communications and a copy of your project? Finally, if you change back the size of the message to 4, does it make the example work?

    Best Regards,

    Diego Abad

  • As near as I can tell, the TX FIFO size on the C1104 is 4, not 8. Specifically: After initialization, I see that CFIFOSR:TXFIFOCNT=4, not 8.This is also the case for the MSPM0C1106.

    This disagrees with TRM (SLAU893C) Sec 16.1.2 and Fig 16-1. It agrees with I2C_SYS_FENTRIES(=4) in mspm0c110x.h.

    If you try to put 6 bytes into the TX FIFO, 2 of them will be lost, and the transaction (as you observe) will hang with SCL low, waiting for the CPU to provide 2 more bytes. If you need to send more than 4 bytes, you'll need a loop using DL_I2C_fillControllerTXFIFO() (as Diego has provided).

  • DeAr  Diego,Bruce,

    We are interfacing Murrata device IRS-D200ST00R1.

    It is expected to send the 18 bytes (address (9)+ commands(9)) to configure the sensor.

    Then send command status ,& read 

    Then read status write command ,read data .

    Then data  write address ,read data 2 times.

     

    Please let us know shall we call    "configureTarget"  4 times for 16 bytes & once for 2 bytes.?

    We are trying to debug the example code i2c_sensors_to_uart.c found that code is stuck at line 206  

     delay_cycles(1200);

    Please guide on resolution.

    Regards

    Seema Joshi

  • Could you post the code you're working with now? In my copy, reaching that line implies that the transaction completed. (Perhaps the debugger is reporting the BKPT() that happens on an error?)

    The Murata appnote (DM-R23-034 v3) doesn't really describe the protocol, but it seems to show a "register model" target, where the transactions could be fairly short.

    That said, I expect Diego's function would work with any size (Tx) transaction, which could include both configuration and data-fetching.

  • Dear  Bruce,

    Thanks for the update.

    With follwoing code we tried to send two bytes every time 9 times.expected to send 18 bytes.

    We saw I2C0_MTXDATA register updates till 4th byte,as we placed the BKPY at      delay_cycles(4800) 

    Also we saw there is no trasition on SCL,SDA pins.

    Expect quick resolution.

    #include "ti_msp_dl_config.h"
    #include <stdio.h>
    #include <string.h>

    /* Number of bytes to write to target for configuration. */
    #define I2C_TX_PACKET_SIZE_CONFIGURATION_HDC (2)
    #define I2C_TX_PACKET_SIZE_CONFIGURATION_OPT (3)

    /* Number of bytes to write for measurement reading. */
    #define I2C_TX_PACKET_SIZE_READING (1)

    /*
     * Number of bytes to receive from target.
     * Two bytes of result from HDC2010 and OPT3001.
     */
    #define I2C_RX_PACKET_SIZE  (2)

    /* I2C Target address */
    #define I2C_TARGET_ADDRESS_HDC2010 (0x48)
    #define I2C_TARGET_ADDRESS_OPT3001 (0x44)
    DL_I2C_ClockConfig gI2CclockConfig; // Declare this as a global

    /* Measurement configuration code */
    uint8_t gTxPacketConfigurationHDC[I2C_TX_PACKET_SIZE_CONFIGURATION_HDC] = {0x00, 0xA0};// 0x01,0x09};//,0x0E, 0x60, 0x01,0x0A};
    uint8_t gTxPacketConfigurationHDC1[I2C_TX_PACKET_SIZE_CONFIGURATION_HDC] = {0x00, 0xF0};//, 0x01,0x0A};
    uint8_t gTxPacketConfigurationHDC2[I2C_TX_PACKET_SIZE_CONFIGURATION_HDC] = {0x00, 0x00};
    uint8_t gTxPacketConfigurationHDC3[I2C_TX_PACKET_SIZE_CONFIGURATION_HDC] = {0x00, 0x00};
    uint8_t gTxPacketConfigurationHDC4[I2C_TX_PACKET_SIZE_CONFIGURATION_HDC] = {0x00, 0x00};
    uint8_t gTxPacketConfigurationHDC5[I2C_TX_PACKET_SIZE_CONFIGURATION_HDC] = {0x00, 0x00};
    uint8_t gTxPacketConfigurationHDC6[I2C_TX_PACKET_SIZE_CONFIGURATION_HDC] = {0x00, 0x00};
    uint8_t gTxPacketConfigurationHDC7[I2C_TX_PACKET_SIZE_CONFIGURATION_HDC] = {0x0E, 0xA0};
    uint8_t gTxPacketConfigurationHDC8[I2C_TX_PACKET_SIZE_CONFIGURATION_HDC] = {0x00, 0xF0};

    uint8_t gTxPacketConfigurationOPT[I2C_TX_PACKET_SIZE_CONFIGURATION_OPT] = {0x01, 0xC4, 0x10};

    /* Data sent to the Target - measurement result registers*/
    uint8_t gTxPacketTemperatureMeasurement[I2C_TX_PACKET_SIZE_READING] = {0x00};
    uint8_t gTxPacketHumidityMeasurement[I2C_TX_PACKET_SIZE_READING] = {0x02};
    uint8_t gTxPacketLightMeasurement[I2C_TX_PACKET_SIZE_READING] = {0x00};

    /* Data received from Target */
    volatile uint8_t gRxPacket[I2C_RX_PACKET_SIZE];

    uint8_t gExponent;
    uint32_t gResult;
    uint16_t gHumidity;
    uint8_t gHumidityRH;
    uint16_t gLightLux;
    uint16_t gTemperature;
    float gTemperatureCelsius;
    uint8_t gTemperatureCelsiusInt;
    uint8_t gTemperatureCelsiusFraction;
    uint8_t gValue;
    char gBuffer[64];
    uint8_t gSecDelay = 10; // delay 30s default

    /* Functions */
    void configureTarget(const uint8_t *gBuffer, uint16_t count, uint8_t target_addr);
    void getMeasurementFromTarget(const uint8_t *gBuffer, uint8_t target_addr);
    float HDC2010_tempToFloatCelsius(uint16_t raw);
    uint32_t HDC2010_humToIntRelative(uint16_t x);
    void uartTransmit(const char *str);
    void setMeasurementConfigurationsForSensors();
    void takeMeasurements();
    void sendToUARTReceiver();



    int main(void)
    {  
        SYSCFG_DL_init();

        /* Set LED to indicate start of transfer */
        DL_GPIO_clearPins(GPIO_LEDS_PORT, GPIO_LEDS_USER_LED_1_PIN);

        setMeasurementConfigurationsForSensors();

        while (1)
        {
            takeMeasurements();
           
            /* Interpret values */
            gHumidityRH = HDC2010_humToIntRelative(gHumidity);  
            gTemperatureCelsius = HDC2010_tempToFloatCelsius(gTemperature);
            gLightLux = 0.01 * pow(2, gExponent) * gResult;
            delay_cycles(24000);

            sendToUARTReceiver();

            /* If write and read were successful, toggle LED every second till next measurement */
            for (uint8_t i = 0; i < gSecDelay; i++) {
                DL_GPIO_togglePins(GPIO_LEDS_PORT,
                GPIO_LEDS_USER_LED_1_PIN);
                delay_cycles(24000000);
            }
        }
    }


    /*
     *  ======== uartPrint ========
     *  Transmit string via UART.
     */
    void uartTransmit(const char *str)
    {
        while(*str)
        {
            DL_UART_transmitDataBlocking(UART_0_INST, *str++);  
        }
    }

    /*
     *  ======== HDC2010_humToIntRelative ========
     *  Convert raw humidity register value to the relative humidity rounded
     *  to the nearest whole number; a range of 0 to 100.
     */
    uint32_t HDC2010_humToIntRelative(uint16_t raw)
    {
        /* round relative humidity to nearest whole number */
        return ((25 * (uint32_t)raw + 0x2000) >> 14);
    }

    /*
     *  ======== HDC2010_tempToFloatCelsius ========
     *  Convert temperature to celsius.
     */
    float HDC2010_tempToFloatCelsius(uint16_t x)
    {
        return ((float)x * (165.0f / 65536.0f) - 40.0f);
    }

    /*
     *  ======== configureTarget ========
     *  Send configuration code to target.
     */
    void configureTarget(const uint8_t *gBuffer, uint16_t count, uint8_t target_addr)
    {  
        /* Fill FIFO with data to write configuration code */
        DL_I2C_fillControllerTXFIFO(I2C_0_INST, gBuffer, count);
               
        /* Wait for I2C to be Idle */
        while (!(
            DL_I2C_getControllerStatus(I2C_0_INST) & DL_I2C_CONTROLLER_STATUS_IDLE));

        /* Send the packet to the Target to configure.
        * This function will send Start + Stop automatically.
        */
        DL_I2C_startControllerTransfer(I2C_0_INST, target_addr,
            DL_I2C_CONTROLLER_DIRECTION_TX, count);
    }

    void getMeasurementFromTarget(const uint8_t *gBuffer, uint8_t target_addr)
    {  
        /* Fill FIFO with data to read measurement */
        DL_I2C_fillControllerTXFIFO(I2C_0_INST, gBuffer,
            I2C_TX_PACKET_SIZE_READING);

        /* Wait for I2C to be Idle */
        while (!(
            DL_I2C_getControllerStatus(I2C_0_INST) & DL_I2C_CONTROLLER_STATUS_IDLE))
            ;
       
        /* Send the packet to the Target.
        * This function will send Start + Stop automatically.
        */
        DL_I2C_startControllerTransfer(I2C_0_INST, target_addr,
            DL_I2C_CONTROLLER_DIRECTION_TX, I2C_TX_PACKET_SIZE_READING);

        /* Poll until the Controller writes all bytes */
        while (DL_I2C_getControllerStatus(I2C_0_INST) &
            DL_I2C_CONTROLLER_STATUS_BUSY_BUS)
            ;

        /* Trap if there was an error */
        if (DL_I2C_getControllerStatus(I2C_0_INST) &
            DL_I2C_CONTROLLER_STATUS_ERROR) {
            /* LED will remain high if there is an error */
            DL_GPIO_clearPins(GPIO_LEDS_PORT, GPIO_LEDS_USER_LED_1_PIN);
            __BKPT(0);
        }

        /* Add delay between transfers */
        delay_cycles(1200);

        /* Wait for I2C to be Idle */
        while (!(
            DL_I2C_getControllerStatus(I2C_0_INST) & DL_I2C_CONTROLLER_STATUS_IDLE))
            ;

        /* Send a read request to Target */
        DL_I2C_startControllerTransfer(I2C_0_INST, target_addr,
            DL_I2C_CONTROLLER_DIRECTION_RX, I2C_RX_PACKET_SIZE);

        /*
        * Receive all bytes from target. LED will remain high if not all bytes
        * are received
        */
        DL_GPIO_clearPins(GPIO_LEDS_PORT, GPIO_LEDS_USER_LED_1_PIN);
        for (uint8_t i = 0; i < I2C_RX_PACKET_SIZE; i++) {
            while (DL_I2C_isControllerRXFIFOEmpty(I2C_0_INST))
                ;
            gRxPacket[i] = DL_I2C_receiveControllerData(I2C_0_INST);
           
        }
    }

    void setMeasurementConfigurationsForSensors()
    {  
        /* Measurement configuration for HDC2010 */
        configureTarget(&gTxPacketConfigurationHDC[0],
        I2C_TX_PACKET_SIZE_CONFIGURATION_HDC, I2C_TARGET_ADDRESS_HDC2010);

        configureTarget(&gTxPacketConfigurationHDC1[0],
        I2C_TX_PACKET_SIZE_CONFIGURATION_HDC, I2C_TARGET_ADDRESS_HDC2010);

        configureTarget(&gTxPacketConfigurationHDC2[0],
        I2C_TX_PACKET_SIZE_CONFIGURATION_HDC, I2C_TARGET_ADDRESS_HDC2010);
        configureTarget(&gTxPacketConfigurationHDC3[0],
        I2C_TX_PACKET_SIZE_CONFIGURATION_HDC, I2C_TARGET_ADDRESS_HDC2010);
        configureTarget(&gTxPacketConfigurationHDC4[0],
        I2C_TX_PACKET_SIZE_CONFIGURATION_HDC, I2C_TARGET_ADDRESS_HDC2010);

    configureTarget(&gTxPacketConfigurationHDC5[0],
        I2C_TX_PACKET_SIZE_CONFIGURATION_HDC, I2C_TARGET_ADDRESS_HDC2010);

        configureTarget(&gTxPacketConfigurationHDC6[0],
        I2C_TX_PACKET_SIZE_CONFIGURATION_HDC, I2C_TARGET_ADDRESS_HDC2010);

    configureTarget(&gTxPacketConfigurationHDC7[0],
        I2C_TX_PACKET_SIZE_CONFIGURATION_HDC, I2C_TARGET_ADDRESS_HDC2010);


    configureTarget(&gTxPacketConfigurationHDC8[0],
        I2C_TX_PACKET_SIZE_CONFIGURATION_HDC, I2C_TARGET_ADDRESS_HDC2010);




     
        delay_cycles(4800);
       
       

        /* Measurement configuration for OPT3001 */
        configureTarget(&gTxPacketConfigurationOPT[0],
        I2C_TX_PACKET_SIZE_CONFIGURATION_OPT, I2C_TARGET_ADDRESS_OPT3001);

        delay_cycles(4800);
    }

    void takeMeasurements()
    {  
        /* TEMPERATURE MEASUREMENT */
        getMeasurementFromTarget(&gTxPacketTemperatureMeasurement[0], I2C_TARGET_ADDRESS_HDC2010);
        gTemperature = (gRxPacket[1] << 8) | gRxPacket[0];
        delay_cycles(100);
       
        /* HUMIDITY MEASUREMENT */
        getMeasurementFromTarget(&gTxPacketHumidityMeasurement[0], I2C_TARGET_ADDRESS_HDC2010);
        gHumidity = (gRxPacket[1] << 8) | gRxPacket[0];
        delay_cycles(100);

        // /* AMBIENT LIGHT MEASUREMENT */
        getMeasurementFromTarget(&gTxPacketLightMeasurement[0], I2C_TARGET_ADDRESS_OPT3001);
        gExponent = (gRxPacket[0] >> 4) & 0x0F;
        gValue = gRxPacket[0] & 0x0F;
        gResult  = (gValue << 8) | gRxPacket[1];
        delay_cycles(100);
    }

    void sendToUARTReceiver()
    {  
        gTemperatureCelsiusInt = (int)gTemperatureCelsius;
        gTemperatureCelsiusFraction = (int)((gTemperatureCelsius - gTemperatureCelsiusInt) * 10);
        snprintf(gBuffer, sizeof(gBuffer),
            "Temperature: %d.%d C   |   ", gTemperatureCelsiusInt, gTemperatureCelsiusFraction);
        uartTransmit(gBuffer);
        snprintf(gBuffer, sizeof(gBuffer), "Humidity: %d RH   |   ", gHumidityRH);
        uartTransmit(gBuffer);
        snprintf(gBuffer, sizeof(gBuffer),"Ambient light: %d lux\r\n", gLightLux);
        uartTransmit(gBuffer);
    }

    void sendI2CTxMsg(uint8_t *I2CTransmitGroup, uint32_t address, uint8_t size){

        /* Get I2C clock source and clock divider to use for delay cycle calculation */
        DL_I2C_getClockConfig(I2C_0_INST, &gI2CclockConfig);
        /*Calculate number of clock cycles to delay after controller transfer initiated
         * gDelayCycles = 3 I2C functional clock cycles
         * gDelayCycles = 3 * I2C clock divider * (CPU clock freq / I2C clock freq)
         */
        uint32_t delayCycles = (3 * (gI2CclockConfig.divideRatio + 1)) * (CPUCLK_FREQ / 24000000);

        uint8_t txCount = DL_I2C_fillControllerTXFIFO(I2C_0_INST, &I2CTransmitGroup[0], size);                        /* Fills TX FIFO with I2C Buffer data*/
        while (!(DL_I2C_getControllerStatus(I2C_0_INST) & DL_I2C_CONTROLLER_STATUS_IDLE));                            /* Wait for I2C to finish filling the FIFOs */
        DL_I2C_startControllerTransfer(I2C_0_INST, address, DL_I2C_CONTROLLER_DIRECTION_TX, size);                    /* Send the packet to the controller. This function will send Start + Stop automatically. */
        while(txCount < size){                                                                                      /* Repeats filling the Fifo is the message is not yet finished*/
            txCount += DL_I2C_fillControllerTXFIFO(I2C_0_INST, &I2CTransmitGroup[txCount], size - txCount);
            delay_cycles(delayCycles);    /* I hate that we cannot write without delays */
        }
        while (DL_I2C_getControllerStatus(I2C_0_INST) &DL_I2C_CONTROLLER_STATUS_BUSY_BUS);                            /* Wait for I2C to finish sending data */
        DL_I2C_flushControllerTXFIFO(I2C_0_INST);                                                                     /* Flushes I2C TX FIFO */
    }


  • getMeasurementFromTarget(&gTxPacketLightMeasurement[0], I2C_TARGET_ADDRESS_OPT3001);

    Do you also have an OPT3001 on board? If not, this will encounter a NACK, which will cause the program to stop at the BKPT() just before the delay_cycles call you mentioned.

    I recommend you remove this line, as well as 

    > configureTarget(&gTxPacketConfigurationOPT[0],
    >     I2C_TX_PACKET_SIZE_CONFIGURATION_OPT, I2C_TARGET_ADDRESS_OPT3001);
    -----
    The original example uses PA0/PA11 for SDA/SCL respectively. Have you changed that?
    -----
    [Edit: I wasn't sure what to think about "We saw I2C0_MTXDATA register updates till 4th byte", since I don't see any Tx transactions longer than 3 bytes. My guess is that the erroneous configureTarget call is leaving data in the Tx FIFO, which symptom will vanish once you remove that call.]
     
  • I ran this code on my Launchpad. [I don't expect it to work properly, since I have neither your sensor nor an OPT3001.]

    I see activity on both PA0 and PA11. I wonder if your pin assignments have been inadvertently changed.

  • Dear Bruce,

    Please send the project file .There may be some settings related to the I2C Driver level are missing in our project.

    We have checked and confirmed PA0,PA1/PA11 with sensor without sensor connection.(SCL  is 2.2V & SDA  is 0V)

    Regards

    Seema Joshi

  • I don't have the project with me right now. 

    I created it by importing the base Example, then pasting the code (above) over the (entire) .c file. I didn't touch anything else.

    Do you know why SCL is at 2.2v rather than 3.3v? Maybe there's a clue there.

  • Here's the project I used. I constructed it as described above.

    x-i2c_sensors_to_uart_LP_MSPM0C1104.zip

  • Dear Bruce,

    In the launch pad there is 20 pin  MCU we did not saw any trasition on SDA.

    We have 8 pin MCU there we saw SDA pin trasitions  but SCL pin remains low .

    but in WATCH window we saw SCL pin status High.

    We saw I2C Configuation window ,we can set the TX FIFO trigger level is settable upto 7 bytes.Please confirm TX buffer we shall send that many bytes ?

    Regards

    Seema Joshi

  • The project above (from the base example) uses PA0/PA11, matching the Launchpad. These pins have pullup jumpers (2.2k); I think you mentioned these, but just to make sure: Are these jumpers installed in your test case?

    -----

    In the 8-pin [per SLASF90C Table 6-1] I2C0 is on PA0/PA1. Notably, PA1 is shared with NRST. Do you have a reset circuit on your board? The Hardware Guide (SLAAEG4B) doesn't seem to mention this conflict, but in the Forum discussion over (here) it's suggested to deal with this case by leaving out the NRST circuitry and letting the I2C pullup do the NRST work.

    [I'm still stuck on "Why is SCL=2.2V?"]

    -----

    I don't know why there's a discrepancy with the TRM regarding the TX FIFO size. I discovered this by using the debugger to write to TXDATA and watching TXFIFOCNT decrement. I also found (by accident) I2C_SYS_FENTRIES(=4) in mspm0c110x.h [though that's not where I would normally look]. There's also a comment (not elaborated) in the example i2c_controller_rw_multibyte_poll which says "This example uses FIFO with polling, and the maximum FIFO size is 4." so evidently someone knew about it.

    That said: the TX FIFO trigger level (per se) isn't really relevant to this example, since it uses polling. DL_I2C_fillControllerTXFIFO() works by writing bytes until TXFIFOCNT=0, so it doesn't care (explicitly) how big the FIFO is.

  • NO ,We have tried connecting  2.2K 4.7K ,5.6K up to 10K

     by diconneting jumpers on board.

    Hardware

    You are right there is pull up for reset 4.7K ,we tried connecting 4.7K ,2.2K.2k in parallel.

    I don't know why there's a discrepancy with the TRM regarding the TX FIFO size. I discovered this by using the debugger to write to TXDATA and watching TXFIFOCNT decrement. I also found (by accident) I2C_SYS_FENTRIES(=4) in mspm0c110x.h [though that's not where I would normally look]. There's also a comment (not elaborated) in the example i2c_controller_rw_multibyte_poll which says "This example uses FIFO with polling, and the maximum FIFO size is 4." so evidently someone knew about it

    We are trying sending 2 bytes each time with code I2C sensor to UART ,checked bytes trasmitted in watch window ,but on the pins transition not captured.

    That said: the TX FIFO trigger level (per se) isn't really relevant to this example, since it uses polling. DL_I2C_fillControllerTXFIFO() works by writing bytes until TXFIFOCNT=0, so it doesn't care (explicitly) how big the FIFO is.

    We saw FIFO register sends 4 bytes only maximum in polling mode.

    Now latest update we observed that we captured 9 clocks & data with 4.7K pullup,we tried redusing <1K  SCL SDA line drops to 0V.

    If you ask me ,We need to be sure about hardware atleast i.e. pull up  ,to try software or vice versa.

    We are trying hardware software changes abruptly  ,can not be able to conclude.

  • Hi Seema,
    If the I2C lines are not working, it seems to me this is a problem with the sensor. I believe that the pull-up of 4.7k should be good enough. I would try a standalone example from the I2C examples and see if there is any way to send data to the sensor. If it is possible, then the next steps will be to do more commands until reaching the command that doesn't work.

    Best Regards,

    Diego Abad

  • If the I2C lines are not working, it seems to me this is a problem with the sensor.

    Dear DIEgo,

    With 4.7K  pullup at SCL SDA we found  trasition attached .We are not able to trace the follwoing function.

    DL_I2C_startControllerTransfer

    We need to disable write device address as sensor datasheet says to write 00x address and data.

    Here  I2C0_MTXDATA  shows 4th byte send.

    But on the scope we can capture only 90h as device address send.

  • The scope trace appears to show a NACK for address 0x48 (W). How is pin 5 (AD) connected?

  • OK. Pin5  for MCU is connected pull up 4.7K   & connected to sensor.

    Actually sensor datasheet says to write command & data  instead of the address as first byte.

    Can you please send the modified DL_I2C_startControllerTransfer without device address  send as first byte.

  • If the sensor-side AD pin is connected to Vcc, the address is 0x49, not 0x48.

    There's no mechanism to perform an I2C transaction without sending the target device address, since that's how I2C works.

    I've only found the spec sheet (Web page) and appnote DM-R23-034 (v3), neither of which describes the protocol. DM-R23-034 describes the registers, implying it is a standard "register model" target (send register number byte followed by contents), but says nothing about commands. Do you have some other document(s)?

  • Dear Bruce,

    As discussed "The scope trace appears to show a NACK " we have varified AD pin is connected to GND @device address 48 .flowchart for sensor device in

    DM-R23-034 (v3) page 11  shows to start communication with 00,00.ButTI I2C driver  DL_I2C_startController sends device address ?&  tend data.

    I am not sure that is why sensor is replying NACK.

    Please let us know how to start driver without the device address.

    Regards

    Seema Joshi