The problem is that we're not "hoping for the best" at all. Turning on and off is what the digital ports do and their rise / fall time is stated to be 3.2nS (typ) for the SPI bus, so you can assume they're all in that range. However, their response is based heavily on load, capacitance, and grounding. If you think about it, the SPI bus, which is just a collection of digital pins that can read and write from a special register, it can run at 10MHz. That's 100nS for the whole period of writing a bit. Therefore the rise / fall time needs to be at most 50nS each.
Given that we can assume they should be able to switch in under 50nS. Unfortunately, this is several orders of magnitude smaller than the Arduino can time. Even your pin with its extremely low speed switch might not be able to be timed. It could probably be detected with code something like this:
<pre class="ip-ubbcode-code-pre">
const unsigned char OUT = 4;
const unsigned char IN = 5;
void setup()
{
Serial.begin(9600);
pinMode(OUT, OUTPUT);
digitalWrite(OUT, LOW);
pinMode(IN, INPUT);
}
void loop()
{
delay(1000);
digitalWrite(OUT, HIGH);
if (digitalRead(IN))
Serial.print("HIGH: OK, ");
else
Serial.print("HIGH: FAIL, ");
digitalWrite(OUT, LOW);
if (digitalRead(IN))
Serial.println("LOW: FAIL");
else
Serial.println("LOW: OK");
}
</pre>
I haven't tested that except for compilation.
But the point is that digital pins turn on and off. That's their job, and they are designed to do it on the order of a handful of nanoseconds. If they're not, then there's something wrong either with the chip or the circuit. I wonder if there's something about the schematic that isn't right?