S32k314 I2C

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32k314 I2C

Jump to solution
1,869 Views
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 Kudos
1 Solution
1,824 Views
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

View solution in original post

0 Kudos
2 Replies
1,825 Views
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 Kudos
1,848 Views
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