I've noticed that if PB5 is turned off, it can be seen to blink very briefly when power drops due to either USB disconnection or barrel jack disconnection.
Why does this happen?
Is it something to related to power flow out of the chip as it powers down, or is the Arduino resetting just a bit due to the power drop (blinking is the first thing it does on boot after all :)?
Ok having found the correct Uno Rev3 schematic and experimented a bit more it's clear that the led is driven when PB5 is set as an input (tri-stated), presumably because the LMV358 that drives the LED in that situation.
The question is still somewhat the same though: is PB5 getting tri-stated on power-drop, or does the Arduino tend to restart once on it's way down (so to speak). I think the latter is unlikely because in one case I'm controlling Arduino power with a FET which I think should turn off pretty fast. And the mechanical switch can be fast too. But still I wonder.
Also I don't understand the Uno rev3 schematic (https://www.arduino.cc/en/uploads/Main/Arduino_Uno_Rev3-schematic.pdf) entirely near the LMV358 that drives the LED. It seems to show something like 'L13' at the op amp output, but I didn't find any
other signals with that name on the schematic. Is there anything connected there, or is the amp just being used as a buffer?
The Opamp is used as a buffer to drive the LED so if an external source is driving the pin it does not have to drive a current limit resistor and LED such as used on the Duemilanove and other older designs, just the two 1uA inputs (PB5 and the opamp).
When the Uno is reset, PB5 becomes an Input and the pin floats - the level may be high enough to trip the opamp circuit and drive the LED on.