Interfacing with the ENC28J60

I'm in the process of seeing what I can do with µIP, it seems to have better checksum handling at least. And I wouldn't mind switching as µIP has a much better stack and properly support tcp.

EDIT: Doesn't seem like such a good idea. uIP is a little too feature complete for a mega168. And I won't even talk about OpenTCP. Looks like I'm going to stick with AVRLib.

The code is now under version control using SVN. You can checkout a copy at svn+http://svn.mlalonde.net/Ethduino or browse the repository on the Trac site. Packets are still not getting received by applications, but they are getting sent (i can tcpdump them). As far as I can see, the checksum is definitely to blame. If anyone has an idea about this I'd really like to ear. As for running on the Mega168, so far so good... there's a good 6~8k free without all the debugging stuff which laves enough room for some business logic. (there's still definitely more things that could be done to reduce code size even further)

I sorry if this post is rather dry when it should be rather high, but I don't have anything to show (I don't have LCD at hand to do the ethernet LCD or something). But here it is...

I have the honour to present you the very first ping replies!

PING 192.168.0.126 (192.168.0.126) from 192.168.0.12: 56 data bytes
64 bytes from 192.168.0.126: icmp_seq=0 ttl=64 time=1.341 ms
[...]
64 bytes from 192.168.0.126: icmp_seq=4 ttl=64 time=1.245 ms

--- 192.168.0.126 ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max/stddev = 1.235/1.283/1.341/0.039 ms

I've written functions to allow using the ENC's internal checksum functions. And it worked! This is an issue however because as noted in the errata #15, use of the DMA for checksuming can cause drop packets. I guess for some this would be fine; it has the added advantage of having a zero footprint in the stack! Either ways this is a huge step as it confirms that the hardware is up and running and that most of the software runs fine!

There are no words to explain my joy! ;D ;D ;D

now that's sounding nice.
this is the beginning of a new chapter in arduino's history :smiley:

congratulations, i hope it will not take too long for a little http functionality.

best, kuk_

Congratulations! I hope you plan to share your hard work and success with the rest of us by posting a schematic and some code. :slight_smile:

I don't recall what your final application is? You're probably quite close to a working serial proxy app right now; a TCP connection (to allow HTTP) may be a bit more work...

-j

Kuk: at this stage there is no plan for TCP support. The mega168 is small and TCP processing is heavy. I'm not saying it won't come but there are other priorities. Just like kg4wsv was saying were closer from an EthProxy than anything... I will post details (schematic, doc, etc) very soon. Meanwhile, the code is available above.

And finally, in pictures ^-^


(Click for full flickr experience)

There's a lot more info, access to code and bug listing on the trac site.
There's still a lot of documentation work to be done, but it'll come!

Hi,
after reading along, I'd like to try the Ethuino, too.
Do you think I could start with this module here :

Eberhard

Great !
I just saw there were someone playing with an Ethduino... Seems that I know this guy !
I can't wait to try this at home.

http://www.makezine.com/blog/archive/2007/09/ethduino.html

It does look like you do :stuck_out_tongue:

How does a shield sounds like? I'm trying to see if it'd be worth setting up a kit... let me know what you guys think!

A shield sounds good, but IMO it would need to be "stackable" or otherwise expandable. An ethernet Arduino is cool and all, but what will you do with it? I'd interface sensors or buttons or an LCD or something, and that something needs a place to be attached.

It would be nice to be able to get a little kit that had the "magnetics" in it.

This does sound a lot like the device from Olimex that was mentioned previously (although their price of US$34 sounds a bit steep to me).

just my $0.02.

-j

I think atmega168 is too small for having tcp/ip stack + http... if you can fit it, there will be no room available for anything else. Why don't you put the whole tcp/ip stack outside of arduino? You can add a PIC MCU next to the ENC chip and use the free tcp/ip implementation by microchip (includes http). Or use Wiznet TCP/IP on hardware chip (TCP/IP + Ethernet) and implement only HTTP in Arduino, using SPI.

An Arduino web server shield could be very useful, to verify pin status, interface with Arduino, control an Arduino remotely, etc etc etc

An Arduino web server shield could be very useful, to verify pin status, interface with Arduino, control an Arduino remotely, etc etc etc

Yip, very very very & very, useful

I'm waiting for the WizNet eval board as we speak... We'll see what happens :wink:

hello all. i m new to enc28j60 and i want to know the difference b/w
enc28j60/sp and enc28j60-i/sp.

this is microchip link where they have displayed the ics
http://sample.microchip.com/Default.aspx?testCookies=true

nomi, That link was to your samples shopping cart, not the datasheet. The web page for info on the enc28j60 is here: http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en022889

SP is the skinny plastic DIP package. i/sp is the industrial temperature version of the chip ( -40degrees c verses 0 degrees). The datasheet has the specifics.

i know that link was for sample shopping cart. i just attached so that ppl can see diff types of enc28j60 ics and can answer to my question propelry. i still cant understand ur answer can u explain a bit further.
i need to interface ATmega 88 with enc28j60. can i use any of them i.e sp or -i/sp. is there any other major diffence except the temp.

Hi all!!
I have too a Enc 28J60 and my Arduino.
Now what i want to do is this, some basic parts of the library are missing.
DHCP and DNS-Query are basic for a Outgoing connection.

We can use fixed IP, but we must know the gateway IP and the DNS ip, in the most common cases both are the same, this is the network router IP.

So, what i found to do this, a Microchip .C libraries, this are wrote in C come so it must work with some small changes at Arduino.

We can found here several examples of DHCP and DNS:

http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1824&appnote=en011993

DNS is easy, the only thing that we need is a UDP client and a DNS-query format packet. Send this query to the DNS server in the router at the 53 port and the response will be the internet ip. :o

So who want to loose some hair with me? ;D

Best Regards
Frank