Arduino Nano, pins 0/RX and 1/TX, I can't turn a LED on

I, I was trying a simple sketch and managed to make a LED blink when plugged to pins 2 to 13, but nothing happens when I try the same with pins 0 and 1. I used the same basic Blink sketch.

Is there something wrong with the board?

Pins 0 and 1 are used for the usb serial link to upload sketches into your nano board. I would have to see how you wired up your led and if you used a series resistor with the led. Best practice is to not utilize pins 0 and 1 in your projects. The analog input pins can be used as digital pins if you need more.

Lefty

Of course I placed a (330Ohms) resistor between the pin and the LED. I tested all the pins and all worked but 0 and 1.

I wanted to test all the pins after soldering in case I burnt something.

I kept on searching info about those pins and someone said that when powering the board with the USB plug there is some kind of interference with pins 0 and 1, they should work when powering the board with another power source at Vin or +5V.

And, can I test both as output or only 0/RX as it is used to receive (serial data)?

Typically you can use pins 0 and 1 as you please but anything you wire to them usually prevents uploading new sketches to the board via USB. The on-board serial converter chip will place pull-ups on pins 0 and 1 even if not plugged into USB.

rva1945, so your contention is that following does not work?

byte anodePin = 0; // don't forget current limit resistor
byte cathodePin = 1; // change these to any pair of pins you want

void setup(){
pinMode (anodePin, OUTPUT);
pinMode (cathodePin, OUTPUT);
}
void loop(){
digitalWrite (anodePin, HIGH);
digitalWrite (cathodePin, LOW);
delay (1000);

delay (1000);

digitalWrite (anodePin, LOW);
digitalWrite (cathodePin, HIGH);
delay (1000);
}

Yes sir, that is more or less the same code I tried, that works fine with any pin from 2 to 13.

I still have to test it without powering the board with the USB plug. I will do it later and post the results.

Please excuse me if I am asking stupid questions but I have just started literally yesterday in this world of programmable boards. At least I'm a software developer so the concept of programming is not new to me.

Thanks.

Did you try to disconnect the USB (and power the Arduino externally)?
Or simply to push push the RESET button after uploading?

I tried both to no avail.

Is there any other way rather than blinking leds to test those two pins?

Write a sketch to receive data from serial monitor and send it back. Maybe modify it so you know its doing something, add 1, multiply by 2 or something,

I'm sorry but I don't think I know how to do it. So far, I have been using Serial.begin(), Serial.println(), etc, using the USB cable.

How do I use those pins (0 and 1)? Schematics?

I found this in the forum. Maybe that is the reason why I didn't see the leds blinking?

"Even when you disconnect the USB, the USB to serial chip is still active and still pulling the pins through a 1K seriese resistor. Any I/O on this pin must overcome / drive this as well."

So the current drain wasn't enough to turn the led on?

No, with D1 sourcing 20mA and D0 sinking 20mA, that LED is definitely turning on.
I suspect a wiring error.

If the voltage is 5V and the resistor is 1K, the current is 0.005, way too small for a LED. Add to that the 330 Ohms resistor I had already connected between the pin and the LED...

The wiring is correct, as soon as I connect one of the resistor terminals to other "active" pin, D2, the LED turns on.

Bull. 5mA is plenty to turn on an LED.