7
\$\begingroup\$

When I run this code on my W5100 Ethernet Shield:

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };  

void setup() {
  Ethernet.begin(mac);
}

it only works when the SD Card was removed from the shield!


It took me days to find this error. With SD Card installed only the full begin setup works:

Ethernet.begin(mac, ip, dns, gateway, subnet); 

The official documentation of Ethernet.begin() says nothing about this problem. Why does it only fully work with SD Card removed? Is this a "documentation bug"?

\$\endgroup\$
  • \$\begingroup\$ What version of the shield do you have? \$\endgroup\$ – Kevin Mark Apr 16 '13 at 19:31
  • \$\begingroup\$ If you found an answer you should post it @powtac, not put it in your question. Instead make an answer to your own question. \$\endgroup\$ – Kortuk Apr 16 '13 at 22:22
  • 1
    \$\begingroup\$ @Kortuk He's looking for where it's documented / why it happens, not a workaround. \$\endgroup\$ – Polar Apr 17 '13 at 0:20
  • \$\begingroup\$ What operating system are you using, @powtac? \$\endgroup\$ – taco Apr 17 '13 at 3:17
  • \$\begingroup\$ @taco I'm using Win7 64 with Arduino IDE 1.0.4 \$\endgroup\$ – powtac Apr 17 '13 at 6:57
7
\$\begingroup\$

According to the Arduino Ethernet Shield page:

Note that because the W5100 and SD card share the SPI bus, only one can be active at a time. If you are using both peripherals in your program, this should be taken care of by the corresponding libraries. If you're not using one of the peripherals in your program, however, you'll need to explicitly deselect it. To do this with the SD card, set pin 4 as an output and write a high to it. For the W5100, set digital pin 10 as a high output.

And if you're using the first version of the board:

The original revision of the shield contained a full-size SD card slot; this is not supported.

\$\endgroup\$
  • \$\begingroup\$ So, to use both, you have to change the status of pins 4 and 10 every time you switch? \$\endgroup\$ – Anonymous Penguin Apr 19 '13 at 0:06
  • \$\begingroup\$ It appears so. Although "this should be taken care of by the corresponding libraries" makes me believe that should be done automatically with the built-in libs. \$\endgroup\$ – Kevin Mark Apr 19 '13 at 0:34
3
\$\begingroup\$

You can report bugs with the codebase here (it looks like they moved from Google code to Github).

Based on this report it sounds like a third party added the DHCP support, so I would report the issue to make sure it isn't a bug.

It looks like maybe you are using bad documentation, based on this report.

\$\endgroup\$
-1
\$\begingroup\$

Kevin Mark gave very good answer why your ethernet shield don' work with SD. Here is answer what to do to make it working.

How to avoid SD Card and W1500 SPI mixup on the Ethernet Shield?

\$\endgroup\$
  • 1
    \$\begingroup\$ This more along the lines of a comment and link only answer which is frowned upon here. If you want to contribute, post more information and of course give attribution. \$\endgroup\$ – placeholder Jul 1 '14 at 22:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.