G20 as OUTPUT Stamp C3



  • Hi,

    i have the Stap C3 and i like to use the Pin G20 as Output to drive a small LED. The LED get 3.3V and the Output should switch to low to activate the LED. i also have a series resistor (Same circuit is working fine in G21 and G7). My test program is verry simple:

    void setup() {
    // put your setup code here, to run once:
    pinMode(7, OUTPUT);
    pinMode(20, OUTPUT);
    pinMode(21, OUTPUT);
    digitalWrite(7, 0);
    digitalWrite(20, 0);
    digitalWrite(21, 0);
    }

    void loop() {
    // put your main code here, to run repeatedly:

    }

    only the LED on G7 and G21 is on. I think it have someting to do with the UART, becaus G20 is also RX. I´m sure the circuit is fine because the LED is flashing during the update process.

    Does anyone know how i switch G20 to Output mode?

    Gest regards,
    Berni4



  • Hello @Berni4

    the C3' TX (GPIO21) is connected to the USB UART RX pin; in other words the C3 is driving the line, therefore your code can blink an LED on GPIO21 just fine.

    However the C3' RX (GPIO20) is connected to the USB UART TX pin; in this case the USB UART and the C3 are both trying to drive the line and it looks like the USB UART is winning.

    In short, without hardware modification I don't see a way to use GPIO20 for anything else than UART functionality.

    Thanks
    Felix