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.
2 Answers 2
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} $$
-
\$\begingroup\$ So no hardware changes since it connects to the 6 pin header? Am I right about pin 53 and pins 4 and 10? \$\endgroup\$Anonymous Penguin– Anonymous Penguin2013年04月20日 19:31:14 +00:00Commented Apr 20, 2013 at 19:31
-
\$\begingroup\$ If there is a connector that attaches to Mega's ISP header, it should just work as is. \$\endgroup\$jippie– jippie2013年04月20日 19:45:50 +00:00Commented Apr 20, 2013 at 19:45
Pin 53, on the Mega, is the Hardware SS pin for SPI. As the page explains, it must be kept as an output for the Hardware SPI to work. And trying to use the Pin will interfere with operation. The Ethernet shield does not use Pin 53, but Pin 53 cannot be used for anything other than a SPI select pin, when using SPI. It must be left as an output.
As for the R3 or newer shield itself, all SPI is done through the ICSP header. The shield does not route Pins 11-13 from the headers at all. The pins are not connected to anything at the headers, they are pass throughs only. Only Pin 10 and 4 are used on the outside headers of the shield.