Electronic – arduino – What do I need to do to use a R3 Ethernet shield with a R3 Arduino Mega 2560

arduinoethernet

I want to use my newly bought Ethernet shield without making any hardware changes, buying anything, and (preferably) add no extra jumper wires. However, it doesn't connect to pins 50, 51, and 52 on the Mega like it says it uses here. Pin 53 has to be kept a output.

I have already looked at this page from this question, but Arduino claims Rev 3 is Mega Compatible. I doubt I would have to modify the board to get this to work. However, the new board has a header to connect to the ICSP that the old one doesn't. Does the ICSP header connect to those pins?


So what I'm assuming:

  • I don't have to modify any hardware
  • I can use all the pins except:

    a.) The enable/disable pins (4 and 10 which I write one HIGH when I want to use it and make sure the other one is LOW).

    b.) 51, 52, and 53

    c.) 53 I can only use as an output, but I can still use it for anything that needs a output.

Best Answer

http://arduino.cc/en/Hacking/PinMapping2560

  • digitalPin 50 = MISO;
  • digitalPin 51 = MOSI;
  • digitalPin 52 = SCK;
  • digitalPin 53 = SS.

The signals on the right in that table are required for your Ethernet shield to work and they happen to be routed to different pins than on an Uno. Some pins on the microcontroller have more than one function, and that is what is happening here. You can find the same signals on the 6-pin ISP header, so if the Ethernet shield attaches to that 6 pin ISP header too, it should work without hardware modifications.

$$ \begin{array}{|c|c|c|c|c|c} \text{Uno} & \text{Mega} & \text{Name} & \text{ISP Pin} & \text{ISP pin} & \text{Name} & \text{Mega} & \text{Uno} \\ \hline \text{d12}&\text{d50}&\text{MISO}&1&2&\text{V}_{CC}&\text{V}_{CC}&\text{V}_{CC}\\ \hline \text{d13}&\text{d52}&\text{SCK}&3&4&\text{MOSI}&\text{d51}&\text{d11}\\ \hline \overline{\text{RESET}}&\overline{\text{RESET}}&\overline{\text{RESET}}&5&6&\text{GND}&\text{GND}&\text{GND}\\ \hline \end{array} $$