pin 0 RX???????????

Hello, I'm new to arduino. I've managed to get a few projects together but I think there may be a problem with my board I'm not sure of. From the documentation I've looked at online(I could be mistaken) I thought that pins 0 through 13 can be used as either inputs or outputs but however 13 is more difficult to use as an output.

Well I've used many different pins as outputs and inputs but for some odd reason whenever I try to use pin 0 (RX) as an input it will not let me. No matter what this pin stays hot all the time.

I believe one thing I read said that you don't even have to declare inputs only outputs. However since I was having the problem I went ahead and put "pinMode(0, INPUT);" in the setup part of the program and still if I run a wire from that pin to an LED and 330 ohm resistor to ground the LED is on. I even tried it again with the bare minimum example just to make sure there was nothing else I may have put in a program that accidentally interfered with the pin. Just to be clear I'm not talking about the dimly lit LED that you see if you connect an LED to an input, it is bright, just as if it were an output and the state was set to HIGH. I've used all the other pins just fine with no problems and was wondering if this was a problem with my board or if this were a normal thing that it is supposed to do and also if that is the case if there is another way to be able to use the pin as an input.

P.S.
Forgot to mention I'm using an Arduino UNO if it makes a difference. Also wanted to clarify when using the INPUT and connecting it to an LED which was in series with a resistor and ground that I understand the difference between input and output. I originally in my first program was using a push button and had a pulldown resistor to ground(10K ohm) on one side and the other side of the NO contacts had a wire to the 5V on the Arduino, and the side of contacts with the pulldown resistor went to pin 0. I noticed on my program that was supposed to do something when I had the button pushed in that it was doing it instead all the time. So then I checked by running the wire from pin 0 straight to the LED which was in series with a resistor and ground to verify what I thought which was the pin stayed HIGH all the time even after setting it as an INPUT.

Pin 0 is tied to the USB 16U chips TX pin it would be High

be80be:
Pin 0 is tied to the USB 16U chips TX pin it would be High

Thank you for the quick reply. I kind of thought the usb may have had something to do with it and thought maybe powering the board from an ac adapter instead would fix the problem but it was still there. With the answer you gave me does that apply to either way you power the board would it still be HIGH even if you don't have the USB plugged in?

If the '16U2 is powered up, its output will be driving the Rx pin high. Anything you connect externally needs to overcome the 5mA going thru that resistor.

CrossRoads:
If the '16U2 is powered up, its output will be driving the Rx pin high. Anything you connect externally needs to overcome the 5mA going thru that resistor.

Thanks for the reply, when you say "If the '16U2 is powered up", do you mean only if I'm powering the board through the usb or also if I'm using an ac adapter and not using the USB port would it still be powered up anyhow? I'm assuming the other part of you mean that instead I would have to use the pin knowing it stays hot and would have to instead use a pullup resistor to 5V and send it gnd for input and just alter my program for that. If I'm wrong please write back I won't try anything until I know for sure.
P.S.
You have a twin I swear my old boss at a sign company I worked for looks exactly like you.

Thanks for the reply, when you say "If the '16U2 is powered up", do you mean only if I'm powering the board through the usb or also if I'm using an ac adapter and not using the USB port would it still be powered up anyhow?

The 16U2 will be powered up anytime the arduino board is powered up via any method. So the rec signal line will always be 'pulled-up' to +5vdc via a 1k ohm resistor.

Lefty

retrolefty:

Thanks for the reply, when you say "If the '16U2 is powered up", do you mean only if I'm powering the board through the usb or also if I'm using an ac adapter and not using the USB port would it still be powered up anyhow?

The 16U2 will be powered up anytime the arduino board is powered up via any method. So the rec signal line will always be 'pulled-up' to +5vdc via a 1k ohm resistor.

Lefty

Thanks for the reply Lefty, the reason I asked about adding a pullup resistor or possibly the built in one was because I wanted to make sure that the line will always be pulled up like you say by the 1k ohm resistor. I wasn't sure if it were something that changes state for whatever reasons while the board is on and if that were the case I would also have to have a pull up resistor to keep it high if that were to happen but I believe you answered my question(pretty much when I power that board the pin stays high no matter what I guess unless I'm using it as serial comm? is that right?). Thanks

If you're using Do/D1 as inputs, then use the internal pullup to be sure you have a good high.

pinMode (D0, INPUT);
digitalWrite (D0, HIGH);
pinMode (D1, INPUT);
digitalWrite (D1, HIGH);

(pretty much when I power that board the pin stays high no matter what I guess unless I'm using it as serial comm? is that right?).

That is the case, but no harm in activating the internal pull-up resistor as for no other reason it documents your requirement in your sketch.

Lefty

Just wanted to come back and thank you both you've both been a great help.

Glad to help.