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?
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
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?
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.