Using the Arduino Ethernet Shield

Hi!

As I understand the Arduino Ethernet Shield when is used with the Ethernet and SPI libraries, due to the SPI library uses the ICSP pins of the Arduino to communicate the Arduino with the W5100 chip and the micro SD card. I am using the Mega2560 R3, therefore, as I understand it, the ICSP pins correspond to the digital pins 10, 11, 12 and 13 of the Arduino. My problem is that I can not connect the Ethernet module directly on the Arduino, since between the Arduino and the Ethernet module I have to place a Prototype Shield (a plate that I have soldered), which prevents the connection of the ICSP pins of the Ethernet module and the Arduino. Therefore, my question is as follows:

Is there any way to configure the communication between the Arduino and the W5100 chip / micro SD card to be established by other pins? For example, I could directly use pins 10, 11, 12 and 13, which, obviously, are free because they can not be used since they correspond to the ICSP pins of the Arduino.

HanRun makes modular connectors with integrated magnetics, commonly found on chinese Ethernet boards of all makes. There are two common "Ethernet Shield" geometries, those using Wiznet chips and those using ENC28J60 chips. Yes, you can hook up either chipset to the Arduino through SPI. But, the two chipsets aren't identical and use different libraries.

But can I use other pins to establish the connection instead of the ICSP pins?

Mega has Mega SPI pins on ICSP header

Juraj:
Mega has Mega SPI pins on ICSP header

I don't understand your answer. Can you be more explicit? TY

Kane12:
As I understand the HanRun Ethernet Module Shield HR911105A 17/02

there is no HanRun shield. HanRun is manufacturer of the RJ-45 connector

Kane12:
when is used with the Ethernet and SPI libraries, due to the SPI library uses the ICSP pins of the Arduino to communicate the Arduino with the W5100 chip and the micro SD card.

Ethernet shield uses the ICSP header for physical SPI connection. the SPI library doesn’t need to know the wiring.

Kane12:
I am using the Mega2560 R3, therefore, as I understand it, the ICSP pins correspond to the digital pins 10, 11, 12 and 13 of the Arduino.

ISCP has SPI pins. on Mega SPI pins are 50, 51, 52. the slave select pin 10 on Uno and 53 on Mega are not on ICSP header

Kane12:
My problem is that I can not connect the Ethernet module directly on the Arduino, since between the Arduino and the Ethernet module I have to place a Prototype Shield (a plate that I have soldered), which prevents the connection of the ICSP pins of the Ethernet module and the Arduino. Therefore, my question is as follows:

Is there any way to configure the communication between the Arduino and the W5100 chip / micro SD card to be established by other pins? For example, I could directly use pins 10, 11, 12 and 13, which, obviously, are free because they can not be used since they correspond to the ICSP pins of the Arduino.

on Mega use Mega SPI pins 50, 51 an 52. if you connect the shield with jumper cables, you can choose the slave select pins on the Mega side, but in code use slave select pin 53 to output, to not to fall into slave mode.

TY for your reply! But my problem is that i can’t connect directly the ICSP header of the arduino with the ICSP header of the Ethernet Shield because I have the soldered plate between them (see the photo. I can’t make this connection).

Juraj:
on Mega use Mega SPI pins 50, 51 an 52. if you connect the shield with jumper cables, you can choose the slave select pins on the Mega side, but in code use slave select pin 53 to output, to not to fall into slave mode.

Kane12:
For example, I could directly use pins 10, 11, 12 and 13, which, obviously, are free because they can not be used since they correspond to the ICSP pins of the Arduino.

SPI is a hardware implementation on the ATmega2560. Only the pins SCK, MISO and MOSI must be the same pins. Multiple devices can connect to the same 3 pins as long as they have a separate SS pin. For example, on the official Arduino Ethernet Shield, the SD card uses one SS while the Ethernet uses another. If you cannot physically make the connections by typical shield fashion, you will need to get some pin jumpers and/or do some bread-boarding to combine shields to share the same pins.

I got it! TY to both of you!

I have another question. If I have to use the SD micro target and the Wiznet chip at the same time I have to set the pin 53 as an output? Why? Remember that I'm using the Mega board! I say it because until today I was setting the pin 10 as an output and everything was working right!

Kane12:
I have another question. If I have to use the SD micro target and the Wiznet chip at the same time I have to set the pin 53 as an output? Why? Remember that I'm using the Mega board! I say it because until today I was setting the pin 10 as an output and everything was working right!

Pin 53 has to be an output if you want to use the official SPI library because that is how the library works. It is easy to make it the SS pin for either ethernet or SD card, since they both need one.

Perehama:
Pin 53 has to be an output if you want to use the official SPI library because that is how the library works. It is easy to make it the SS pin for either ethernet or SD card, since they both need one.

And its value has to be high or low?

Kane12:
And its value has to be high or low?

you can use it as any output for led or relay or...

the SS pin of Atmega {10 on Uno and 53 on Mega} is the slave select pin of SPI circuit slave mode when the Atmega is the slave.
the SPI library switches to slave mode if the Atmega SS pin is input, assuming it will be a slave for some SPI master

Now I understand it all. Therefore, it is only necessary to establish it as an output because in my case the Arduino is the master and the Wiznet chip and SD target are the slaves. TY dude!