LPI2C

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

LPI2C

723 Views
LzdOo
Contributor III

I want to use the LPI2C module of S32K144 as the Master to communicate with the Slave and achieve register reading and writing. As shown in the configuration and interface diagram, it seems that they are not effective. Could you please tell me which step is missing? (The Slave address is correct.)

LzdOo_0-1752043406192.png

LzdOo_1-1752043429981.png

LzdOo_2-1752043450249.png

 

 

 

Tags (1)
0 Kudos
Reply
3 Replies

704 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

the setting looks normal and code is almost right. If using non-blocking function you should check for transfer finish, before other Send/Receive is called. Non-blocking operations will initiate the transfer and return STATUS_SUCCESS, but the module is still busy with the transfer and another transfer can't be initiated until the current transfer is complete. The application can check the status of the current transfer by calling LPI2C_DRV_MasterGetTransferStatus().
Or use blocking function instead.

BR, Petr

0 Kudos
Reply

693 Views
LzdOo
Contributor III

Hi, Petr

The code has been modified as follows, but the SDA and SCL waveforms are incorrect. Please help me figure out what the reason is.

LzdOo_0-1752113059672.png

LzdOo_1-1752113169873.png

LzdOo_2-1752113292012.png

 

0 Kudos
Reply

681 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

but you did not implement what was written. Modify code additionally to either put  Transfer status testing after MasterSendData function or use MasterSendDataBlocking there.

BR, Petr

0 Kudos
Reply