完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
一段时间后,我开始寻找一种可行的解决方案,将以太网控制添加到我的PSoC 5LP项目中,不幸的是,我没有找到一种可行的解决方案。在尝试了其他几种可供选择的解决方案之后,我开发了在ARDUNO盾上使用的W5100 WiZNET设备的驱动程序的附加实现。
这个组件是一个纯软件驱动程序(您需要将它链接到一个SPICONT),并且它现在使用W5100设备的内置协议支持TCP、ARP和UDP。它还支持SpPoto共享以允许应用程序利用SPI总线处理多个连接设备的能力。驱动程序还包括宏,用于使用来自CyPress库的SPIMor SCB组件的驱动程序。 这不是C++代码从ARDUIO库(Re.EntEnt14 100个项目在100天内)的转换;它是从头开始编写的,作为PSoC设备的一个组件。 我已经使用PSoC 4和PSoC5/5LP测试了这个,我已经成功地用PSoC 5LP建立了一个6端口应用程序。驱动程序还没有完全测试PSOC 3,但我相信它应该基于一些初始测试结果。 希望大家都有这样的乐趣,使用这个组件,我已经写了! 卡盘 E2FLIFYW5100.CYWRK.SARVEVE01.ZIP 682.8 K 以上来自于百度翻译 以下为原文 A while back I started looking for a viable solution to adding Ethernet control to my PSoC 5LP project, and unfortunately, I did not find a solution that would work in . After trying several other alternative solutions, I developed the attached implementation of a driver for the W5100 WIZnet device used on the Arduino shield. This component is a software-only driver (you will need to link it to a SPI port), and it currently supports TCP, ARP, and UDP using the built-in protocols of the W5100 device. It also supports SPI port sharing to allow the application to take advantage of the ability of the SPI bus to handle multiple connected devices. The driver also includes macros for using the driver with the SPIM or SCB components from the Cypress libraries. This is not a conversion of the C++ code from the arduino library (ref. Element14 100 Projects in 100 days); it was written from scratch as a component for the PSoC devices. I have tested this using the PSoC 4 and PSoC 5/5LP and I have sucessfully built a 6-port application with a PSoC 5LP. The driver has not yet been fully tested o nthe the PSoC 3, but I believe that it should work based on some initial testing results. Hope everyone has as much fun using this component as I had writing it! -Chuck |
|
相关推荐
42个回答
|
|
华丽的新年礼物。非常感谢。在这里等待新闻:HTTP://www. e2fLIF.COM/Auth/Cukk/
以上来自于百度翻译 以下为原文 Gorgeous gift for the new year. Thank you very much. Waiting for news here: http://www.e2forlife.com/author/chuck/ |
|
|
|
在W5100.C的第73行中,将代码更改为以下语句:
定义“$StassNoNo.No.SPIDON”('$SPILASTURE实例'AuditXSTATUSUMER())和(($SPILION实例) 这将包括条件中的IDL国旗以确定SPIX设备可用于写入。在我执行的测试中,死锁似乎是由SPIIS报告它没有完成的条件引起的,但它是空闲的。两个条件都可以接受,因此在条件中添加IDL国旗。 这一变化将包括在V1.2版本,并且可以在GitHub上的档案。 以上来自于百度翻译 以下为原文 On line 73 of W5100.c, change the code to the following statement: #define `$INSTANCE_NAME`_SpiDone (`$SPI_INSTANCE`_ReadTxStatus() & (`$SPI_INSTANCE`_STS_SPI_DONE | `$SPI_INSTANCE`_STS_SPI_IDLE)) This will include the IDLE flag in the condition to determine that the SPI device is available for writing. In the testing that I was performing, the deadlock seems to be caused by a condition where the SPI is reporting that it is not DONE, but it is IDLE. Either condition is acceptable for writing, so I added the IDLE flag in to the conditions. This change will be included in the v1.2 release, and is available on the GitHub archive. |
|
|
|
|
|
|
|
嗨,ChuckE!我尝试用PSCPON(…)为PSOC4发送2000字节的PSOS4(…),它为PSoC5LP花费了38毫秒,在PLL=64兆赫时为PSoC5花费了15毫秒,在PLL=64 MHz时花费了18毫秒,否则必须包括高速模式否则不能从中退出(!)PSOC3-的En0UTCPTCP连接(Socket)不工作:编译器不喜欢内联的单词(()
以上来自于百度翻译 以下为原文 Hi, ChuckE! I tried to send 2000 bytes in your example PSoC-W5100-Driver-master using the TcpSend (...) For PSoC4 it took 38 ms For PSoC5LP it took 15 ms at PLL = 64MHz For PSoC5 it took 18 ms at PLL = 64MHz and had to include High Speed Mode otherwise - does not go out from while (! ETH0_TcpConnected (socket)) For PSoC3 - did not work: the compiler does not like the word inline (((( |
|
|
|
以下是修正和调整…
226号线 UIT88T WZCHIPIPRADE(){UIT88T T RET;//用于调试UIT88T虚拟哑=0;//WiZClask.if。SPI。而(!)(SpimaRead TxStAsUsf()和SpimthStsSpILIZON);而(SPIMGEGTXBFFRESRESIZE()= 0);//MJ TyayOUT RET=SPimaRealRxDATA();返回RET;}MJ 以上来自于百度翻译 以下为原文 the following is a correction and tweak... //------line 226 -------------------------------------------------------------- uint8_t wizchip_read() { uint8_t ret; // for debugging uint8_t dummy = 0; // WIZCHIP.IF.SPI._write_byte(); <---- wrong call SPIM_WriteTxData(dummy); //dummy fill, corrected here... while (!(SPIM_ReadTxStatus() & SPIM_STS_SPI_DONE)); while (SPIM_GetRxBufferSize() == 0); // mj tryout ret = SPIM_ReadRxData(); return ret; } MJ |
|
|
|
嗨,ChuckE!我试着做一个TCP回音服务器。我从这里添加了调试函数iPrTrf,HTTP://www. CyPress?ID=4和;RID=81086个小问题:如果断开以太网电缆,TCP ECHORE服务器将不再看到客户端,然后关闭客户端,然后(& 1分钟)连接以太网电缆并再次运行客户端。我在S0IR寄存器中只看到0x00或0x01,没有看到超时中断。
邮政编码 778.2 K 以上来自于百度翻译 以下为原文 Hi, ChuckE ! I tried to make a TCP echo server. I added debug function iprintf from here http://www.cypress.com/?id=4&rID=81086 Small problem: TCP echo server does not see the client again If i disconnect the ethernet cable then shut down the client and then (>1 minutes) connect ethernet cable and run the client again. I see only 0x00 or 0x01 in S0_IR register and not see timeout interrupt.
|
|
|
|
你好,Pavloven!我很高兴看到你试用了这个部件,很抱歉回答得这么慢。
当使用组件内的宏来快速启动项目时,可能需要根据BuSuCl速率和SPI接口除数之间的关系来调整一些设置。我试着将它们默认为方框外的工作,但假设是一个48兆赫的PLLUT。随着64 MHz输入到SPIOTE,您可能需要一个较大的除数来划分该部分的数据速率,因此可能需要检查“高速模式”。 我将您的设置和数据长度插入到测试应用程序中,用一个类似于您所使用的设置来测量时序和SPIsETIN,并且使用我的逻辑分析仪来分析WHESE结果: psoc4 SCB模式约为30 ms psoc4 spimmode约46毫秒使用psocpioneer板+ Arduino的盾和一个48 MHz的bus_clk数据速率在6 Mbps。 psoc5lpwas大约11.6毫秒测量采用freesocexplorer + ardiouno以太网盾,和bus_clk 64 MHz和16 Mbps的spidata率。 这意味着有效的“波特”率为港口大约1.38 Mbps的范围(11.6毫秒传输)到最坏的情况下(46毫秒传输)端口上的数据率为348 kbps。司机的有效数据率是高度依赖于组件的read_write_delayconfiguration参数的psocdevice和W5100的组件之间的数据传输率。 W5100的设备不支持突发传输(见突发模式的融合,所以每个字节W5200)将使用该设备,处理器必须写4字节的W5100在SPI端口,和额外的8个字节更新TXX指针和另一个8字节的读开始时的TX指针。这相当于大量的开销和EDR的丢失。 你可以试着修改的read_write_delay W5100接口驱动程序在减少一些司机的开销。基本上,这个参数是一个“廉价”的方法来估计要等多久的spiinterface完成任何操作,使集体安全条约组织恢复活动状态。它是在微秒的延迟指定,例如在6 Mbps的spiport大约需要5.33美元送位包W5100数据速率。在这种情况下,读写写延迟将设置为5。在速度为16 Mbps,大约需要2我们给位分组,这将节省约3美元每操作对W5100在2000字节的情况下节省了6 msoff传递一个6 Mbps的16 Mbps的数据速率之间。 从debugto releasewill加快执行代码略。 Git仓库:https://github.com/e2forlife/psoc-w5100-driver/ 3工程实例及最新开发的代码。 以上来自于百度翻译 以下为原文 Hi Pavloven! I happy to see you tried out the component, and I am sorry to have replied so slowly. When using the macros within the component to quick-start a project, you might need to tweek some of the settings due to relationships between the BUS_CLK rate and the SPI interface divisor. I tried to default them to what seemd to work right out of the box, but that was assuming a 48 MHz PLL out. with a 64 MHz input to the SPI part, you might need a larger divisor to divide down to the data rate for the part, so the "High speed mode" may need to be checked. I plugged your settings and data length in to a test application to measure the timing and the SPI settings with a setup similar to what you were using, and I measured whese results using my logic analyzer: PSoC 4 SCB mode was about 30 ms PSoC4 SPIM mode was about 46 ms using a PSoC Pioneer board + Arduino shield and a 48 MHz BUS_CLK with data rate at 6 Mbps. PSoC5LP was roughly 11.6 ms measured using a FreeSOC Explorer + Ardiouno Ethernet shield, and a BUS_CLK of 64 MHz and a SPI data rate of 16 Mbps. What this means in effective "baud" rate for the port ranges from roughly 1.38 Mbps (11.6 ms xfer) to a worst case (46 ms xfer) the data rate on the port was about 348 Kbps. The effective data rate of the driver is highly dependent upon the READ_WRITE_DELAY configuration parameter of the component, the data rate between the PSoC device and the W5100 component itself. The W5100 device does not support "burst mode" transfers ( see the W5200 for the inclusion of burst mode), so for each byte transfered using the device, the processor has to write 4 bytes to the W5100 over the SPI port, and additional 8 bytes to update the txx pointer and another 8 bytes to read the tx pointer at the start. This equates to a huge amount of overhead and a loss of EDR. You can try to tweek the READ_WRITE_DELAY within the W5100 interface driver to reduce some of the overhead of the driver. Basically this parameter is a "cheap" way to estimate how long to wait for the SPI interface to complete any operation and allow the CS to return to an inactive state. It is specified in microseconds of delay, so for example at 6 Mbps data rate on the SPI port it would take roughly 5.33 uS to send the 32-bit packet to the W5100. The READ_WRITE_DELAY would be set to 5 in this case. At a rate of 16 Mbps, it takes about 2 us to send the 32-bit packet, which would save about 3 us per operation on the W5100 which in the case of 2000 bytes saves about 6 mS off a transfer between a 6 Mbps and 16 Mbps data rate. Also switching from DEBUG to RELEASE will speed up the execution of the code slightly. The GIT repository: https://github.com/e2forlife/PSoC-W5100-Driver/ has 3 example projects and the latest development code. |
|
|
|
|
|
|
|
对不起,问题解决了。在附加文件中的更改。
MIN 6Zip 1.6 K 以上来自于百度翻译 以下为原文 Excuse me, the problem is solved. Changes - in the attached files.
|
|
|
|
嗨,ChuckE!我有关于W5100。C:_socketrxdatawaiting(插座)被清除,只有当旗帜在_processrxdata设置为1。我什么时候和怎样管理国旗?谢谢您。
以上来自于百度翻译 以下为原文 Hi, ChuckE! I have questions about W5100.c: _SocketRxDataWaiting(socket) is cleared only when the flags in _ProcessRxData set to 1. When and how can I manage the flags. thank you. |
|
|
|
使用TCP连接终止时,如果你需要“回收”的关闭连接,重新打开和重新启动服务器。这是因为在W5100的tcpcontroller进入“终止”状态时,远程系统两端的连接,这就要求软件,然后关闭打开的套接字来完成终止,然后另一个插座必须打开允许发生进一步的联系,否则系统将出现“死”或锁定。
尝试使用_socketprocessconnections()电话到最后的循环处理的插座。文件中有一些示例代码,它并没有表明,但是,是服务器也必须开始允许本服务器的连接被建立。如果你是在一个回路连接处理,再打电话给_tcpopen()打开套接字后,调用一个_tcpstartserver()把W5100到listenstate让未来的连接。 以上来自于百度翻译 以下为原文 When working with TCP, if the connection is terminated you need to "recycle" the connection by closing, re-opening and restarting the server. this is because the TCP controller in the W5100 enters a "TERMINATING" state when the remote system ends the connection, which requires the software to then close the open socket to complete the termination, then another socket must be opened to allow for further connections to occur, otherwise the system will appear to be "dead" or locked-up. Try using the _SocketProcessConnections() call to handle the socket at then end of the loop. There is some example code in the document, what it doesn't show, however, is that the server must also be started to allow for future connections to the server to be established. If you are processing your connection within a loop, after re-opening the socket with a call to _TcpOpen(), call a _TcpStartServer() to place the W5100 in to the LISTEN state and allow for future connections. |
|
|
|
尼斯项目收集去。非常感谢作者!
以上来自于百度翻译 以下为原文 Nice projects collection going. Many thanks to the authors! |
|
|
|
SOCKTrxDATAWAITIN()返回存储在W5100设备内的RX循环缓冲区中的字节数(寄存器WX100中的寄存器SXYRXRSR)。这是一个方便的方法来检查是否有一个数据包等待。该函数读取循环内的5100中的RxsiZeReGistor,直到它检测到两个相同的缓冲器长度(试图阻止直到分组接收已经压缩)。为了使它为零,必须读取设备中的等待数据,这就是为什么调用SturrrxDATA从SOCKTrxDATAWAITIN()中清除结果的原因。
为了清楚的结果没有你可能会写rxread指针的rxreadptr + socketgetrxdatawaiting()地址芯片读取数据,然后发出recvcommand的W5100,或使用代码行979通过2012 W5100。C,不执行循环往复M线988到1004。您可能还需要执行线1442以及W5100登记接收的数据已被删除。 我不包含任何缓冲区管理,由于以太网控制器将拒绝不解决MAC数据包,并为我的应用程序需要处理每一个数据包被接收,因此所有的缓冲区长度的管理是通过接收数据功能。基本上一次回路我叫tcpreceive()功能检查结果。如果结果是非零有数据接收,如果它是零,没有数据的读取和在主代码以太网处理器将没有数据处理。 以上来自于百度翻译 以下为原文 SocketRxDataWaiting() returns the number of bytes stored in the RX circular buffer within the W5100 device (register Sx_RXRSR in teh W5100). It is a handy way to check if there is a packet waiting. The function reads the RXSIZE register within the 5100 in a loop until it detects two buffer lengths that are identical (an attempt to block until a packet receive has compmleted). In order for this to be zero, you must read the waiting data from the device, which is why the call to ProcessRxData clears the result from SocketRxDataWaiting(). In order to clear the result without reading the data from the chip you'd probably have to write the RX Read Pointer to an address of the RxReadPtr + SocketGetRxDataWaiting(), then issue a RECV command to the W5100, or use the code from lines 979 through 1012 of W5100.c, without executing the loop from lines 988 through 1004. You may also need to execute the line at 1442 as well for the W5100 to register that the received hdata has been removed. I didn't include any buffer management, since the Ethernet controller will reject packets that are not addressed for the MAC, and for my application I needed to handle every packet that was received, thus all of the management of the buffer length was done through the receive data functions. Basically once a loop I would call the TcpReceive() function and check the result. If the result was non-zero there was data received, if it was zero there was no data read and the Ethernet handler in the main code would have no data to process. |
|
|
|
我也得到了服务器的例子来工作!(感谢帕夫洛文)和随机焦炭转移试验。
所有在PSoC4上,在SPIM模式下。 优秀的工作人员… 以上来自于百度翻译 以下为原文 I also got the server example to work !! (thanks Pavloven), , and the random char transfer test. All on PSoc4, in SPIM mode. good work folks... |
|
|
|
我试图创建一个简单的Web服务器。我不认为这是一个很好的选择,但我希望这个项目帮助别人节省时间开始。在IE和谷歌浏览器上进行测试。
E2FieldWeb.CyWrk.Zip 791 K 以上来自于百度翻译 以下为原文 I tried to create a simple WEB server. I do not think that is a good option but I hope that this project help someone save time initially. Tested on IE and Google Chrome.
|
|
|
|
这个项目看起来设计得很好。
我的兴趣是让它与后来的W5500芯片(特别是PSO5LP)一起工作。 我相信关键的改变将是SPI COMs的类型/大小。 但我对修改组件代码感到不安。 有线索,有指针吗? 谢谢你的伟大工作。 HTTP:/WiZWikI.NET/Wiki/DokU.PHP?ID=产品:WiZ550IO:AlpEPS 以上来自于百度翻译 以下为原文 This project looks very well designed. My interest is getting it to work with the later model W5500 chips (esp. on psoc5lp). I believe that the key changes would be the type/size of SPI comms. But I am uneasy about tinkering with the component code. Any clues, or pointers? Thanks for the great job sofar. http://wizwiki.net/wiki/doku.php?id=products:wiz550io:allpages |
|
|
|
Weeeeell:试着用一个例子来解释。它附在下面。测试,我用大力神设置实用程序http://www.hw-group.com/products/hercules/index_en.html我做的:1.。发送测试字符串,看到eth0_socketrxdatawaiting(插座)& gt;0 2。执行命令:三。并再次检查eth0_socketrxdatawaiting(插座)如果我安装了一个国旗= 1,在W5100。C:结构特点` instance_name美元` _processrxdata(插座、0、缓冲、rxsize,1);我看到eth0_socketrxdatawaiting(插座)= 0谢谢你的耐心,似乎这不是我的最后一个问题
RXDATAWAITIN 810.4 K 以上来自于百度翻译 以下为原文 Weeeeell :) Try to explain with an example. It is attached below. For testing, I used Hercules SETUP utility http://www.hw-group.com/products/hercules/index_en.html I do: 1. send a test string and see ETH0_SocketRxDataWaiting(socket) > 0 2. execute commands ETH0_TcpReceive(... 3. and check again ETH0_SocketRxDataWaiting(socket) only if I install a flag = 1, in W5100.c as here: str. 1394 `$INSTANCE_NAME`_ProcessRxData( socket, 0, buffer, RxSize, 1); i see ETH0_SocketRxDataWaiting(socket) = 0 Thanks for your patience, it seems this is not my last question
|
|
|
|
我尝试使用WiFi:ESP83266作为接入点
SSID:“ApPASTEST”通过“12345678”http://192.1684.1 我的代码仍然很原始… CY8CKIT-030:APHServer的项目文件。 以上来自于百度翻译 以下为原文 I'm trying to use WiFi: ESP83266 as Access Point SSID: "AP_test" PASS "12345678" http://192.168.4.1 My code is still very primitive .... The project file for CY8CKIT-030: AP_Serwer.zip it here. |
|
|
|
嗨,查克,
非常感谢你在这方面的工作!我和米迦勒一样,对使用新的部件W5500感兴趣,有一个PSoC5LP。你认为你的组件可以很容易地与W5500一起使用吗?当我在WiZNET的网站上访问W5100和W5500的页面时,看起来它们提供的驱动程序在2个部分之间是不同的,这使得我认为可能会有一些差异需要在组件中进行修补。你或者你认识的人试着用W5500来使用你的组件吗? 谢谢! 斯科特 以上来自于百度翻译 以下为原文 Hi ChuckE, Thanks a lot for your work on this! I, like Michael, am interested in using the new part, the W5500, with a PSoC5LP. Do you think your component could easily be used with the W5500? When I go on Wiznet's website and go to the pages for the W5100 and the W5500, it looks like the drivers they provide are different between the 2 parts, which makes me think there might be differences that would require some tinkering in your component. Have you, or someone you know, tried to use your component with a W5500? Thanks! Scott |
|
|
|
只有小组成员才能发言,加入小组>>
754个成员聚集在这个小组
加入小组2110 浏览 1 评论
1858 浏览 1 评论
3673 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1791 浏览 6 评论
1540 浏览 1 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
575浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
428浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
440浏览 2评论
390浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
922浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-26 21:14 , Processed in 1.477940 second(s), Total 117, Slave 99 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号