S32K LPI2C slave communication problem

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

S32K LPI2C slave communication problem

1,578 次查看
kawadaxi
Contributor II

    Hi, I currently have two S32K144 boards and are conducting I2C communication experiments. One is the Master and the other is the Slave.
    The Master reads data from the Slave every 50ms, one byte each time, and Slave returns incremental data from 0 to 255.
    Now the problem is that after normal reading for a period of time, the communication will be abnormal. Master will always return STATUS_BUSY after returning STATUS_TIMEOUT once.Please help tell me what is probably causing this, my code is derived from the S32DS example. 

    Thanks .

    

1. The Master code

kawadaxi_0-1699264922742.png

2.The Slave code

kawadaxi_1-1699265031404.png

 

 

 

 

 

 

0 项奖励
回复
3 回复数

1,542 次查看
kawadaxi
Contributor II

Hi,

This problem does seem to be related to jumper wires. After I changed to a new twisted pair wire, the situation became stable. Of course, further observation may be required.

1,549 次查看
kawadaxi
Contributor II

Hi, thank you for your reply.

Yes, I observed that Slave pulls SDA down. And this problem seems to be irregular. Sometimes it appears easily, and sometimes it takes a long time to reappear.
Is this problem possibly related to interrupt priority? I now use SysTick, LpTMR, CAN, and ADC interrupts at the same time. In addition, may it be related to my jumper wire, because I used two wires to connect the I2C of the two boards,i am not sure whether this will cause unstable communication.

 

0 项奖励
回复

1,563 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @kawadaxi,

Can you scope the bus?

Is the Slave device holding the bus low?

 

Thanks,

0 项奖励
回复