My question is about how to turn on a led before the GPIO pin has been initiated. When the IC has just been powered on and has not yet been initiated the GPIO pins remains in state HI-Z.
In Circuit-1 GPIO-P1 is pulled via a pull up resistor R7 HIGH and the led turns on before initiating the IC. once the IC has been initiated, GPIO -P1 is set to LOW to turn off the led. The problem with this circuit is that if GPIO-P1 is accidentally set to HIGH, it will short the led. (not current limiting resistor)
I believe I can solve this problem via circuit 2 and 3.
In circuit 2 I limmit the current through R2 in case of P1 is accedentially set to HIGH.
In circuit 3 The P mosfet is driven on via R5, lighting up the led, only when GPIO-P1 is set to high does the led turn off.
Out of interest would there be ANY reason at all to choose for circuit 3 over circuit 2? I see none.
simulate this circuit – Schematic created using CircuitLab