Why are Due digital pins automatically pulling up?

I was testing the digital pins on the Due by the digitalRead() function and realized that unless i pull the pin low by connecting it to ground it is considered HIGH. I analogRead() the digital pins and they are showing ~217 out of 1023. My test code is shown below.

#define HREFpin 38

void setup() {
  pinMode(HREFpin,INPUT);
  Serial.begin(115200);
}

void loop() {
  Serial.println(digitalRead(HREFpin));
}

I am concerned that this will affect the my readings of the digital pins causing some readings to be HIGH when they aught to be LOW. Should i pull the pins down or leave them?

:wink:

Digital and analog pins , if left unconnected, will always "float" high. That is what you are seeing when you read an open pin!

David G.

But is it not a big inconvinience that the pins default to high?
If I use pinMode(pin, OUTPUT); I also have to use digitalWrite(pin, LOW);
And when programming all pins turns to High level outputs, and if the programming is interrupted or fails the pins remain in high state.
I might be wrong but it feels better if the outputs would default to LOW.

Pullups are standard so inputs can come from push buttons to ground and other
voltage devices with open-drain outputs.

The Due enables internal pullups by default because not all pins have hysteresis
built-in like the AVR ATmega series.