Using the "Mighty Mini" board which uses the Atmega1284p processor, with Arduino IDE 2:1.0.5 on Raspbian, with Mighty Mini "board" files installed.
I was having some erratic behavior on inputs, so I checked it with a 'scope and it seems that although I have not enabled the internal pullup, I have +3.3v appearing on the input pin. I need the pin to float.
I ran a simple test to make sure it wasn't a coding issue:
void setup() {
pinMode(8, INPUT);
}
void loop() {
}
According to the docs, this should put the pin in a high impedance state. But a scope shows ~3.2 volts on the pin even when I connect a 1K resistor to ground. So the pin is definitely being driven.
I decided to try accessing the registers directly, eg:
void setup() {
DDRA = 0;
DDRB = 0;
DDRC = 0;
DDRD = 0;
PORTA = 0;
PORTB = 0;
PORTC = 0;
PORTD = 0;
}
void loop() {
}
This didn't work either.. still +3.3v on the pin. I've also tried different pins.
I thought that possibly the board definition for the Mighty Mini could have gotten the register defines wrong.. but it's worked perfectly in every other way.. my actual application uses SPI, I2C, Serial, Tone.. a lot of hardware I/O.. and other than this problem it works perfectly.. so I hesitate to blame the libraries when everything else seems to run correctly.
Thanks!