Reply to topic  [ 44 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Ethernet Module (HCARDU0028) 
Author Message

Joined: Sat Nov 10, 2012 6:29 pm
Posts: 2
Post Re: Ethernet Module (HCARDU0028)
I am trying to get the Ethernet module working with the Mega 2560 but without success.

The example given is for a Nano - are the connections different for a Mega?

The module EtherCard.h shows the pinouts are:

// PIN Connections (Using Arduino UNO):
// VCC - 3.3V
// GND - GND
// SCK - Pin 13
// SO - Pin 12
// SI - Pin 11
// CS - Pin 8

SCK, for example, on the Mega is Pin 52

Am I missing something?

Graham


Tue Oct 15, 2013 10:30 pm
Profile
Site Admin

Joined: Sun Aug 05, 2012 4:15 pm
Posts: 620
Post Re: Ethernet Module (HCARDU0028)
Try the pinout as in the comments but with D10 for the CS pin. It looks like it's wrong in the comments. Please let us know if this fixes it and we will correct the sketch.

_________________
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.


Wed Oct 16, 2013 8:36 am
Profile

Joined: Sat Nov 10, 2012 6:29 pm
Posts: 2
Post Re: Ethernet Module (HCARDU0028)
Finally got the Ethernet module working with my Mega 2560 by following guidance from http://en.code-bude.net/2013/06/22/how-to-use-enc28j60-ethernet-shield-with-arduino-mega-2560/

Enc28j60 Arduino Mega 2560
GND -->>GND
3.3 -->> 3.3V
SO -->> Pin50
SI -->> Pin51
SCK -->> Pin52
CS -->> Pin53


EtherCard example code modified as follows:

Code:
if (ether.begin(sizeof Ethernet::buffer, mymac, 53) == 0)
  {
    Serial.println("Failed to access Ethernet controller");
  }
  else
  {
     Serial.println("Ethernet is fine and up");
  }


Sat Oct 19, 2013 7:35 pm
Profile

Joined: Thu Jun 06, 2013 4:20 pm
Posts: 13
Post Re: Ethernet Module (HCARDU0028)
dimplehouse I take it your ethernet socket wasn't damaged from the wrong wiring the sketch came with then?

@Admin / andrew: Sorry my year has been horrible! I've not had chance to even think about replacing my duff arduino and probably won't bother now until another 3 ops are out of the way and i'm working again. I'm going to let you off the hook with m ethernet card and just hope it's ok when i can grab another ardy. If it ain't.. well.. I'll have to find another ether card when the time comes.

Thanks for your help anyway..


Fri Dec 20, 2013 11:53 pm
Profile
Site Admin

Joined: Sun Aug 05, 2012 4:15 pm
Posts: 620
Post Re: Ethernet Module (HCARDU0028)
Well as it is an existing problem reported some time ago, we can keep the return option open.

_________________
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.


Sat Dec 21, 2013 6:33 pm
Profile

Joined: Sat Jan 18, 2014 8:11 pm
Posts: 1
Post Re: Ethernet Module (HCARDU0028)
Anyone using this module with Linux should be aware that the ethercard library throws up a lot of compiler errors when using the arduino package provided in many distros.

The problem is because the ethercard library uses a deprecated method of using progmem variables no longer supported by avr-gcc.
See https://github.com/jcw/ethercard/issues/11


Workaround is to either locate a copy of avr-gcc version 1.6 or older for your distro, or else get arduino from the arduino download page, but then there will be another problem. The version of rxtx included by arduino cannot write lock files. The workaround for that issue is to set chmod 755 on /var/lock


Thu Jan 23, 2014 5:14 pm
Profile

Joined: Thu Dec 04, 2014 9:30 pm
Posts: 10
Post Re: Ethernet Module (HCARDU0028)
Hi,
I got this device working on my Uno instanly but not on my Mega or Nano, so nice to see there is an answer for the Mega, but do you have any idea for the Nano? I am also soon hopefully going to buy a Micro from you, so any idea if this would be the same pins/code as the Nsano?

Anoher quick question, the sample code shows adding test, then the value of an anoloug input, do you know if it is possible to output the contents of a string? As what I would like to do is something like:

buffervalue="This is a Test"

Then output to the web page:

"Sensor string is: ", buffervalue;

I haven't had a chance to do any playing yet, so thought I would ask as you may be able to save me a lot of time.

Thanks in advance for any help that you can give.


Fri Dec 19, 2014 8:35 am
Profile
Site Admin

Joined: Sun Aug 05, 2012 4:15 pm
Posts: 620
Post Re: Ethernet Module (HCARDU0028)
Quote:
I got this device working on my Uno instanly but not on my Mega or Nano, so nice to see there is an answer for the Mega, but do you have any idea for the Nano?


The Nano uses the same microcontroller as an Uno so a Nano is effectively a cut down Uno. The library and sketch should be able to work in its unmodified state and with the same pin connections as the Uno. I would would give your connections to the Nano a double check in case you have a bad or wrong connection.

Quote:
I am also soon hopefully going to buy a Micro from you, so any idea if this would be the same pins/code as the Nsano?


The Pro micro uses different pins for its SPI interface so it is unlikely that the library will work in its unmodified state. Probably for the same reasons as the Mega.

Quote:
Anoher quick question, the sample code shows adding test, then the value of an anoloug input, do you know if it is possible to output the contents of a string?


In the example try using $S instead of $D

You may also want to have a look at the manual here:

http://jeelabs.net/pub/docs/ethercard/index.html

It's a bit complicated for beginners but some of the examples may help.

_________________
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.


Fri Dec 19, 2014 11:09 am
Profile

Joined: Thu Dec 04, 2014 9:30 pm
Posts: 10
Post Re: Ethernet Module (HCARDU0028)
Thanks for that Andrew, I will have a play hopefully over the next few days.


Fri Dec 19, 2014 12:16 pm
Profile

Joined: Thu Dec 11, 2014 7:41 pm
Posts: 6
Post Re: Ethernet Module (HCARDU0028)
Slightly worried now!
I thought I saw a post saying this used the standard library , which I have just about worked out with my current uno shield.
I bought a couple of pro minis and thought adding a small Ethernet module would be an inexpensive way to monitor my door lock over the internet.
It seems, these don't use the standard library , so any help on how to start ,with this module.
I'm fairly new to this, so be gentle :)
My final aim would be to monitor a lock ( micro switch status on or off ) and it would be nice if I could turn my air on on or off ( I have the code for ken sherriff IR library to do the turning on off), just need a sketch to put it in.
Any help would be great thanks


Sat Feb 14, 2015 11:53 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 44 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Thank you to phpBB.com & phpBB.ro.
Design created by Florea Cosmin Ionut.
© 2011 All contents of this site are © Hobby Components LTD