about i2c

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

about i2c

1,034 Views
kalajiao
Contributor II

I tried to run the I2C component routines provided by the government. I burned the lPI2C_MASTER_S32k144 official routines on one board, downloaded the LPI2C_slave_S32k144 official routines on another board, and connected PTA3 and PTA2 on two boards.

Shouldn't the routine be for the master to send data to the slave? Why do I look at the data in the Rxbuff on the board where I burned the slave routine and see that the data in the rxbuff is still initialized with 0?

0 Kudos
Reply
3 Replies

1,024 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @kalajiao,

Have you scoped the bus?

Can you share the measurement?

Does the Slave device acknowledge the transfer?

If not, what is the address of the Slave?

What address does the Master send?

 

Thanks,

BR, Daniel

0 Kudos
Reply

1,020 Views
kalajiao
Contributor II

I use the official routine ah, I see the master send address is 0x1, slave address is also 0x1, this is configured in the routine. And then my connection is shown here

QQ截图20210819165942.pngQQ截图20210819170246.png

0 Kudos
Reply

1,002 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @kalajiao,

In the master example, the LPI2C sends only one 256byte-long transfer and then it reads 256 bytes from the slave.

The master should start the transfer only once the slave is initialized.

You could add another connection, one GPIO at both sides to inform the master that the slave is ready and only then start the transfers in the master example.

 

Regards,

Daniel

 

0 Kudos
Reply