chipKIT® Development Platform

Inspired by Arduino™

New network library

Created Sat, 07 Jul 2012 13:36:42 +0000 by majenko


Sat, 07 Jul 2012 13:36:42 +0000

I have just spent a week isolated in the mountains of north west Wales. No internet, no mobile phone, just me, my netbook, a PIC32MX795F512L based board (home made), and the IP RFCs.

So what better way to spend my time than to write a complete IP stack for the ENC28J60 chip that is actually usable...?

I took the core ENC28J60 code from the etherShield library for the Arduino, and ripped out all the rubbish. All that is left of that is the actual Ethernet chip control code, and that has been wrapped up into a nice object. To that I have added a completely object based network stack, so that you can actually program something to use the network instead of having to spend 6 months trying to decipher what on earth that etherShield rubbish is trying to do. It really is the most awful piece of crud I have ever laid eyes on.

So yes, I have created my own that is actually understandable. It also works considerably better than that etherShield rubbish as it handles TCP streams properly, and doesn't just fudge single packet based communications.

It's not perfect, not by a long way yet, but it's working (at least for me). There are things I need to do to it to clean it up somewhat, and some bugs that need ironing out, and I haven't had a chance to properly test it yet on a full network (only a crossover cable to my netbook), but I have created a sourceforge project for it.

I could do with people interested to jump on board and contribute, so we can make this the most awesome network stack ever in the history of mankind. Let me know if you want to be a contributor and I'll add you to the project so you can commit.


I'll start documenting it all on the Wiki on the SF project page.

It's quite memory hungry at the moment, but most parameters are tunable (in include/settings.h). The memory usage is one of the main issues I want to address. Trying to allocate new instances of an object using "objtype *newob = new object();" seems to cause my system to lock up - maybe someone can shed some light on that. Because of that pretty much everything is statically allocated, which is wasteful.

So any way, take a gander, try it out, help me fix the bugs and improve it, and who knows, maybe we'll get a nobel prize for it ;)

Jacob Christ

Fri, 13 Jul 2012 05:28:12 +0000

Wow, awesome... If I had more time I would help just to learn. I will however watch with baited breath for updates and news... Please post to this thread when you have news.

Maybe you can join forces with Gene and Keith and what they are working on?