LPI2C configuration for s32k324

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

LPI2C configuration for s32k324

2,095 次查看
semiconductor_user
Contributor III

hello nxp community

i'm trying to do i2C communiction with sensor but when i am calling Lpi2c_Ip_MasterSendDataBlocking() API my code is stucking so i have doubt in my configuration which i shared below  as well as code with detaile of hardware. 

MCU = s32k324

RTD version = 3.0.0

I2C Clock freq = 40MHZ

i2c instance 0 = PTD13/PTD14

Slave address = 0x1E

 

 

0 项奖励
回复
1 回复

2,065 次查看
VaneB
NXP TechSupport
NXP TechSupport

Hi @semiconductor_user 

The configuration seems correct, I just have few observations, first you have configured the I2C Asynchronous Method as LPI2C_USING_INTERRUPTS but you have not enabled LPI2C0_IRQn and and therefore there is no handler (LPI2C0_Master_Slave_IRQHandler) assignment in the Interrupt Controler (IntCtrl_Ip).

Also, about Lpi2c_Ip_MasterSendDataBlocking() function when you asiggne "&reg" as the value of uint8 * TxBuff you are assigning the address of the data instead of the data, so use just "reg" instead of "&reg".

 

BR, VaneB

0 项奖励
回复