Arduino Uno - ICSP Header pins - Needed? Not on the shield I have.

Looking for some clarification on the ICSP for Atmega328 pins. These are the six pins (2x3) on the right side/middle of the board. Opposite the USB connector. I have a shield that does not pass the six pins.

I've researched this a bit and it appears those pins are only used when the Arduino is to be used as a "slave".

Would it be safe to say for almost all Arduino applications the ICSP for Atmega328 pins are not used?

I have two shields: a screw terminal and a W5100. The screw terminal would be in the middle and does not pass the ISCP pins to the W5100.

Does the w5100 need to be connected to the ICSP for Atmega328 pins to function properly?

Thanks

Doug101: I have a shield that does not pass the six pins.

I hate it when they do that.

Doug101: I've researched this a bit and it appears those pins are only used when the Arduino is to be used as a "slave".

Wrong. The ICSP header on your Uno contains pins 11, 12, 13, Reset, 5 V, and Ground. There is no magic to the ICSP pins. It's just the same pins as you find on the female headers, except all broken out in one standardized header.

Doug101: Would it be safe to say for almost all Arduino applications the ICSP for Atmega328 pins are not used?

That is not safe to say. The ICSP header is used by any shield that has a SPI device. The reason the shields use the ICSP header instead of pins 11, 12, 13 is that those are not the SPI pins on the Mega or Leonardo. This is what is means when you see shields advertised as "Mega compatible".

Doug101: Does the w5100 need to be connected to the ICSP for Atmega328 pins to function properly?

The W5100 is an SPI device. All but the oldest or worst designed W5100 shields use the ICSP header for that connection (for the reason I explained above). Usually you will also have an SD card slot on the Ethernet shield and that also uses the ICSP header (SPI is a bus so you can connect multiple devices to it.

Now, it is possible to wire a shield to pins 11, 12, 13, instead of the ICSP header. But the whole point of a shield is that you can just slap it on the Uno and all your connections are made.

My recommendation would be to put the crappy screw shield at the top of the stack. Or you could buy a 2x3 long/"wire wrap"/passthrough header and replace the one on the screw shield.

Please take some time to read this very useful information: https://www.arduino.cc/en/reference/SPI

Thank for the replies, very helpful. So the ICSP pins are electritly pins 11, 12, 13, SS, and power. So the ICSP connector just bundles the pins together for a 2x3 header cable or to make shield stacking easier?

This brings up a few other questions.... It sounds like an Ethernet shield is an ISCP salve. This means I can’t use 11-13 + SS for I/O pins, correct?

Screw term is going on top.

Doug101:
So the ICSP pins are electritly pins 11, 12, 13, SS, and power.

SS is not on the ICSP. the ICSP header is pins 11, 12, 13, Reset, 5 V, and Ground.

Doug101:
So the ICSP connector just bundles the pins together for a 2x3 header cable or to make shield stacking easier?

Correct.

Doug101:
It sounds like an Ethernet shield is an ISCP salve.

The correct term is “SPI”.

Doug101:
This means I can’t use 11-13 + SS for I/O pins, correct?

Correct. CS for the Ethernet controller is pin 10. If your Ethernet shield has an SD card, it uses pin 4 for CS.

Doug101: Thank for the replies, very helpful. So the ICSP pins are electritly pins 11, 12, 13, SS, and power. So the ICSP connector just bundles the pins together for a 2x3 header cable or to make shield stacking easier?

This brings up a few other questions.... It sounds like an Ethernet shield is an ISCP salve. This means I can’t use 11-13 + SS for I/O pins, correct?

Screw term is going on top.

Thank you this has been very helpful.

Just to further clarify.

An Uno has 14 digital I/O pins. If a W5100 Ethernet shield is plugged in I can no longer use pins 10, 11, 12 and 13 as they are being used by the Ethernet SPI. Now if I have the 5100 shield with the SD card I can't use pin 4.

Tell me if I have this right. On the Uno I think I have it. Pins 11 and 12 are for sending/receiving of the data. 13 is the clock. Since these pins can be different on the various models of Arduino boards the ISCP header 2x3 allows for standardization based on ISCP pin types and not the pin numbers.

What I'm not getting is the SPI select? My understanding is pin 10 selects Ethernet, and pin 4 the SD card. So when pin 4 is high pins 11/12 are exchanging data with the SD car. Pin 10 high, with Ethernet. This means 4 and 10 can't be high at the same time? Or Maybe they can if you data is to be sent between Ethernet and SD card.

What's I'm not understanding is the use of the ISCP reset. In this picture it show the reset connected to Pin 10. I thought high on Pin 10 would select, but here it looks like it it's resetting the SPI.

https://www.arduino.cc/en/uploads/Tutorial/ArduinoUNOtoUNO_ISP2.jpg

You're getting ISP programming mixed up with SPI. They use some of the same pins, but they're not the same thing.

"An Uno has 14 digital I/O pins." No, an Uno has 20 digital I/O pins; 6 of them also support analog inputs.

"This means 4 and 10 can't be high at the same time? " That's backwards - you can't have them both Low at the same time.

The referenced picture is for using the Uno as a programmer; the device being programmed needs its Reset line controlled, D10 is used for that.

Now I'm completely confused. I get the pins for clock, sending/receiving data but what pin is used for ISCP shield select or SPI select?

If I have say five shields all attached via ISCP pins. There is no SPI select pin on the header so how does the ISCP data bus know which shield is being communicated with?

The shields use pins from the regular headers on the Arduino board as CS pins. You have to hope that each shield happens to use a different CS pin, or else modify the wiring if they use the same pins. Too often, the shield manufacturers don't even bother to document which pin is used.

The ICSP header provides a standardized connection to the MISO, MOSI, and SCK pins, which the regular headers do not. For the CS pin, that's not really a problem because pin 10, etc. are always in the same place on any board. Even if that pin doesn't have the same properties from one microcontroller to another, it only needs to be able to set HIGH and LOW. It is convenient to use SS for CS, since you are limited in what you can use SS for during SPI communication anyway, but it's not mandatory to use SS for CS.

As I already explained, the Arduino Ethernet shield uses pin 10 for the W5100 CS and pin 4 for the SD card. Most other Ethernet shields follow this convention.

I think I understand what I need to know. Back to my project.