AnsweredAssumed Answered

I2C : NO clock signal

Question asked by Sendhilkumar Harikrishnan on Dec 3, 2019
Latest reply on Dec 11, 2019 by Sendhilkumar Harikrishnan

Hi,

Iam working on I2c communication with LP5024 LED.

K22 will be the master and need to communicate with LP5024 slave.

 I2C SDK driver : downloaded from https://mcuxpresso.nxp.com/en/builder#

 

 

Iam able to Initialize I2C via I2C_MasterInit API and   I2C_MasterStart, I2C_MasterTransferBlocking calls were successful

Issue is that iam not seeing clock signal in oscilloscope. Am i missing anything? Below is the code i used for I2C master. Kindly go through and advise me how to proceed with this issue.

 

 Please suggest.

 

                status_t result = kStatus_Success;
                I2C_MemMapPtr base = I2C0_BASE_PTR;
                i2c_master_config_t masterConfig = {0};
                I2C_MasterGetDefaultConfig(&masterConfig);
                uint8 status;

                I2C_MasterInit(base, &masterConfig, 100000U);

                /* Clear all status before transfer. */
                I2C_MasterClearStatusFlags(base, (uint32_t)(kClearFlags));
                /* Clear pending flag. */
                base->S = (uint8_t)kI2C_IntPendingFlag;


                result = I2C_MasterStart(base, 0x00, kI2C_Write);

 

                if (0 != result)
                {
                                result = kStatus_Fail;
                }

                /* Wait address sent out. */
                if(!((status = I2C_MasterGetStatusFlags(base)) & kI2C_IntPendingFlag))
                {
                }

                if(status & kI2C_ReceiveNakFlag)
                {                
                }

                /* Enable module interrupt. */
                I2C_EnableInterrupts(base, kI2C_GlobalInterruptEnable);


                result = kStatus_Success;
                result = I2C_MasterWriteBlocking(base, txBuff, BUFFER_SIZE, kI2C_TransferNoStopFlag);
                if (result)
                {
                                I2C_MasterStop(base);
                }

 

Regards,

SK

Outcomes