Go Down

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

oldmanXJ

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

Nick Gammon

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.
http://www.gammon.com.au/electronics

oldmanXJ

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.


GoForSmoke

I find it harder to express logic in English than in Code.
Sometimes an example says more than many times as many words.

oldmanXJ

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.


oldmanXJ

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

oldmanXJ

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. 

retrolefty

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.

Lefty

Go Up