HELP: Problem in uploading sketch

Dear all,

I have recently received my mega 2560.

I have tried the blink example, and modified the codes to do different things and it worked fine.. Then today I tried to program my arduino with WinAVR ( using C language) using AVR ISP usb programmer by pololu.. Again it works fine.

But the problem now is that I can not use the arduino IDE to upload my sketch..

Is there any idea why this happens?

When I tried to upload the sketch the IDE just keep trying to upload the chip but nothing happens..

Anyway I am using windows XP sp3 to do my stuffs

I really need advice as I am still a newbie

Thx Lev

Is there any idea why this happens?

Overwrote the bootloader? (when you uploaded with WinAVR + ISP)

@Coding Badly Is it possible that I overwrote the bootloader? Shouldn't it be written at the EEPROM? I wrote the code with WinAVR + ISP to the flash..

And how can I burn the bootloader into the chip again?

Thx

Is it possible that I overwrote the bootloader?

Yes.

Shouldn't it be written at the EEPROM?

No.

I wrote the code with WinAVR + ISP to the flash..

Flash is where any and all executable stuff resides in an AVR processor. That includes your application and the bootloader.

And how can I burn the bootloader into the chip again?

The Arduino IDE makes it fairly easy. Start here... http://www.arduino.cc/en/Hacking/Bootloader

@Coding Badly I tried the link that you gave me but it seems that the AVR ISP programmer not responding if I use the arduino IDE..

I found the link http://www.cbxdragbike.com/arduino/new/

and it gave me the bootloader hex file, I tried to upload it through AVR Studio and it says OK.. But I haven't yet been able to upload the sketches from arduino IDE..

Is what I'm doing right?

You have to upload the bootloader and set the processor’s fuses.

@Coding Badly

I haven't got any progress at all now..

When I tried to burn the bootloader through the arduino IDE, it gives result : avrdude: stk500_getsync(): not in sync: resp=0x00 avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

Then when I tried to follow the website and set the fuse, still there is nothing happening..

Can you please tell me how to fix it step by step?

Thx

I don't have the experience needed to give you detailed instructions.

Did you change the serial port to the ISP?

Anybody can give suggestions?

I still can't upload the sketches to the board up to now and I suspect I overwrote the bootloader when programming the board with WinAVR..