about i2c

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

about i2c

1,037件の閲覧回数
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 返答(返信)

1,027件の閲覧回数
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 件の賞賛
返信

1,023件の閲覧回数
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 件の賞賛
返信

1,005件の閲覧回数
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 件の賞賛
返信