Go Down

Topic: Implementation for Microchip ENC28J60 Ethernet controller (Read 36764 times) previous topic - next topic

WillR

#30
Apr 01, 2011, 03:50 am Last Edit: Apr 01, 2011, 03:52 am by WillR Reason: 1
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.
Just another Hacker

alvarojusten


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.


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.


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).


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.
Blog pt_BR: http://blog.justen.eng.br/
Curso de Arduino (Arduino Course, in Brazil) - http://www.CursoDeArduino.com.br/

WillR

Thank you for the helpful answers.

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

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
Mercadillo electrónico. Kit iniciación a Arduino, shield LCD a color y más cosas!

alvarojusten


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:

Code: [Select]

#define ENC28J60_CONTROL_CS     10
#define SPI_MOSI                11
#define SPI_MISO                12
#define SPI_SCK                 13
Blog pt_BR: http://blog.justen.eng.br/
Curso de Arduino (Arduino Course, in Brazil) - http://www.CursoDeArduino.com.br/

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.

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.
Mercadillo electrónico. Kit iniciación a Arduino, shield LCD a color y más cosas!

alvarojusten


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.


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.
Blog pt_BR: http://blog.justen.eng.br/
Curso de Arduino (Arduino Course, in Brazil) - http://www.CursoDeArduino.com.br/

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.

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
Mercadillo electrónico. Kit iniciación a Arduino, shield LCD a color y más cosas!

alvarojusten


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.


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: https://github.com/turicas/Ethernet_ENC28J60/blob/master/resources/resources.markdown
Blog pt_BR: http://blog.justen.eng.br/
Curso de Arduino (Arduino Course, in Brazil) - http://www.CursoDeArduino.com.br/

WEBAFF

#39
Apr 07, 2011, 02:49 pm Last Edit: Apr 07, 2011, 02:53 pm by WEBAFF Reason: 1
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 :)

Regars.

alvarojusten


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.
Blog pt_BR: http://blog.justen.eng.br/
Curso de Arduino (Arduino Course, in Brazil) - http://www.CursoDeArduino.com.br/

megouri

Server side works great !

Can you tell when client side will be ready ?

Thanks

rafaelgimenes

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

westfw

Quote
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.

alvarojusten


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. :)
I'm now implementing TCP three-way handshake for TCP client connections but don't know yet when it'll be done.
Blog pt_BR: http://blog.justen.eng.br/
Curso de Arduino (Arduino Course, in Brazil) - http://www.CursoDeArduino.com.br/

Go Up