S32K LPI2C slave communication problem

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

S32K LPI2C slave communication problem

1,522件の閲覧回数
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,486件の閲覧回数
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,493件の閲覧回数
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,507件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @kawadaxi,

Can you scope the bus?

Is the Slave device holding the bus low?

 

Thanks,

0 件の賞賛
返信