LPC2388 I2C communication issue

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

LPC2388 I2C communication issue

670 次查看
Brettjohnson71
Contributor I

Hello All I am trying to send some data out over I2C and am running into an issue. 

Right now I am trying to get a Model_ID from a VL53l1x sensor this part has a base address of 52, and the index for model ID is 0X010F. Currently when scoping the SLA SDA lines my I2C write is in the form Address 29 write bit set (so this is correct) however my data packet is in the form D2 01 0F and I have no idea where the D2 is coming from or how to remove it. Here is the code I am using to set the I2CMasterBuffer and the rest is taken care of in LPC23x8I2C

 
  if((ReserveI2C()) == OK)  /* First we need access to the i2c bus.   */
{   
I2CWriteLength = 3;   // 3 bytes.
I2CMasterBuffer[0] = VL53l1_I2C_Write_ADDRESS;  /* 0x52 */ 
I2CMasterBuffer[1] = Version_address; //0x01
I2CMasterBuffer[2] = ID_address; //0x0F
I2CMasterBuffer[3] = VL53l1_I2C_Read_ADDRESS; //0x53
I2CReadLength = 2; /* The size of the part so the address pointer always returns where it started. */
    stat = I2CEngine(3); ;  
    os_dly_wait(7);     /* WriteCycle >= TIME_5mS */
    ReleaseI2C();
I2CMasterBuffer[4]=data;
return data;
0 项奖励
回复
1 回复

643 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

Because the data packet is from VL53l1x sensor, pls check the data sheet of VL53l1x sensor.

Hope it can help you

BR

XiangJun Rong

0 项奖励
回复