[Solved] Program Mega using UNO

I think i fried my Mega usb port. I can't connect it back to my computer; i used another arduino UNO that i have to burn bootloader on my Mega in a attempt to make it connect again; it still wont connect but the led on the 13 pin is blinking now. which means that the Arduino mega is programmed to run the blink example what i get from that is the borad is still working.

I want now to upload a sketch on Mega using my Arduino UNO.

I did my research and I found that there is two methods 1 - using The UNO as ISP programmer 2 - using serial communication (RX and Tx pins)

I followed many tutorials out there but none of theme seams to work for me can someone explain for me in detail how to program my Mega using my UNO using one of the methods above

thanks

Do you have an SD card? See this post.

I'm going to move this, it isn't a "programming" question, it's a "how to I program my chip" question, which isn't the same thing.

May be a connection schema of Uno to mega will help others to point out the issue. Also the steps you followed while programming using Arduino as ISP.

I bootloaded several Atmegas using Arduino as ISP and never had any issues. But never tried with Mega.

sarouje: May be a connection schema of Uno to mega will help others to point out the issue. Also the steps you followed while programming using Arduino as ISP.

I bootloaded several Atmegas using Arduino as ISP and never had any issues. But never tried with Mega.

The wiring UNO: mega(1280 and 2560) 10 => RESET pin 11 => 51 12 => 50 13 => 52 the bootloading operation worked just fine. what I want now is to upload a sketch to my Mega

What will happen if you click sketch->upload using programmer.

If you click upload then its going to the Uno not the mega.

Start it again. Upload Arduino as ISP sketch using Sketch->upload. Then open the sketch for Mega and click Sektch->Upload using programmer.

sarouje: What will happen if you click sketch->upload using programmer.

If you click upload then its going to the Uno not the mega.

Start it again. Upload Arduino as ISP sketch using Sketch->upload. Then open the sketch for Mega and click Sektch->Upload using programmer.

that is exactly what i do (Sektch->Upload using programmer) but i get an error and asks me to use -F if i want to ignore it

but when i do Tools->Burn Bootloader everything goes well.

I suggest make sure your wiring is well connected, and try different wires than the ones you were using before. It sounds strange to me that burning bootloader works but uploading a sketch via programmer does not work. In both cases, the avrdude is doing is uploading a program from a hex file. Show us a good clear photo of how you have it wired.

Also make sure you have not modified your boards.txt file or other config files to do something like change the lock_bits or change other fuses or avrdude recipes. Use a fresh installation of the IDE if you have been modifying it. That is one of the only possible scenarios I can think of that would lead to uploading bootloader fine but not able to upload a sketch. Try a different computer if possible. And of course try another USB cable, because you never know when you have something flakey until it drives you crazy for a while.

If you want to upload a sketch via a programmer to a Mega 2560, you will need to set the high fuse to D9. But that only affects whether your sketch runs or not runs, it would not impact your ability for avrdude to upload or to read the chip signature.

Of course, it is possible your Mega board has some damage and that would be supported by the fact you are having difficulty uploading to it.

You may want to disable auto reset on your Uno after you upload the ArduinoISP sketch. That is usually done by connecting capacitor between GND and RESET on the UNO. 1uF or higher should work fine. It is not always necessary, but since you're having problems it is something to try.

You may also want to attempt using your Uno as ISP to re-burn the USB-to-serial software on your ATmega16U2 USB-to-serial chip, if your Mega board has the ATmega16U2. You may be able to restore your board to normal operation.

This other recent thread has a lot of good info you may be able to use: http://forum.arduino.cc/index.php?topic=402116.0

If you have more questions or continue to have problems, set the IDE preferences to show verbose output on upload, and post the full text of what it shows you after each thing that you attempt, and tell us all of the various settings you are making on the Tools menu for Board, Processor, Port, Programmer, etc. for that attempt. And tell us what version of the IDE you are using, and write down and tell every single step you are doing, including wiring, what buttons or menu selections you are clicking in the IDE, etc. The more orderly and easy to understand details about your step by step methods, the better.

Thanks guys for the support. I was redoing everything from scratch. and writing information about each step. suddenly, everything start working just fine. I have been able to program the Mega using my UNO with the same wiring i used before. thanks a lot. sorry for the inconvenience.

Good to hear that it's working. Please append [Solved] to beginning of the title.