After reset pin 13 seems to be configured as an output

On the Uno R4 Minima and Uno R4 WiFi, pin 13 seems to be made an output after reset, so if you do:

void setup() {
  Serial.begin(9600);
  delay(5000);
}

void loop () {
  Serial.println(digitalRead(13));
  delay(1000);
}

and apply 5V to the pin (via a resistor for safety), you still get 0.

As far as I understand it the usual Arduino convention is that all digital pins are inputs after reset, and to make a pin an output you have to call pinMode(13, OUTPUT), for example.

The way it is currently working is undesirable, because you might have pin 13 connected to a voltage input; an accidental reset could then cause excessive dissipation in the output driver.

Pin 13 is BUILTIN_LED and as such is defaulted to an output and seldom used as an input.

Pin 13 is BUILTIN_LED and as such is defaulted to an output

As far as I know no other Arduino board does this.

But Uno R4 does:

But Uno R4 does:

Which is why I'm reporting it as an error.

It isn't error but intentional as it is just a resistor and LED connected to pin instead of through a MOSFET or comparator.

Perhaps 'error' was the wrong word, but it's inconsistent with the Arduino Uno ATmega328P, and most other Arduino boards I'm aware of.

I've just tested the latest core, 1.0.2, and the problem is still there.

Have you brought it up as an issue on their github?

Good suggestion - thanks. Posted here:

After reset pin 13 is configured as an output

2 Likes