完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我读了一些例子,认为我可以通过快速测试来取得一些进步,但我似乎在第一步失败了。
我在项目中添加了一个EZI2C从模块,然后将下面的代码复制到Meal.C中: /EZI2C*/Oy的从地址定义EZI2CySLaveEAdDR(0x08U)定义BuffelySoad(0x04U)定义BuffelyRWyRaaaSe大小(0x02U) /*表示EZI2C缓冲区*/y定义的偏移量,定义SLaveId ADDRIX大小(0x01U) /*EZI2C缓冲器*/UITN8 EZI2C缓冲器[BuffelyStand ]; /*I2C缓冲器,从EZI2C*/UIT8读取I2cBuffRead读取数据[缓冲区大小]; /*I2C缓冲器,将数据写入EZI2C*/UITC8 I2CFBuffRead [SavaEdAdRuleSimule+BuffelyStand ]; int() … /*启动EZI2C*/EZI2CXSTATE();/*启用全局中断*/CyGlobal Algabess;/*初始化EZI2C缓冲器的只读数据*/EZI2cBuff[BuffryRWyRayaaSeaSe]=0xAAU;EZI2cBuff[BuffrRrWaRaaaSeSe+1U]=0xBBU; EZI2CYSET BuffeR1(BuffelySosig,BuffrrRWyRaaaLe大小,(空隙*)EZI2cFuffe); 我认为这将是足够的看到5LP上的I2C总线,甚至读取初始数据,但5LP没有出现在公共汽车上。我有2个其他设备上的板显示出来,我可以从他们读,所以I2C总线似乎正在工作。 我有什么遗漏在这里吗? 谢谢, 乔治 以上来自于百度翻译 以下为原文 I was reading some of the examples and thought I could make some quick progress by running a quick test but I seemed to have failed at step one. I added an EZI2C Slave module to my project and then copied the following code into my main.c: /* Slave address of the EZI2C */ I thought this would be enough to see the 5LP on the I2C bus and even read the initial data but the 5LP doesn't show up on the bus. I have 2 other devices on the board that do show up and I can read from them so the I2C bus seems to be working. Is there something that I'm missing here? Thanks, George |
|
相关推荐
21个回答
|
|
检查EZI2CYGETActuvio()返回的状态字节(调用重置所有状态位!)对于非零,以查看从属是否得到错误条件。
鲍勃 以上来自于百度翻译 以下为原文 Check the status byte returned by EZI2C_GetActivity() (the call resets all status bits!) for non-zero to see if the slave gets an error condition. Bob |
|
|
|
我可以在调试会话中检查,或者调试和I2C不能相处吗?
以上来自于百度翻译 以下为原文 Can I check that during a debug session or does debug and I2C not get along? |
|
|
|
只有睡眠模式不适合调试。当然,您可以使用MixPrim3或KiTrpG调试代码。
鲍勃 以上来自于百度翻译 以下为原文 Only sleep modes do not go with debugging. Of course you can debug the code using a miniprog3 or a Kitprog. Bob |
|
|
|
好吧,我试试看。我很好奇这是不是与EZI2C组件有关,所以我用I2C从部件替换了EZI2C,并将代码修改为: 包括“项目H” It main(空){CyGloalActuable;/*启用全局中断。*/ *将初始化/启动代码放在此处(例如MyStimSistAd())*/ 1;Buff(0)=0;I2CY11SLaveInDead Buff(Buff,1);//I2Cy11StBuffeR1(1, 1,Buff);((;)){//IF(I2Cy11GeActhViviy());I2Cy1SLavestAtUsUs();(I2CY11SSTATEA WRESCMPLT)/IF(Buff[0)] {LeDyWrad(!)UIT88T BuffLeDyRead());BLink(CyDelay)(100);} 我得到了同样的结果,所以我不走运。我仍然好奇为什么I2cDebug与其他I2C部件一起工作,但它似乎与CyPress组件无关。我无法想象我是第一个尝试这个的人。 以上来自于百度翻译 以下为原文 OK, I'll try that. I was curious if this was something with the EZI2C component so I replaced the EZI2C with a I2C Slave component and modified the code to this: #include "project.h"I got the same results so I wasn't lucky. I'm still curious though why i2cdetect works with other I2C parts but it doesn't appear to work with Cypress' component. I can't imagine I'm the first to have tried this. |
|
|
|
我只是红色的RASPI GPIO引脚使用3.3V,可以是你的PSoC板运行在5V?
有一个电平移位器允许PSoC板的I2C在3.3或5V,其中包括上拉电阻器。您可能不使用这些引脚,因为RASPI有它自己的引线。 鲍勃 以上来自于百度翻译 以下为原文 I just red that the Raspi GPIO pins are using 3.3V, can it be that your PSoC board runs at 5V? There is a level shifter to allow the PSoC board's I2C at 3.3 or 5V which includes the pull up resistors. You may not use these pins, because the Raspi has its own pullups. Bob |
|
|
|
谢谢你继续考虑这个问题。不,5LP运行在3.3V,它从TPS2149的LSO输出得到。该板上的其他2个设备响应I2CdEngIt和I2CGETSO,这应该证明I2C总线处于良好状态。
以上来自于百度翻译 以下为原文 Thank for continuing to think about this. No, the 5LP is running at 3.3V, it gets that from the LSO output of the TPS2149. The other 2 devices on this board are responding to i2cdetect and i2cget so this should prove that the I2C bus is in a good state. |
|
|
|
为了消除我的董事会引起一些问题的可能性,我用了一个新的5LP套件,并用您的示例代码编写了它。我使用树莓PI的3.3V输出为5LP供电,并将I2C信号连接到P12[01:]。5LP板上的LED与每个I2cDebug命令切换,但未检测到5LP。
以上来自于百度翻译 以下为原文 To eliminate the possibility of my board causing some issue I took a new 5LP kit and programmed it with your example code. I used the Raspberry Pi's 3.3V output to power the 5LP and connected the I2C signals to P12[0:1]. The LED on the 5LP board toggles with each i2cdetect command but the 5LP is not detected. |
|
|
|
您使用的是三个独立缓冲区,而不是仅一个缓冲区。缓冲器的第一部分用于主读和写,第二部分是用于主读的。EZI2CYStBuffeR1()告诉缓冲区在何处,读写区域之间的点在哪里。有一个状态调用,显示了主人所做的任何活动。
下一次请张贴您的完整项目,以便我们都可以看看你的所有设置。要做到这一点,使用C造饰者和GT;文件-GT;创建工作区束(最小)并附加结果文件。这将有助于(至少我)找到任何问题。 鲍勃 以上来自于百度翻译 以下为原文 You are using three independent buffers instead of only one. The first part of the buffer is used for the master to read from and write to, the second part is for the master to only read from. the EZI2C_SetBuffer1() tells where the buffer is and where the point between read and write area lies. There is a status call that shows any activities the master has made. Next time please post your complete project, so that we all can have a look at all of your settings. To do so, use Creator->File->Create Workspace Bundle (minimal) and attach the resulting file. It will help (at least me) to find any problems. Bob |
|
|
|
嗨,鲍伯,
谢谢你的回复。该代码是从一个示例I2C从属项目直接复制的。我已经为你附上了这个项目。 在这一点上,我并不担心缓冲区在读写边界之间是如何定义或分裂的。我的板连接到树莓PI,当我发布了“SUDO I2CSET-Y 1”,我可以看到ADC和FRAM在我的董事会(50, 51, 54),但不是5LP使用默认的0x08地址。我想也许内置的代码没有响应轮询,所以我发布了一个“SUDO I2CGET -Y 1 0x08”,看看我是否可以读取5LP缓冲区,我有一个错误。 在主控器可以从从属缓冲器读取之前,是否需要编写明确的代码?我认为我写的东西足以得到最初的回应,并证明我有一个良好的工作起点。 谢谢, 乔治 骨干程序员 1.2兆字节 以上来自于百度翻译 以下为原文 Hi Bob, Thanks for replying. That code was copied straight out of an example I2C slave project. I've attached the project for you. At this point I wasn't worried about how the buffer was defined or split between read and write boundaries. I have the board connected to a Raspberry Pi and when I issued a "sudo i2cdetect -y 1" I could see the ADC and FRAM on my board (50, 51, 54) but not the 5LP which was using the default 0x08 address. I thought maybe the built-in code didn't respond to polling so I issued a "sudo i2cget -y 1 0x08" to see if I could read the 5LP buffer and I got an error. Does there have to be explicit code written before the master can read from the slave buffer? I thought what I had written would be enough to get the initial response and prove that I had a good working starting place. Thanks, George |
|
|
|
…等待完整的项目…
顺便问一下:FRAM是从哪里来的?还是使用CY8CKIT-044先锋套件? 鲍勃 以上来自于百度翻译 以下为原文 ... waiting for the complete project... Btw: Where is the FRam from? Or are you using a CY8CKIT-044 Pioneer kit? Bob |
|
|
|
我把完整的项目附在最后一篇文章上。我提交后,我编辑了这个职位,并增加了项目,所以你可能错过了。这是一个定制板我做了我附上的示意图供您参考。
测试适配器V4.PDF 471.5 K 以上来自于百度翻译 以下为原文 I attached the complete project to that last post. I edited the post after I submitted it and added the project so you might have missed that. It's a custom board I made which I'm attaching the schematic for your reference.
|
|
|
|
尝试附加项目。将LED的引脚设置为可以测量的输出。
鲍勃 Cyrkk.Access 01Y1.Zip的测试 21.8 K 以上来自于百度翻译 以下为原文 Try the attached project. Set the pin for the LED to an output you can measure. Bob
|
|
|
|
谢谢鲍伯。我得去参加一个会议,但今晚我要试一试,让你知道发生了什么。
以上来自于百度翻译 以下为原文 Thanks Bob. I have to run to a meeting but I'll give this a try tonight and let you know what happens |
|
|
|
我刚刚运行了你的测试,当我在5LP上发出I2cDebug命令时,我看不到LED引脚上的一个脉冲,我把它改为P1(7),并通过在边沿设置触发器来监视。我仍然看到ADC和FRAM。
以上来自于百度翻译 以下为原文 I just ran your test and when I issue the i2cdetect command on the 5LP I don't see a pulse on the LED pin which I changed to P1[7] and monitored by setting the scope to trigger on an edge. I still see the ADC and FRAM. |
|
|
|
根据您的示意图,您提供了VDDIO0,但不是VDDIO1、2和3。
鲍勃 以上来自于百度翻译 以下为原文 According to your schematic you powered VDDIO0, but not VDDIO1, 2 and 3. Bob |
|
|
|
哇,我现在看到了,谈论脑死亡。但在我添加了I2C代码之前,我编写了程序板并运行了HSSP代码。这是第一次使用5LP,所以我不确定VDIO1-3栏杆是怎么做的,为什么这个部分即使没有动力也会起作用。
以上来自于百度翻译 以下为原文 Wow, I see that now, talk about brain dead. But before I added the I2C code I programmed the board and had it run the HSSP code which worked. This is the 1st time using the 5LP so I'm not sure what the VDDIO1-3 rails do and why the part would seem to work even if they're not powered. |
|
|
|
只看了一下数据表,发现:
所以我想这解释了为什么我在12[0-1 ]上的I2C连接不起作用。一些焊丝的焊接时间和再测试时间! 我还记得,当我用DEV工具包测试时,我能够使用HSSP来运行代码。我从来没有用这个板来编程另一个板,看看我的连接,除非我跳过VDDIO0到VDIO1-3,否则它不会起作用。 以上来自于百度翻译 以下为原文 Just looked in the datasheet and found this: So I guess that explains why my I2C connections on P12[0-1] doesn't work. Time for some soldering of some jumper wires and re-testing! And I just remembered that I was able to run the code to program using HSSP when I was testing with the Dev Kit. I've never used this board to program another board and looking at my connections it won't work unless I jumper VDDIO0 to VDDIO1-3 |
|
|
|
好,我添加了跳线,并确认我得到3.3V在所有VDDIO-3引脚。当我发布i2cDebug命令时,我仍然没有看到0x08。为了确认VDIO3实际上是供电的,我移除了C9,配置了P3〔2〕作为输出,并在代码的主要部分添加了P3(2)的切换。我可以探测P3(2)并确认我得到方波。
所以现在我又被困了,不知道为什么5LP对I2cDebug命令没有反应。我还尝试了“SUDO I2CGET -Y 1 0x08 0x00 B”,并且我得到了一个读取错误,所以没有出现5LP I2C正在响应。 在您的代码中,我将LED引脚设置为P1(7),并且我可以看到,每个I2cDebug i检测到PIN拨号,但是为什么会因为缓冲区设置而导致读失败,为什么在I2cDebug命令运行时它不出现呢? 以上来自于百度翻译 以下为原文 OK, I added the jumper wires and confirmed that I'm getting 3.3V on all VDDIO0-3 pins. I still wasn't seeing 0x08 when I issued the i2cdetect command. To confirm that VDDIO3 was in fact powered I removed C9, configured P3[2] as an output, and added a toggle to P3[2] in the main section of code. I can probe P3[2] and confirm that I'm getting a square wave. So now I'm back to being stuck not knowing why the 5LP isn't responding to a i2cdetect command. I also tried "sudo i2cget -y 1 0x08 0x00 b" and I get a read error so it doesn't appear that the 5LP I2C is responding. In your code I set the LED pin to P1[7] and I can see that pin toggle with each i2cdetect I detect but why would a read fail since the buffer is set up and why doesn't it appear when the i2cdetect command is run? |
|
|
|
gaozhipeng_lv 发表于 2019-1-22 14:40 我附上2个逻辑分析仪捕获。第一个显示了一个成功的阅读ADC上的董事会,第二个是试图读取5LP地址0x08和5LP发行NAK。 5LP1I2C.Test.PDF 357.6 K 以上来自于百度翻译 以下为原文 I'm attaching 2 logic analyzer captures. The first one shows a successful read of the ADC on the board and the 2nd one is an attempt to read the 5LP at address 0x08 and the 5LP issuing a NAK
|
|
|
|
只有小组成员才能发言,加入小组>>
726个成员聚集在这个小组
加入小组1935 浏览 1 评论
1684 浏览 1 评论
3446 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1604 浏览 6 评论
1403 浏览 1 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-6-24 03:06 , Processed in 1.349622 second(s), Total 114, Slave 98 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191