Digital Pins D0 and D1

Digital Pin 0 RX

Digital Pin 1 TX

Why is the default Status of this 2 pins always HIGH ?

I did not know this, made a PCB using this 2 pins and now I have always a problem when uploading a Sketch into my Arduinio UNO ...

:angry: :angry: :angry: :angry: :angry: :angry:

Why is the default Status of this 2 pins always HIGH ?

I don't believe that this is the case but these pins are used by the hardware serial interface of the Uno.

I have always a problem when uploading a Sketch into my Arduinio UNO ...

Now you know why, and why it is wise to breadboard projects before committing to a PCB

The digital pins 0 and 1 are used for serial communication. it's in all documentation.

As long as you aren't doing Serial communication - including uploading a sketch through USB - you can use them for other purposes.

since you want to upload, you can't connect those pins at the same time to something else... needs to disconnect while uploading

if you build a shield that plugs on top of the UNO, you'll need to cut the two pins going into 0 and 1 and do some creative work to have a way to disconnect those pins while uploading

Hi,

Thank you both. I read about having 14 digital input pins and so that is not true :grin:

In this case I only have 12 :grin:

As a newcomer I relied on the specs

rsfoto:
Hi,

Thank you both. I read about having 14 digital input pins and so that is not true :grin:

In this case I only have 12 :grin:

As a newcomer I relied on the specs

You can upload sketches through the ICSP with an adapter, and use pin 0 and 1 for anything you want.

rsfoto:
Thank you both. I read about having 14 digital input pins and so that is not true :grin:

not they can be used as input pins. upload your code, unplug the serial cable and you are good to go as long as you don’t use the Serial class

rsfoto:
As a newcomer I relied on the specs

well, you could also rely on the documentation…

But You are almost right that it’s not 14 - as the analog pins can also be used as digital input… so you have 20…

1 Like

J-M-L:
not they can be used as input pins. upload your code, unplug the serial cable and you are good to go as long as you don't use the Serial class

You may have to disconnect your circuit from the serial pins while you upload if they load the pins.

OK, now I am a bit smarter and will never ever again use D0 and D1 for output

May I ask how do I know to which pin refers the following ?

sync: resp=0xe2

or how can I translate that into a number ?

Thank you and regards

aarg:
You may have to disconnect your circuit from the serial pins while you upload if they load the pins.

Yes this is what I said in #2

Regarding “sync: resp=0xe2”

=> give us some context

rsfoto:
OK, now I am a bit smarter and will never ever again use D0 and D1 for output

May I ask how do I know to which pin refers the following ?

sync: resp=0xe2

It doesn't refer to a pin. It's just error reporting from an upload failure.

J-M-L:
Regarding “sync: resp=0xe2”

=> give us some context

Sorry,

This comes after the error message

avrdude: stk500_getsync(): not in sync: resp=0xe2

J-M-L:
The digital pins 0 and 1 are used for serial communication. it's in all documentation.

As long as you aren't doing Serial communication -

Thank you J-M-L

I made some tests and when I do not use Serial.println it works but unfortunately I need the Serial communication for testing my hardware so I guess I need to remake the PCB and leave Pin 0 and Pin 1 unconnected ...

Will do more tests to see if there are other pins making trouble.

regards Rainer

For testing, could you not use SoftwareSerial?

aarg:
For testing, could you not use SoftwareSerial?

Hi aarg,

Thank you. Just checked what SoftwareSerial is and will take a look at it.

Does SoftwareSerial deactivate Pin 0 and 1 and reroute them to other Pins or do I need to deactivate Pin 0 and 1 somehow using a command ?

So far I have worked on my problem and what I can do is cut off pin o and 1 from the piggyback and brigde them with a wire to pin 8 and 9 which are still free. Does not look nice but as it is in an aluminum it is not visible :slight_smile:

regards Rainer

As far as I know, pins 0 and 1 have no special attributes at startup unless Serial.begin() is called.

(Hint: take a look at the last couple of lines of the init() function)

If I understand correctly you need the serial to debug and upload - Given you are just starting with arduino I’d say go back to the design, leave 0 and 1 alone and dedicated to the serial port / usb communication and use some other pins for whatever you wanted to do with 0 and 1

Otherwise for init have a look indeed here

aarg:
As far as I know, pins 0 and 1 have no special attributes at startup unless Serial.begin() is called.

Manged to get going SoftwareSerial but is I do not declare LOW for Pin 0 and 1 they are still high after uploading

Have you read this?