Looking for advice:
The target board is a custom PCB with an ATMEGA328P. It has the Arduino boot loader installed and a version of the capacitor detect sketch. I am using PB5 pin 17 SCK as the output. The sketch works fine. But the output is activated when board is powered on. This is interpreted in my application as a false capacitance detect event with undesirable consequences. I think the output is being asserted by the boot loader starting up not the sketch code.
Does anyone know if it is the boot loader pulsing SCK on power up and is there a way to stop it doing that?
Otherwise I guess I could try another port pin but would have to hack up my PWB.
[SOLUTION] Since boot loader uses SCK to flash a LED so I used another pin. But it is set as input by boot loader till sketch starts. This caused the pin to be seen as a high so adding a 10K pull down ensures pin stays low till sketch starts and asserts as output. (I did not want to mess with boot loader.)