S32K344 I2C send address fail--25/9/2

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

S32K344 I2C send address fail--25/9/2

172 Views
haolin
Contributor I

Now I am using the S32K3 small EVB-T172 board and I2C as the host. I want to send an address signal of 50, but through the logic analyzer, I see that the signal sent is 0. Could anyone please help me analyze the approximate problem?

0 Kudos
Reply
5 Replies

124 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @haolin 

To send commands and data via the MTDR register, the typical format is:

LPI2Cn->MTDR = (CMD << 8) | DATA;

Based on the information you provided, you intend to transmit a START condition with an address. In this case, CMD = 0x4 and DATA = 0x20. However, it is important to note that DATA is a 7-bit address with a Read/Write (R/W) bit as the least significant bit (LSB). The format should be:

LPI2Cn->MTDR = (CMD << 8) | ((address << 1) | 0); // For write operation
LPI2Cn->MTDR = (CMD << 8) | ((address << 1) | 1); // For read operation

Please ensure that the address is correctly shifted and the R/W bit is properly set depending on the intended operation.

 

BR, VaneB

0 Kudos
Reply

107 Views
haolin
Contributor I

Hi @VaneB, Thank you for your reply. I can now receive the address from the machine. I am currently using two hardware I2C for communication, I2C0 as the host for sending and I2C1 as the slave for receiving. Now I2C1 can receive the address signal sent by I2C0, but I2C1 cannot receive the data sent after I2C0. I think the logic analyzer can capture the signal emitted by I2C0. Is there any configuration that needs to be noted here?

Tags (1)
0 Kudos
Reply

106 Views
haolin
Contributor I

I can see the I2C1 send ack signal, but the SSR->RDF bit is still not set, I don't know why?

Tags (1)
0 Kudos
Reply

84 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @haolin 

Could you please share how you are configuring your slave device? Also, are you using RTDs? If so, I recommend reviewing the example codes provided with the RTD package to ensure there are no missing configurations. 

0 Kudos
Reply

169 Views
haolin
Contributor I

I write to the MTDR reg , cmd is 0x4, and data is 0x20, but I also caught the signal address is 0. So I don't know why. 

Tags (1)
0 Kudos
Reply