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.

CC2640: CC2640 I2C timing

Part Number: CC2640

Hi Team,

Customer uses I2C dirver to read AT24C64. When I2C bitRate is I2C_400kHz, bit transmit interval is 60 us. Please check below capture and explain this,

  • Thans,My I2C driver is base SensorI2C.c  and I use the SDK  : \simplelink_cc2640r2_sdk_1_50_00_58\examples\rtos\CC2640R2_LAUNCHXL\blestack\simple_peripheral

    while I creat a task to read the at24c64

    bool At24C64_ByteRead(uint16_t nAddr,uint8_t *pData)
    {
        bool ret;
        uint8_t nTmp[2] = {0} ;

        if (!SENSOR_SELECT())
        {
            return false;
        }

        nTmp[0] = LO_UINT16(nAddr);
        nTmp[1] = HI_UINT16(nAddr);

        ret = SensorI2C_writeRead(nTmp,2,pData,1);

        SENSOR_DESELECT();

        return ret;
    }

  • Hi Derrick,

    Yes, you are correct.  I don't know customer why think transmit interval is 60 us.

  • Hi Derrick

    1.the latency between bytes is delta 61us on the right of the view ,the 25us is just the time scale..

    2,the second mage is show whenever one byte transimt over,the signal SCL keep Low until next byte not the time

    thans

  • Hi Alvin

    1.the latency between bytes is delta 61us on the right of the view ,the 25us is just the time scale..

    2,the second mage is show whenever one byte transimt over,the signal SCL keep Low until next byte not the time

    thans

  • Hello,

    Thanks for the clarification--I misinterpreted the Oscilloscope capture. I will delete my original response as it contain mis-information.

    Which version of the SimpleLink SDK are you using?

    1. The 61 uS latency is likely due to the I2C driver operating on an "interrupt per byte" basis.
    2. I am not sure what may be causing the SCL line to be held low
      1. It could be possible that the I2C Slave device (AT24C64) is holding the clock low until it is ready to transmit/receive the next byte.

    Derrick

  • Thans Derrick,

     I am using   the SDK  : \simplelink_cc2640r2_sdk_1_50_00_58\examples\rtos\CC2640R2_LAUNCHXL\blestack\simple_peripheral

    1.if it's all I2C drive  operating on an "interrupt per byte" basis?How i can judge or make it  transmit sequent

  • Hi,

    The CC2640R2's I2C hardware does not have support for a FIFO or DMA. Therefore, the transmits must occur on a interrupt per byte basis.

    If you're using the I2C software in I2C_MODE_BLOCKING, you can try wrapping your I2C_transfer() calls with the following APIs.

    #include </ti/drivers/power/PowerCC26XX.h>
    #include <ti/drivers/Power.h>
    
    Power_setConstraint(PowerCC26XX_IDLE_PD_DISALLOW);
    I2C_transfer(handle);
    Power_releaseConstraint(PowerCC26XX_IDLE_PD_DISALLOW);

    Derrick

  • Thanks Derrick ,its Look OK NOW

  • Hello,

    A short explanation of my previous response.

    The Power driver aggressively attempts to put the device in the lowest power state possible. This is made possible by each software driver (such as I2C) informing the Power driver the lowest tolerable power state.

    In the case of the I2C driver, it's able to operate even if the device goes into IDLE mode. When the device goes into idle, it takes just a littler longer to wake up and service interrupts. By wrapping the I2C_transfer() calls, the device no longer goes to IDLE and can service each byte interrupt more promptly.

    Derrick