m0bi5
m0bi5

Reputation: 9462

Not able to upload code to Arduino

My Arduino Uno was all set up and was working fine.

Project: Arduino controls a 9v motor depending on the command given. As the Arduino only provides 5v, I added a 9v battery to it through a transistor

I decided to add new code into the Arduino but when I tried it failed. I have uploaded code thousands of times before (successfully) all of a sudden the IDE keeps giving the following message

avrdude: ser_open(): can't open device ".\COM3": Access is denied.

I have looked up for a lot of solutions on this forum and elsewhere. Here are the things I have tried so far:

  1. Changing the COM port
  2. Disabling all the other devices CONNECTED to COM
  3. Tightening the CONNECTIONS
  4. Re installing all the drivers and the IDE
  5. Rebooting the system
  6. Using another laptop to upload code

All the above have given me the same output for some reason. The built in LED light and the power LED switch on when the board is connected to a power source (my laptop). Could the board have been damaged by any chance? How can I check if the board is spoilt? Should I buy a new board?

Upvotes: 6

Views: 9239

Answers (4)

Markus
Markus

Reputation: 64

Once it happened to me that a defective USB cable was the culprit. For one board it gave messages like

avrdude: stk500v2_ReceiveMessage(): timeout

But for another board I also got these messages "can't open device - access denied". It's always worth to try another cable.

Upvotes: 0

make sure you have the right ports COM1 and COM1 activate it too in arduino

Upvotes: 0

GnoStiC
GnoStiC

Reputation: 662

this may help;

  1. remove the mcu from the board and connect the board to your PC.
  2. try to open the com port.
  3. if it opens, short TX pin to RX pin.
  4. send some data and check if you are getting the data back. this way you can make sure your usb-ttl is not damaged.

Upvotes: 1

blipman17
blipman17

Reputation: 531

With my verry limited experience with Arduino I've seen that the IDE sometimes resets the saved arduino on startup. Press extra -> Board -> yourboard and try again.

Upvotes: 0

Related Questions