unable to burn to aurdino

when i try to upload the code the following error shows.

"Arduino: 1.6.4 (Windows 8.1), Board: “Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)”

Sketch uses 2,714 bytes (1%) of program storage space. Maximum is 253,952 bytes.

Global variables use 186 bytes (2%) of dynamic memory, leaving 8,006 bytes for local variables. Maximum is 8,192 bytes.

avrdude: ser_open(): can’t open device “\.\COM7”: The system cannot find the file specified.

avrdude: ser_drain(): read error: The handle is invalid.

Problem uploading to board. See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.

This report would have more information with
“Show verbose output during compilation”
enabled in File > Preferences.
"

i thought that some fuse has blown and bought a new arduino.

Tools=> board=> Ardunio mega or Mega 2560 selected
Tools=> Processor=>ATmega2560 selected
Tools=> Port=> COM8(aurdinomega ormega2560) ticked

what am i doing wrong…

code:
"
*
Stepper Motor Control - one step at a time

This program drives a unipolar or bipolar stepper motor.
The motor is attached to digital pins 8 - 11 of the Arduino.

The motor will step one step at a time, very slowly. You can use this to
test that you’ve got the four wires of your stepper wired to the correct
pins. If wired correctly, all steps should be in the same direction.

Use this also to count the number of steps per revolution of your motor,
if you don’t know it. Then plug that number into the oneRevolution
example to see if you got it right.

Created 30 Nov. 2009
by Tom Igoe

*/

#include <Stepper.h>

const int stepsPerRevolution = 200; // change this to fit the number of steps per revolution
// for your motor

// initialize the stepper library on pins 8 through 11:
Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11);

int stepCount = 0; // number of steps the motor has taken

void setup() {
// initialize the serial port:
Serial.begin(9600);
}

void loop() {
// step one step:
myStepper.step(1);
Serial.print(“steps:” );
Serial.println(stepCount);
stepCount++;
delay(500);
}
"

please make ensure these following

  1. arduino board being detected in device manager
  2. there is no pin attache to TX & RX line of arduino board.if connected remove it & then upload code
  3. chose proper board & comport while uploading code

if any of these not working it means your bootloader being crashed its time to replace new IC with bootloader or burn bootloader using AVR pocket programmer(https://www.sparkfun.com/products/9825)

uninstalling and Reinstalling Ardunio software solved the problem.. :) cheers.

what could have been the problem so that i avoid it in future..

after reinstalling i was just able to upload a single program and have the uploading problem again!!

usamaamjid15: after reinstalling i was just able to upload a single program and have the uploading problem again!!

My guess is that the auto-reset feature is not working. Try holding down the reset button on the Arduino until you see the "Sketch uses" and "Global variables use" messages. If that works either the hardware is faulty or your PC is not tweaking DTR on the serial port when it opens the serial port. There might be some other program that connects to the serial port when it appears.

yes johnwasser. the problem was that another program was also connected to that port.

Thank you… problem solved
========================>Thread closed<=======================

I have the same problem ! when I wanna up firmware the error apears but when I burn some code like Multi speed LCD Scanner there is no error