Shields with no identification - What determines the I/Opins used by the shield?

I can see now how one of the pit-falls to buying cheap shields off of ebay is that you never really know what you're gonna get. I have a number of Data Logger shields like that.

The seller supplies no schematics and there is no identifying marks on the shield.

Jonathan Oxer (Australia) at one time tried to create a database of all arduino shields but the project apparently came to an end in 2013 because it appears he was simply overwhelmed by the vast number of shields coming out. http://shieldlist.org

So, anyway all my Data Logger shields work (I was able to test them) so maybe there's just a standardized set of pins they all use? I'm not sure. The ONLY way I know what pins they use is by looking in the sketch to see what pins are assigned in the sketch. Does that mean I could assign the pins on the shield to the Arduino any way I like and it would still work?

Do ALL shields use certain pins? Can you change the assignment of the pins used by a shield?
When you plug a shield into an Arduino board (Let's use an UNO for this example), are the pins hard coded by the shield or does the sketch uploaded to the Arduino board determine which pins are used?

I guess for some reason I though shields (Like Arduino boards) have pins pre assigned....and some do.....like the power and ground pins....they HAVE to be the same as the Arduino of course. But what about all the input output pins?

Obviously once you plug a shield into the Arduino they are "Pin for Pin", but still, is it only the sketch that determines which pins the shield (in this case the Data Logger Shield) will use?

Thanks

Here, for example is the beginning of the sketch in question for the Data Logger Shield…

/*
  SD card datalogger

 This example shows how to log data from three analog sensors
 to an SD card using the SD library.

 The circuit:
 * analog sensors on analog ins 0, 1, and 2
 * SD card attached to SPI bus as follows:
 ** MOSI - pin 11
 ** MISO - pin 12
 ** CLK - pin 13
 ** CS - pin 4 (for MKRZero SD: SDCARD_SS_PIN)

 created  24 Nov 2010
 modified 9 Apr 2012
 by Tom Igoe

 This example code is in the public domain.

 */

#include <SPI.h>
#include <SD.h>

const int chipSelect = 10;

So here we see that 5 pins are involved…
MOSI - pin 11
MISO - pin 12
CLK - pin 13
CS - pin 10 (for MKRZero SD: SDCARD_SS_PIN)

But all except 10 seem to be part of the Library. So, what would happen if I changed the library to utilize different pins? Would that work or are pins 11,12 and 13 mandatory and if so, why?

Ok,
Here's part of what I was forgetting.....

quamikazee:
I can see now how one of the pit-falls to buying cheap shields off of ebay is that you never really know what you’re gonna get. I have a number of Data Logger shields like that.
The seller supplies no schematics and there is no identifying marks on the shield.

You do then wonder why people buy them.

You could use a magnifying glass and look at the circuit traces to help determine what is connected ...

Would that work or are pins 11,12 and 13 mandatory and if so, why?

Yes they are mandatory because those are the pins that connect to the chip’s internal hardware SPI circuits. You can not change them unless you are willing to bit bang the SPI protocol on the other pins.

Grumpy_Mike:
Yes they are mandatory because those are the pins that connect to the chip’s internal hardware SPI circuits. You can not change them unless you are willing to bit bang the SPI protocol on the other pins.

Grumpy_Mike:
Yes they are mandatory because those are the pins that connect to the chip’s internal hardware SPI circuits. You can not change them unless you are willing to bit bang the SPI protocol on the other pins.

Yes…after that initial post, then looking at the illustration above…I was reminded of that…a day late and a dollar short

ChrisTenone:
You could use a magnifying glass and look at the circuit traces to help determine what is connected ...

and/or a DMM

srnet:
You do then wonder why people buy them.

For the most part, I've had good luck with all the ebay purchases. Sometimes, like in this case, things might be different. I'm still in the experimental / learning (at the bottom level) stages.

When I learn enough to program and make mission critical devices and sensors those will most likely be powered by official versions of sensors, micro-controllers etc.

I hope that's a reasonable approach.