I'm trying to use pin 4 of the Arduino Due as a floating digital input. I have a very simple script:
void setup() {
pinMode(4, INPUT);
}
void loop() {
}
When this script is run, however, pin 4 still has a pull-up on it. I have to manually switch off the pullup with the register:
void setup() {
pinMode(4, INPUT);
REG_PIOA_PUDR |= 0x20000000;
}
void loop() {
}
Then it floats as expected.
Pin 5 doesn't have this issue. Anyone know why pin 4 is behaving differently? I've tried both 1.x and 2.x versions of the IDE.