ENC28J60

所属分类:处理器开发
开发工具:C++
文件大小:43KB
下载次数:7
上传日期:2014-04-03 13:46:22
上 传 者6484121
说明:  ENC28J60 網路模塊 STM32 源碼
(ENC28J60 network module STM32 source)

文件列表:
ENC28J60\Client.cpp (3336, 2011-04-08)
ENC28J60\Client.h (724, 2011-04-08)
ENC28J60\Ethernet.cpp (1101, 2011-04-08)
ENC28J60\Ethernet.h (650, 2011-04-08)
ENC28J60\examples\ChatServer\ChatServer.pde (699, 2011-04-08)
ENC28J60\examples\WebClient\WebClient.pde (724, 2011-04-08)
ENC28J60\examples\WebClientDEBUG\WebClientDEBUG.pde (1211, 2011-04-08)
ENC28J60\examples\WebServer\WebServer.pde (1623, 2011-04-08)
ENC28J60\examples\WebServerDEBUG\WebServerDEBUG.pde (2289, 2011-04-08)
ENC28J60\examples\WebServerSimple\WebServerSimple.pde (1057, 2011-04-08)
ENC28J60\examples\WebServerSimpleLED\WebServerSimpleLED.pde (2281, 2011-04-08)
ENC28J60\keywords.txt (636, 2011-04-08)
ENC28J60\resources\resources.markdown (2567, 2011-04-08)
ENC28J60\resources\Tcp_state_diagram_fixed_new.svg (104767, 2011-04-08)
ENC28J60\Server.cpp (1699, 2011-04-08)
ENC28J60\Server.h (346, 2011-04-08)
ENC28J60\ToDo (407, 2011-04-08)
ENC28J60\utility\enc28j60.c (11037, 2011-04-08)
ENC28J60\utility\enc28j60.h (9740, 2011-04-08)
ENC28J60\utility\ip_arp_udp_tcp.c (21684, 2011-04-08)
ENC28J60\utility\ip_arp_udp_tcp.h (1931, 2011-04-08)
ENC28J60\utility\net.h (4546, 2011-04-08)
ENC28J60\utility\socket.c (13192, 2011-04-08)
ENC28J60\utility\socket.c.backup (14268, 2011-04-08)
ENC28J60\utility\socket.h (2535, 2011-04-08)
ENC28J60\utility\socket.h.backup (1019, 2011-04-08)
ENC28J60\examples\ChatServer (0, 2011-11-15)
ENC28J60\examples\WebClient (0, 2011-11-15)
ENC28J60\examples\WebClientDEBUG (0, 2011-11-15)
ENC28J60\examples\WebServer (0, 2011-11-15)
ENC28J60\examples\WebServerDEBUG (0, 2011-11-15)
ENC28J60\examples\WebServerSimple (0, 2011-11-15)
ENC28J60\examples\WebServerSimpleLED (0, 2011-11-15)
ENC28J60\examples (0, 2011-11-15)
ENC28J60\resources (0, 2011-11-15)
ENC28J60\utility (0, 2014-04-03)
ENC28J60 (0, 2011-11-15)

Ethernet ENC28J60 ================== [Microchip ENC28J60](http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en022889) is an Ethernet controller with SPI interface that is used in some Arduino Ethernet Shields (these are called "etherShield"s). Unfortunatelly, the standard Arduino Ethernet Shield (called "Ethernet Shield") have the [WIZnet W5100](http://www.wiznet.co.kr/Sub_Modules/en/product/Product_Detail.asp?cate1=5&cate2=7&cate3=26&pid=1011) controller - and only the version with W5100 is oficially supported by the Arduino standard library. There is a library called [etherShield](http://www.nuelectronics.com/download/projects/etherShield.zip) but it is very hard to use (you need to manage ARP and TCP packets in the "application layer"). So, I decided to write a new socket.c (based on etherShield's code) that exposes the same API the standard Ethernet Shield library exposes. The goal of the project will be achieved as an Arduino user can use the same code for both Ethernet controllers (W5100 and ENC28J60). With this project I can also identify architectural problems in the standard Ethernet library implementation and make it better.

Arduino with etherShield (based on Microchip ENC28J60 Ethernet controller)
Usage ===== [Download the tarball at GitHub](https://github.com/turicas/Ethernet_ENC28J60/tarball/master) and put the library inside `sketchbook/libraries/` folder. If you just want to test without debugging, use the examples `WebServerSimple` and `WebServerSimpleLED`. **WARNING:** This is a work-in-progress project and need more tests to be used in production environments! Using with Arduino Mega ----------------------- This library is compatible with Arduino Mega, but **you need a hardware-hack** so ENC28J60 can communicate (using SPI) with Arduino. Please refer to for more information. Limitations =========== For now that are some limitations that will be removed in a near future: - Just one socket per time; - Only support for TCP server -- `connect()`, `sendto()` and `recvfrom()` don't work yet; - Can only "answer" to the last packet received. Architecture ============ WIZnet W5100 Library -------------------- In the standard Ethernet library, the Ethernet, Server and Client classes use the socket API to send and received data over the network. The socket library uses the "driver", (w5100 library) to communicate with the controller. Something like this: `{Ethernet.cpp, Server.cpp, Client.cpp}` ↔ `socket.c` ↔ `w5100.c` Microchip ENC28J60 Library -------------------------- In my implementation I have another layer: ip_arp_udp_tcp. This is a kind-of socket layer (it is really not a socket layer since it doesn't provide a kind of socket API -- merely we have here a lot of helper functions to read, identify, create and send packets using the "driver" enc28j60). For now, we have this: `{Ethernet.cpp, Server.cpp, Client.cpp}` ↔ `socket.c` ↔ `ip_arp_udp_tcp.c` ↔ `enc28j60.c` In a near future I want to replace all ip_arp_udp_tcp layer in the socket layer, so the architecture will be more like the standard Ethernet library: `{Ethernet.cpp, Server.cpp, Client.cpp}` ↔ `socket.c` ↔ `enc28j60.c` When this goal is reached we can create a single socket.c that communicate with one or another controller (W5100 or ENC28J60). Next Goals ========== - Finish implementation of `connect()` - Modify `send()` to acomplish TCP client sockets - Implement `sendto()` and `recvfrom()` - Support for multiple sockets - Put all the features of `ip_arp_udp_tcp.c` in `socket.c` (and then removes `ip_arp_udp_tcp.*`) How To Debug ============ If do you want to test and modify this library, probably you will want also to enable debugging. You can see what is happening using the Serial Monitor on Arduino IDE if you uncomment the line below in the file `utility/socket.h`: //#define ETHERSHIELD_DEBUG Please use the examples `WebServerDEBUG` and `WebClientDEBUG` for debugging (and to learn how to do it).

近期下载者

相关文件


收藏者