Using PD0 and PD1 as inputs


I am new to Arduino and I need to use PD0 and PD1 as inputs for a pin change interrupt. The other inputs on PORTD generate the interrupt as expected so I know that it does work but PD0 and PD1 don’t. They work fine as outputs but just not in this mode. I realize that these are reserved for serial communications but I have no need for the serial communications but I do have a need for this full port. What am I missing here? I do have the USB attached for flashing the part, could this be a contention somehow.



As long as you don't send serial data trough the USB cable it should not be a major problem. The USB interface will act as a weak pull-down resistor on the RX pin because of the 1K resistors between the ATmega8u2 (USB interface) and the ATmega328P (assuming you are using an Arduino Uno).

How do you have the signals connected? Are you using pull-up or pull-down resistors?

Got it working thanks, in the end it was just a bad connection.