Implementation for Microchip ENC28J60 Ethernet controller

Where could I find magjacks? Seems to be out of stock in sparkfun, and I don't know any similar products.

Of course other solutions are possible, but I don't have experince with the interfacing of the ethernet.

Cheers,
Kari

I am using a module from MDFly.com for $16.95: http://www.mdfly.com/index.php?main_page=product_info&cPath=9_41&products_id=109

It's out of stock now, but they seem to also have this... http://www.mdfly.com/index.php?main_page=product_info&cPath=9_41&products_id=484

There are boards in eBay from 12$ shipping included

I'm looking for this: RJ45 Ethernet MagJack-Compatible - PRT-08534 - SparkFun Electronics

Price also matters...

Cheers,
Kari

Hey, this sounds great! I'll give it whirl and let you know! I've had troubles in the past with the ENC based shields, but just recently posted an apology to those shields... :slight_smile:

G.

Is the software currently working with the Standard Ethershield? (W5100)

Assuming it is... Does UDP work?

Is it more reliable than the W5100?

Is the reliability of the W5100 a software issue? In that case does this library fix that problem?

Is the ENC28J60 a better shield than the standard W5100 board?
Note: I use the Mega2560 board. The ethershield is the new one with the MicroSD card.

WillR:
Is the software currently working with the Standard Ethershield? (W5100)

My implementation does not support W5100, however, in the future (when I finish the implementation for ENC28J60), I can add some #ifdef so the library can be compiled based on the controller you are using - if do you use W5100, it'll compile the standard library or if you use ENC28J60, it'll use my library.

WillR:
Assuming it is... Does UDP work?

The standard library (which work with W5100) supports UDP. My library (which work with ENC28J60) does not support UDP yet - but I'm planning to do it in next weeks.

WillR:
Is it more reliable than the W5100?

Is the reliability of the W5100 a software issue? In that case does this library fix that problem?

As I don't know so much about W5100 internally, I can't answer to you. But my implementations consumes more memory than W5100's implementation, since ENC28J60 does only Ethernet layer and W5100 implements up to socket layer (so my library needs to "work" more than standard library).

WillR:
Is the ENC28J60 a better shield than the standard W5100 board?
Note: I use the Mega2560 board. The ethershield is the new one with the MicroSD card.

The ENC28J60 shield is unexpensive compared to W5100 (~50% of the cost), so I think even you are using more memory, it is good since you can pay less for have an Ethernet connection in your Arduino. In terms of performance, probably it is slower than W5100, since the TCP/IP stack is implemented in hardware in W5100 and is being implemented (I'm implementing) in software in ENC28J60.

Thank you for the helpful answers.

I guess I will have to stick with the "Official" Ethernet shield.

Does anyone know what is the function of the D2 connection on the shield? It is connected to the ICP1 pin, but I can't find an explanation in the code why it has to be connected.

I would like to change the pin, as the mega board doesn't have the ICP1 pin accessible

chiva:
Does anyone know what is the function of the D2 connection on the shield? It is connected to the ICP1 pin, but I can't find an explanation in the code why it has to be connected.

I would like to change the pin, as the mega board doesn't have the ICP1 pin accessible

I really don't know. For me it just uses SPI pins:

#define ENC28J60_CONTROL_CS     10
#define SPI_MOSI                11
#define SPI_MISO                12
#define SPI_SCK                 13

Knowing that D2 isn't used in the libraries, that makes it pretty easy to add compatibility with Mega boards, and in fact I have already sent the code to alvarojusten and should be added soon to the libraries.

Also, Sure electronics's ENC28J60 based ethernet board is also compatible with the libraries as expected, but couldn't find any information about that before buying it.

chiva:
Knowing that D2 isn't used in the libraries, that makes it pretty easy to add compatibility with Mega boards, and in fact I have already sent the code to alvarojusten and should be added soon to the libraries.

I accepted your pull request. Now supporting Mega! Thanks.

chiva:
Also, Sure electronics's ENC28J60 based ethernet board is also compatible with the libraries as expected, but couldn't find any information about that before buying it.

I'll contact them later.

Oh! I forgot, the mega compatibility has the same issue, with shields that do not get SPI signals from the ICSP header, than the old ethernet shield, you have to bend the pins and connect cables to the SPI pins of the Mega board.

http://mcukits.com/2009/04/06/arduino-ethernet-shield-mega-hack/

This should be indicated in the readme, so the newcomers are warned, as the famous nuelectronics shield has this issue, in fact, all the shields listed in the reosurce file have this issue.

Also, in the resource file there is a link to http://blog.thiseldo.co.uk/?p=344 , but he has already released a newer one v1.6, http://blog.thiseldo.co.uk/?p=504

chiva:
Oh! I forgot, the mega compatibility has the same issue, with shields that do not get SPI signals from the ICSP header, than the old ethernet shield, you have to bend the pins and connect cables to the SPI pins of the Mega board.

http://mcukits.com/2009/04/06/arduino-ethernet-shield-mega-hack/

This should be indicated in the readme, so the newcomers are warned, as the famous nuelectronics shield has this issue, in fact, all the shields listed in the reosurce file have this issue.

Ok, it's on "Usage" section on README.markdown now. Thanks.

chiva:
Also, in the resource file there is a link to http://blog.thiseldo.co.uk/?p=344 , but he has already released a newer one v1.6, http://blog.thiseldo.co.uk/?p=504

It had link to all those posts. Now it is organized and you can read using GitHub's markdown converter: Ethernet_ENC28J60/resources.markdown at master · turicas/Ethernet_ENC28J60 · GitHub

Hello, alvarojusten!

This is great idea to make ENC28J60 - W5100 compatible library!

I spent a lot of time with "official" ENC28J60 lib, yes it works, but any changes or any code writing are kinda hell.

But accidentally, I found another realization of the library:

http://jeelabs.net/projects/cafe/repository/entry/EtherCard

EtherCard based on official ENC lib, but there are a lot rewritten code, DNS realization, cool http server, new tcp-ip stack & etc.

For compatibility with Arduino you must change

#define ENC28J60_CONTROL_CS 8
to
#define ENC28J60_CONTROL_CS 10
at enc28j60.cpp

at least for me it worked.

This lib works not 100% stable, but it pretty simple than original lib.

I hope it can help you or others.

Please continue to develop your library, we all really need for it :slight_smile:

Regars.

WEBAFF:
But accidentally, I found another realization of the library:

http://jeelabs.net/projects/cafe/repository/entry/EtherCard

EtherCard based on official ENC lib, but there are a lot rewritten code, DNS realization, cool http server, new tcp-ip stack & etc.

Nice! I added this library to resources/resources.txt in my repository, thanks.
I saw the code and it still needs improvements since it consists only in helper functions (like the original libraries, but EtherCard is easier to use) - it is not a socket layer and is not compatible with Ethernet.h code. But perhaps I can use some code this guy used (like DNS query) to improve my library.

Server side works great !

Can you tell when client side will be ready ?

Thanks

Hi Alvaro.
I'm from brazil too.
It's a good implementation, your interface is clean equal the oficial etherShield.

what is the function of the D2 connection on the shield?

Allows you to catch interrupts from the network. D2 is one of the pins that can use "AttachInterrupt()"
It appears to require bridging a small jumper/solderbridge connection before it is actually connected.

megouri:
Server side works great !

Can you tell when client side will be ready ?

Server side has a lot of limitations, but work in some simple cases. :slight_smile:
I'm now implementing TCP three-way handshake for TCP client connections but don't know yet when it'll be done.