RT1050 LPI2C问题

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

RT1050 LPI2C问题

3,286 Views
haifeng_jin
Contributor III

hi  在使用LPI2C的时候遇到一个问题,我下面的器件读一次是258个字节,但是目前LPI2C最大一次只能256字节,按照普通的I2C来说不应该有这种设置,比较奇怪目前的LPI2C,LPI2C_MasterReceive(EXAMPLE_I2C_MASTER, g_master_rxBuff, LPI2C_DATA_LENGTH);

RM手册上如下描述,上面说repeat的话可以从新读一次,但是下面的器件不能支持在发起一次start信号,这个LPI2C感觉挺奇怪。有什么办法解决吗?

MTDR寄存器:

pastedImage_1.png

Labels (1)
0 Kudos
9 Replies

3,046 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi haifeng jin ,

    楼主你好。

   你的意思是,你的从机超过256的部分,是需要重新发START还是不需要?

   如果需要,可以直接用CMD 100b,如果不需要,可以用000b。

   这个是可以灵活控制的。

   如果你还有问题,欢迎继续交流!


Have a great day,
Kerry

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

3,046 Views
haifeng_jin
Contributor III

hi 从机需要一次性读完258个字节,000b的话一次不是255个字节?

pastedImage_1.png

0 Kudos

3,046 Views
kerryzhou
NXP TechSupport
NXP TechSupport

hi haifeng,

   你RT1050是主机还是从机,从你描述像是主机,你从机是什么?

  从机一次读258个字节, 可以分两批读,第一批255,第二批剩下3字节,只要保证不发START,只发时钟和数据,从机就可以接着读下去。

  如果还有问题,欢迎继续交流。


Have a great day,
Kerry

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

3,046 Views
haifeng_jin
Contributor III

RT1050是主机,这样的话就是不发start,然后连续读两次,现在测试下来有问题,当I2C时钟高的时候,会漏掉后面的三个数据,我觉得LPI2C模块功能做的有点不合情理

0 Kudos

3,046 Views
kerryzhou
NXP TechSupport
NXP TechSupport

楼主你好!

你有没有用逻辑分析仪测试下I2C总线的波形? 可以把你的i2c波形发出来我看看,尤其是问题的部分。

以及你测试的详细结果,这样便于我分析。

Have a great day,
Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

3,046 Views
haifeng_jin
Contributor III

hi Kerry:

        抓了数据,但是比较难找到,数据太多了,因为那个255字节后需要C语言执行以下在次读取的,但是这个时候clk正在发生,所以会导致执行C语言的时候,数据已经过了,所以最后几个字节就出错了,这个好像LPI2C没法解决的

0 Kudos

3,046 Views
kerryzhou
NXP TechSupport
NXP TechSupport

楼主你好!

是这样的,你那边有逻辑分析仪吗?通道深度调搞点,一般抓上千个byte都没有问题的,你可以debug下,然后只发258个字节出来,发之前进入trigger模式,这样一发送,就会抓取总线上所有的通信数据,而且你知道是最后几个字节,就能直接定位过去了。

抓到之后,把I2C波形分享给我,我仔细查看下。


Have a great day,
Kerry

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

3,046 Views
haifeng_jin
Contributor III

没搞定,感觉还是有风险,有IO模拟了IIC

0 Kudos

3,046 Views
kerryzhou
NXP TechSupport
NXP TechSupport

感谢你的信息更新。

没搞定,是遇到什么具体问题了呢?

现在问题比较多,所以没有太多时间测试,后面我有时间的时候,也会去测测你这个问题。


Have a great day,
Kerry

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos