S32k314 I2C

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

S32k314 I2C

跳至解决方案
6,342 次查看
anoop_r
Contributor II

Hi,

We are using a platform that has an S32K314 controller and we are trying to bring up the I2C, for that, we have used the example "I2c_IP_LPI2C_Transfer_S32K312" as a reference and ported the codes to our platform. 

I have connected an I2C gyro to the S32k314 I2C channel 0.

I have configured the slave address in the mex file and I tried using the API "Lpi2c_Ip_MasterSendData" to write into a register.

In the "Lpi2c_Ip_MasterSendData" API I have filled the txbuffer zeroth location with the reg address and the first location with the data to be written into the register.

I have analyzed the bus transition through an I2C analyzer and there is no data being sent through the bus and I am getting a NACK response.

Is there anything wrong with the way I am using the I2C write API?

Regards

Anoop

 

0 项奖励
回复
1 解答
6,292 次查看
anoop_r
Contributor II

Hi PetrS,

Sorry for the delay in response,

I have tested the I2C with a different Gryo slave and it is now working.

For reading the I2c I have written the register in blocking mode and tried to read it in nonblocking mode.

Sharing the snapshots of the data written and read from the register, PFA.

Regards

Anoop

在原帖中查看解决方案

0 项奖励
回复
2 回复数
6,293 次查看
anoop_r
Contributor II

Hi PetrS,

Sorry for the delay in response,

I have tested the I2C with a different Gryo slave and it is now working.

For reading the I2c I have written the register in blocking mode and tried to read it in nonblocking mode.

Sharing the snapshots of the data written and read from the register, PFA.

Regards

Anoop

0 项奖励
回复
6,314 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

the Lpi2c_Ip_MasterSendData usage looks correct. Can you share analyzer screenshot?
It looks master is sending slave address but it is not ACKed, is that what you see?
Do you have pull-up resistors on both I2C lines?

BR, Petr