about i2c

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

about i2c

790 次查看
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 项奖励
回复
3 回复数

780 次查看
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 项奖励
回复

776 次查看
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 项奖励
回复

758 次查看
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 项奖励
回复