Microchip
直播中

李伟嘉

7年用户 177经验值
私信 关注
[问答]

如何通过SPI与ENC28J60连接

我知道您通过SPI与ENC28J60连接,并且我设置了我的SPI:SpiChnOpen(1,SPI_CON_MSTEN|SPI_CON_MODE8|SPI_CON_ON,BRG);OpenSPI1(MASTER_ENABLE_ON|SPI_MODE32_ON,SPI_ENABLE);但是您向它发送什么呢?比如,如果我想通过TCP/IP发送一组字节,我如何得到它呢?我已经看了28 J60.PDF,但我觉得它不太有用,如何让它工作。

以上来自于百度翻译


      以下为原文

    I know you connect with the ENC28J60 over SPI and I have my SPI set up :
SpiChnOpen(1, SPI_CON_MSTEN | SPI_CON_MODE8 | SPI_CON_ON, BRG);
OpenSPI1( MASTER_ENABLE_ON|SPI_MODE32_ON,SPI_ENABLE);
but what do you send to it?
like If I want it to sent out a set of bytes over tcp/ip how do I get it to do that?
I have looked at ENC28J60.pdf, but I do not find it too useful on how to get it to work.

回帖(6)

朱佳婧

2019-7-25 08:48:30
该设备的数据表将显示HW如何工作、控制HW配置的接口等。TCP/IP、UDP等是以太网的应用层。您要么开发自己的以太网通信栈,要么从网络上提供的一些微芯片应用程序(或者使用与您类似的配置的其他供应方)下载它们……nd包括设置MCU,建立与ENC芯片通信的驱动程序接口,然后需要一个应用层或2或更多层来处理通信策略,即UDP、TCP等。可能的-或者你找到一些可供你进行DL修改的项目。

以上来自于百度翻译


      以下为原文

    The datasheet for the device will show you how the HW works, the interfaces to control the HW configurations, etc.  TCP/IP, UDP, etc. are application layers of Ethernet.  Either you develop you own Ethernet communication stacks, or you download them from some Microchip application provided on the web (or some other supplying party that is using a similar configuration as you are)... 
 
Overall, there are several layers of an application to accomplish what you want to, and that will involve setting up your MCU, building driver interfaces to communicate with the ENC chip, and then you will need an application layer or 2, or more that will handle your communications strategy - i.e. UDP, TCP, etc.  Either you do all the work to accomplish all of this - which is very much possible - or you find some project that is available for you to DL and modify accordingly. 
举报

杨静

2019-7-25 09:08:26
网上有没有免费的?

以上来自于百度翻译


      以下为原文

    is there a simply free one online I can used ?
举报

朱佳婧

2019-7-25 09:14:26
我要做的是搜索Microchip的网站并查看他们的TCP/IP协议栈。也许MLA或和谐…如果你想简单地把东西塞进去,让它做些事情,你就会做得不对。大多数从事以太网实现业务的开发人员对以太网的理解都很低。那些知道的更少(或者更多…)的人可以采取某种方式得到一堆东西来节省大量的工作——我是说很多。那些不知道什么是栈的人首先需要了解这一点。总而言之,TCP/IP的栈至少要涉及一点点,并且需要很多帧解析/构造规则来理解以太网帧在特定应用程序中的通信意图。这不是太难,因为它不是一个需要天才去理解的东西,但是需要一些工作来学习。正如我提到的,首先搜索微芯片。这是常识性的事情,如果你具备一些好的,一般的以太网知识。如果Microchip没有给你想要的,然后搜索www.你不是唯一使用这个设备的个人…

以上来自于百度翻译


      以下为原文

    What I would do is search Microchip's site and look into their TCP/IP stack.  Perhaps MLA or Harmony...  If you are expecting to simply plug the thing in and have it do stuff, you are going about this incorrectly.  Most developers who take on the Ethernet implementation business have some understanding of Ethernet at a low-level.  Those who know less (or more for that matter...) may resort to getting a stack of some sort to save a lot of work - and I mean a lot.  Those who don't know what a stack is need to learn this first. 
 
All in all, a stack for TCP/IP is a little involved to say the least and requires a lot of frame parsing/construction rules to understand the Ethernet frame in terms of what it is intending on communicating in a particular application.  It is not overly difficult as it is not something that takes a genius to figure out, but it takes some work to learn.  As I mentioned, search Microchip first.  This is the common sense thing to start with if you are equipped with some good, general Ethernet knowledge.  If Microchip doesn't give you what you want, then search the WWW.  You are not the only individual who is using this device... 
举报

黄飞高

2019-7-25 09:21:27
看看最新的遗产MLA。它具有TCP/IP栈V5.xx,应用程序称为演示应用程序。它拥有所有微芯片以太网部件的驱动程序,包括Enc8J60。但正如cgiordan所说,还有比这更多的东西。你至少需要一些TCP/IP协议栈的层,演示应用程序就是这样的。您选择硬件、PIC系列、协议和演示,您想使用定义和不同的构建配置。还有一个帮助文件,它将给你一些有用的信息,除了其他之外,演示应用程序/Ruben的不同部分需要多少ram和flash。

以上来自于百度翻译


      以下为原文

    Take a look at the latest legacy MLA. It has the TCP/IP stack v 5.xx with an application called the Demo App. It has drivers for all Microchip Ethernet parts, including the ENC28J60. But as cgiordan says there is more to it than that. You need at least some of the layers of the TCP/IP stack and the Demo App has all that. You select the hardware, PIC family, protocols and demos you want to use with defines and different build configurations. There is also a help file that will give you some useful information, amongst others, how much ram and flash you will need for the different parts of the Demo App.
 
/Ruben
举报

更多回帖

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