Go Down

Topic: Stupid question from a old time programmer....new arduino user (Read 897 times) previous topic - next topic


I have searched around but don't seem to be able to find an answer.  This is such a beginner's question I hate to ask.

I just hooked up a UNO and got the blink code loaded and running.  I was able to modify it and upload it multiple times, no problem. 

I loaded the demo code for a servo and ran it with no problems.  The problem now is that I want to go back to a "blink" program and it will not upload the code.  It gives me a banner that the com5 port is not available.  Manager shows the port is fine.  It looks like the code that is running is keeping the upload from happening.  Port 5 is the correct port. 

Being a programmer, but being new to the development system, I have tried all the normal things.  I hit the reset button, but the processor seems to simply start running the same code.  I tried holding down the reset while trying an upload.  No luck.

Can someone tell me the magic incantation to get different code uploaded.  I must be missing something.

Window 7 64bit.  UNO R3 reference board design with a Atmega328p-pu  1.0.1


Try unplugging it (from the USB). Also disconnect anything else connected. Hold down reset and plug the USB back in (keeping Reset held down). Start uploading the sketch. When it says "uploading" release Reset.

However if it says COM5 is not available you have other issues. I suggest the Loopback test stickied at the start of the Installation and Troubleshooting section.
Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics


Tried that.  No luck.  The message is
Serial port 'COM5' not found.  Did you select the right one from the
Tools>Serial Port menu?

When I go to the Tools pull down menu, the Serial Port selection
is grey'd out.
I will keep looking.  Thanks for the reply.


Nick Gammon on multitasking Arduinos:
1) http://gammon.com.au/blink
2) http://gammon.com.au/serial
3) http://gammon.com.au/interrupts


Just finished.  With the board in reset and a loopback installed, I was able to do a com session on port 5 and got an echo of the data sent.


Serial monitor is no longer loaded.  I am going to reboot my pc as well.  Wish me luck. 


I figured it out.  I thought I might share it in case it can help someone else.

I am running an Uno R3 with a servo connected.  It is being powered through the USB port on a laptop.  Therein lies the problem.  USB ports on laptops are usually protected by what is commonly called a polyfuse.  It instantaneously opens in case of a current overload.  On most laptops, this current limit is .5a instead of the standard 1.0a on a desktop. 

When the program first starts up, it runs the servo to its limits and causes a current spike.  This shuts down the port for a few milliseconds.  The UNO automatically fires back up and you don't even really see this happening.  The issue is that Windows sees this and then disables the port in software as far as the development environment is concerned.

When I rebooted the computer and connected the UNO with the servo not connected, the port stayed open and I was able to upload the new code.  I guess I need to plug in the supply I have into the UNO.

Thanks for the help. 


Yes, powering servos (even one many times) via the arduino's 5V pin (not matter what the boards source of power is) often leads to confusing problem symptoms. Servos have motors and are not a good and well behaved load to have wired to an arduino board directly.


Go Up