Old Style Ethershield SD slot

Hi all,

It seems there's some new style ethershields around that can use the SD slot by setting pin 10 as an output and setting it high to temporarily disable the spi interface of the wiz5100, enabling the use of the SD slot.

There are a hell of a large number of the 'old' style ethershields out there, mine included where it's just 'not supported'.

I've been trying to track down some reliable information on how to get the SD slot available, but not had any luck. I'm not great on the electronics side of things, and I don't want to kill anything through trial and error!

I've doen a fair bit of googling, but i just can't find a good source of info (or i'm just googling in the wrong direction...)

So can anyone give me advice, or point me in the right direction to some articles on getting the old style ethershields to give access to the SD slot?

OK, so i've beendoing some digging at been looking for some solid info, and below are some links to some great pages on the subject, but i'm having a hard time fully understanding a few things.

Wiznet have a blog at WIZnet Hong Kong: SPI Guide which states that you can use an inverter to enable the spi select option, but doesn't show how to implement. i'm sure it's not too difficult, but i'm an electronics newbie, so....

I found this blog entry, where a guy has got it working. see MISO and Arduino Ethernet Shields « John's Ramblings.

He shows that using an inverter it certainly can be done, but also quotes Wiznet's application notes, stating:

Basically, multiple SPI slave usage is the same as single SPI slave usage. One difference between other SPI slave devices compared to the W5100 is that the MISO output is continuously driven in the W5100 whether the /SCS is asserted as high or as low. As well, when the 5100 /SCS is asserted as high when using multiple slaves, other SPI devices cannot be read or written by the SPI master on the SPI BUS simultaneously. These problems will continue unless the recommendations listed below are followed.
Recommendations:
- When accessing another device on the SPI BUS rather than the W5100, assert the SEN pin in the W5100 as low first, then access the other devices.
- When accessing the W5100, the SEN pin should be high.
?
The W5100?s SEN signal is input from the /SCS through the inverter. If you don?t want to use the inverter, you can control each signal through the I/O port of the MCU.

This suggests that it should be possible to use the arduino to turn the SEN on and off, but doesn't really give any further detail!

Now i know this article shows a method of fixing the issue, but it seems a bit of a hack, some of which seems pretty delicate to perform, when it's potentially possible to manage it through the arduino digital i/o pins.

I've taken a look at the schematics for the board at http://www.dfrobot.com/wiki/images/5/52/Ethernet_shield_SCH.png in the hope it would shed some light in the situation, and it seems to me that the PROG jumper, which currently doesn't have any pins but could be easily soldered to have them looks like it should play some part, as it seems to be connected to the SEN pin, but at this point i'm starting to loose myself!!!

Any thoughts that anyone might have would be extremely welcome!

First of all, you can fix the old-style Ethernet shields so that the Ethernet chip doesn't interfere with use of SPI port devices on other shields. (Or with things like the adafruit "MicroSD card breakout board" riding on a prototype shield of some type. I have tested that and it works a treat with 8 GByte SDHC cards using the SdFat library)

However...

Regardless of what certain blogs and other "helpful" web pages tell you, it is not safe to use the SD connector on the old Ethernet shield with Arduino boards like the Duemilanove without some non-trivial surgery.

Other than the fact that the SD interface does not use SPI (that can be changed by a few cuts and jumps), the big deal for me is that the 5 Volt Arduino bus signals are applied directly to the SD card connector. SD cards are simply not rated for 5 Volt operation, and I would not recommend trying to use them that way. (If you have some kind of Arduino spin-off that is running on 3.3 Volts, it might be worth a try to see if a couple of cut/jump mods can make the SD card work, but I don't have any kind of beast like that, so I couldn't say whether it's worth it.)

Anyhow, to be able to use the Ethernet Shield with other SPI devices, hare's the deal:

On the Wiznet site http://www.wiznet.co.kr/en/, there is an errata sheet and an application note that shows a way to work around the W5100 SPI bug. (Attention Wiznet wonks: It's a real bug, worthy of an errata sheet, not a feature to be described in an app note type of document.) You can refer to the schematic of the latest Ethernet shield to see how it is done on the new version.

For the old version of the Ethernet Shield. you don't have to change anything in the Arduino Ethernet library or your source code that uses that library (or anything else) if you do the following mod on the Ethernet Shield.

Connect the input of a logic inverter to the SPI "SS" signal coming into the Ethernet Shield. Connect the output of the inverter to the "SEN" pin on the '5100. (That's pad number 2 of the "Prog" pads).

Now, when the Ethernet SPI interface is not selected ("SS" is high), the SEN signal on the '5100 is pulled low. This keeps the '5100 from corrupting data on the MISO pin back to the Arduino. The Ethernet library functions do this automatically. You don't have to do anything special with Arduino pin 10.

A single section of a CD4049 or a 74HC4049 hex inverter will do the trick. At least, it does for me. I used a little dab of hot-melt glue to attach a CD4049 DIP chip with its legs in the air (affectionately known as the "dead bug" method of breadboarding) to the underside of the Ethernet Shield. One of the inverters is used as I described above.

Note that I connected the power and ground of the hex inverter chip to Arduino +3.3 Volts (not +5 volts) and GND signals, respectively, and I connected the five unused inverter inputs to GND because you shouldn't leave CMOS inputs floating.

Bottom line: The existing Ethernet library functions take care of wiggling Arduino digital pin 10 (which is used as the Ethernet Chip select). This fix is hardware-only. You don't have to do anything in software. This fix still does not help you use the SD card slot on the old Ethernet shield, but it does let you use other SPI devices.

Regards,

Dave

Dave,

Well thats exactly the type of answer i was looking for!!!

OK, so the hardware fix for the '5100 SPI problem looks fairly straight forward so i think i'll get that sorted.

Also it is good to know the 5v problem with the sd interface! I agree that it's best not to put that kind of voltage directly in to an SD card, shame there's no way of butchering in the necessary components...

Purely for information, does anyone know why, if this issue with the SD card slot is so well know, why do manufacturers still put the SD slot on? why not just drop it off the list and save a few pence on the manufacturing cost?

Also, if the '5100 SPI issue is well know, why is it implemented in such a way?

Anyway, thanks for the info, unbelievably helpful!!!

Thanks