Which I/O pins are available when using shield

I'm looking into using the ethernet shield in a project but am new to arduino, so I'm a little bit lost on figuring out how everything connects.
The ethernet shield seems to make available ALL of the I/O pins, but I have to imagine that at least a few of them are being used for communication between the shield and the arduino board... but how do I know which ones, so that I know what I can no longer use??

I'm trying to hook up some LED matrix displays and the library I'm using uses specific pins (though I could probably change them), so I need to know if I still have enough i/o pins available, and which would need to change, if any.

Also... the image of the ethernet shield on arduino.cc looks a bit different then the one from SparkFun.com... is there any real difference between the two? They both seem to be official, so I'm a bit confused.

but how do I know which ones, so that I know what I can no longer use?

You simply look at the schematic of the shield and see which are being used and which are free.

Remember that the analogue input pins can be used for digital input / output as well.

is there any real difference between the two?

If they are different then they are different, again look at the schematics.

Just looking at the schematic I'd say you only have 4 analogue IPs free, but you can still use them for digital if you want.

Well, crap... I need at least 6-7 IPs free.

Although, on a side note, the shield page here: http://arduino.cc/en/Main/ArduinoEthernetShield

...has 2 schematic PDFs... but doesn't really seem to say which applies.
And while the second one shows 4 analog IPs free (though it also shows pins 1 and 2 on J3 free, I think they are digital pins 0 and 1... can I use those), the first PDF (with 05 in the name) shows 8 digital IPs and 4 analog IPs free. If that's the case for one of them, I'd rather get that since it seems to be using less pins... but I'm not really sure which version of the board that is, and the pictures of the boards I've seen don't really seem to specify.

I think they are digital pins 0 and 1... can I use those)

No those control the serial communications back to the computer.

I need at least 6-7 IPs free.

then use a shift register or port expander and have as many inputs as you want. The MPC23S17 gives you 16 I/O through an SPI interface that you can simply bit bang from any pins.

I looked at the schematic at SF and it has 4 free pins. I suspect the 05 schematic is a newer version of the board. If nobody here knows you'll have to email the Arduino guys.

You can use 0 and 1 but bear in mind that these are used for programming and that may or may not be an issue, it depends on what you need to do with the pins. Best not to.

2 schematic PDFs

The New Ethernet Shield is arduino-ethernet-shield-05-schematic.pdf.

The Old Ethernet Shield is arduino-ethernet-shield-schematic.pdf.

If a vendor does not specifically state that it is a "New" one, it is almost certainly the "Old" one. The "New" version was released (published) by Arduino only a couple of weeks ago.

Here's the deal:

For the Old Shield: It is not compatible with the Arduino Mega board since SPI port signals for the ATmega1280 are on different pins than on the other ATmega chips. Also, due to fundamental design errors, if the Old Shield is plugged into a board that uses 5Volt logic (the Duemilanove, for example) the SD card is not usable without surgical modifications.

Since you won't be plugging in an SD card, all of the signals that you see going to "X1" are not used on the Old Ethernet Shield, so they can be used by other hardware.

Here are the pins that are actually used on the Old Shield:

Digital pin 10 is used as the Ethernet Chip Select.
Digital pins 11, 12 and 13 are the ATmega328 dedicated SPI port pins.

That's all.

For the New Shield:
The dedicated SPI port pins for the ATmega1280-based Arduino Mega board are different than those for the Duemilanove (or other '328-based boards). So, instead of using Digital pins 11, 12, and 13 on the usual header, the new shield gets SPI port signals from the ICSP header. (Clever!)

For '328-based boards, these are Digital Pins 11, 12, and 13. For '1280-based boards these are Digital Pins 50, 51, and 52

On the New Shield, Digital Pin 10 is still used for the Ethernet Chip Select and the SD card chip select is Digital Pin 4.

Bottom line: Four Digital pins are needed for the Old Ethernet Shield. Five are needed for the New Shield if you are going to use the SD card interface. The other pins that you see on the Shield Schematics (Interrupt, Write Protect, Detect) might be used if you want them, but they are not really necessary, and the Shield boards are populated in such a way that, by default, these to not interfere with usage by other hardware.

Regards,

Dave

Footnote:
My statements about the Old Shield are based on experience. I have an Arduino Mega board, but I have not tried to obtain a New Shield to evaluate/test (due to constraints of Time and Money). My statements about the New Shield and the Arduino Mega are based on my interpretation of schematics on the Arduino web site.

@davekw7x
Thank you! Great answer.

That should be a perfect fit for my project then.
One question though... you said the other pins aren't might used, but are not really needed. How do you tell if the board is even using them? Or better yet, is there a way to be sure that they are not in the setup of your program?

other pins ...are not really needed.

The standard Ethernet library doesn't use them.

My statement about 'not interfering' needs a little more explanation.

If you won't be plugging in an SD card, the "Write Protect" and "Detect" signals (Analog Pins 0 and 1) appear to be pulled up by 10K resistors, but nothing on the Ethernet Shield drives them. If you are going to use these signals, particularly as Analog inputs, you may (or may not---it depends on the other circuitry) have to bend those Shield pins out so that they do not make contact when you plug in the Shield. (That will work if the Ethernet Shield is top-most on whatever stack of Shields that you have.) Note that on the Old Shield, you can remove R19 and R20 (they may not even be installed). On the New Shield, these are not individual resistors; they are part of a Resistor Network (multiple resistors in a single package), so bending the pins is probably the least destructive method of getting them out of the circuit (rather than cutting traces on the board).

Typical use of digital inputs might not result in any bad effects from 10K pull-resistors (and, many applications, in fact actually require pull-ups), but if your external circuitry won't tolerate pull-ups on Digital Pins 14 and 15 (these are the same Arduino pins Analog Pins 0 and 1), you may have to bend these pins out for that application also.

The "PD2" signal (Digital pin 2) is not connected to the "INT" pin on the Ethernet controller chip. The standard Ethernet library does not support interrupts. If you want to write your own Ethernet functions that use interrupts, you will have to make a "solder bridge" across the two pads marked "INT" and use Digital Pin 2 for Ethernet Interrupt in your library functions. (So by default it's "no harm-no foul.")

Regards,

Dave