Cypress技术论坛
直播中

王玮

8年用户 274经验值
私信 关注
[问答]

EZ I2C无法正常工作

你好,
我尝试用EZ I2C从组件上的cy8c3666在我的项目模拟I2C EEPROM。然而,它不起作用。
我看到的症状,做一个起始位,然后8钟,但第九钟的AK点缺失。也许是因为时钟拉伸而保持低调?我不知道,很难说清楚。
所以我尝试如下:
*我的CY8C3666项目板上的EZ I2C示例项目。这很好。
*我的CY8C5666 DEV板上的EZ I2C示例项目。这很好。
*将I2C主机布线到DEV板中。这很好。
所以我确信所有的组件都是独立工作的。我唯一可以认为是错的是建立我的项目;对ezi2c组件或代码的配置。我检查了我的代码和示例项目,看起来好。此外,我在所有情况下都使用I2C0引脚3和4。
唯一的区别,我可以看到我的项目和工程实例之间是ezi2c配置窗口。在示例项目,灰色的针的连接选项,尽管一切看起来都一样。我做的任何事情似乎都不可能是灰色的。
有什么我可以错过的吗?
雨果
EZY-I2C.PNG
18.5 K

以上来自于百度翻译


     以下为原文
   Hi,
    I am trying to use the EZ I2C Slave component on a CY8C3666 to emulate an I2C EEPROM in my project. However, it is not working.
     
    The symptoms I see is that the master does a Start bit, then 8 clocks, but the 9th clock for the AK bit is missing. Perhaps it's being held low for clock stretching? I don't know, it's hard to tell.
     
    So I tried the following:
    * The EZ I2C example project on my CY8C3666 project board. This works fine.
    * The EZ I2C example project on my CY8C5566 dev board. This works fine.
    * Wiring the I2C Master into the dev board. This works fine.
     
    So I'm sure that all of the components work individually. The only thing I can think that's wrong is the set up of my project; the configuration of the EZI2C component or the code. I have checked my code against the example project, and it looks OK. Also, I am using the I2C0 pins 3 & 4 in all cases.
     
    The only difference I can see between my project and the example project is the EZI2C config window. In the example project, the Pin Connections option is greyed out, even though everything else looks the same. Nothing I do seems to be able to un-grey this option.
     
    Is there anything I could be missing?
     
    Hugo


回帖(4)

杨军

2019-4-26 14:24:00
以下TRM笔记影响你在做什么?
问候,Dana。
I2C-SiO和Clock Stretching.jpg
228.7 K

以上来自于百度翻译


     以下为原文
  The following TRM notes affect what you are doing ?
     
    Regards, Dana.


举报

王玮

2019-4-26 14:34:14
嗨,Dana,
我不认为这有帮助。没有办法知道PSoC是否实际上是时钟的延伸,因为无法辨别谁在拉低时钟线。
我想知道的是为什么在一个项目的配置窗口中有一些选项被灰色化了,但是在另一个项目中是可用的吗?
雨果

以上来自于百度翻译


     以下为原文
   Hi Dana,
     
    I don't think this helps. There's no way to tell if the PSoC is actually clock stretching because there's no way to tell who's pulling the clock line low.
     
    What I would like to know is why are some options greyed out in the config window in one project, but available in the other project?
     
    Hugo
举报

姜钰

2019-4-26 14:51:28
我认为这是因为你的PSoC5设备不支持“唤醒睡眠”(只有即将到来的PSoC5LP),而“连接”只需要这个。(查看数据表以解释这2个选项)。
(但如果我是对的,在PSoC3设备上应该启用‘唤醒唤醒’复选框,但这不是因为你的I2C引脚没有连接到正确的引脚。

以上来自于百度翻译


     以下为原文
  I think this is because 'wakeup from sleep' is not supported for your PSoC5 device (only with the upcoming PSoC5 LP), and the 'PinConnection' are only needed for this. (Look at the data sheet for an explanation of these 2 options).
    (But if I'm right with that, the 'wakeup from sleep' checkbox should be enabled on the PSoC3 device, which it isn't. But this could also be because your I2C pins are not connected to the right pins)
举报

王玮

2019-4-26 14:58:04
谢谢Hli,
这很有帮助。
我终于发现了它使用PSoC5而不是PSoC3的真正原因。速度。
1)PSOC5默认为一个48 MHz的主时钟,而PSoC3为24MHz。
2)选择I2C的150 KbPS速度是不够的,即使I2C时钟恰好达到这个速度。我不得不把它设置为300 KbPs。
非常感谢你的时间。
雨果

以上来自于百度翻译


     以下为原文
   Thanks Hli,
     
    That's helpful. 
     
    I finally discovered the real reason it was working with the PSoC5 and not the PSoC3. Speed.
     
    1) The PSoC5 defaults for a 48MHz main clock, while the PSoC3 is 24MHz.
    2) Selecting 150kbps speed for the I2C was not enough, even though the I2C clocks at exactly this speed. I had to set it to 300kbps.
     
    Many thanks for your time.
     
    Hugo
举报

更多回帖

发帖
×
20
完善资料,
赚取积分