Mega2560, How to Burn the Bootloader with AVRISP MKII

Hello, I need to know if I can Burn the Arduino bootloader on a new ATMEGA2560. I build a PCB with this uC and I want to use the Arduino Code Plataform. If someone explain me how to burn, I´ll be very happy. I just bought the AVRISP MKII, is this the correct tool to burn the bootloader? I need someone hoe teach me a little bit.

Pablo

If you have the AVRISP MKII why bother using the bootloader? Just plug your AVRISP MKII to the SPI interface and choose in the Arduino IDE File->Upload Using programmer. Double check your programmer is set under Tools->Programmer -> AVRISP MKII

Thank you, I never use the AVR IDE and the Arduino software before. I don´t know how to use. If you can say me where is a tutorial, I will appreciate it. Kind regards.

If you can say me where is a tutorial, I will appreciate it.

Where are excellent tutorials about avr using your programmer. Really recommended http://www.newbiehack.com/MicrocontrollerTutorial.aspx/

None of that gets the fuses set and the bootloader installed for Arduino IDE use.

Connect the MKii to your PC. Install the drivers for it that are in the IDE folder. My path is: c:/arduino-1.0.5/hardware/tools/avr/utils/libusb/bin

Once installed and appearing correctly in Device Manager, start the IDE. Select Files:Preference, and check the Verbose output boxes. Connect the MKii to the ICSP header on your board. Red light will be on. Power the board - MKii only monitors the power, it will not provide it. Green light should turn on.

Select Tools:Board:Mega2560 Select Tools: Programmer: AVR ISP MKii Select Tools: Burn Bootloader. Green light in MKii will flash for a while, when it goes steady green again the bootloader should be installed. Read the messages at the bottom of the IDE, there should be no error messages.

If you're running with these, I don't know what's involved in getting the driver installed: Debian,Mint,Ubuntu MAC OS Montain Lion

None of that gets the fuses set and the bootloader installed for Arduino IDE use.

True but it's not a requirement to have bootloader installed just to work with Arduino IDE.Bootloader is great to upload new programs via UART port (via USB) but since the user have the external programmer I just see benefits in not use bootloader.(no auto-reset when someone open serial communication, more flash space to handle, program execution starts immediately, more faster upload ...

Yes, all true -but misses the point of the initial request: How to install the bootloader with a MKii. Installing the bootloader is a very easy way to get the fuses set also.

Once the bootloader is installed, the MKii can be removed, serial downloads can be performed, and the serial monitor used for debugging or other purposes, perhaps replicating actual use once fielded.

Yes. The reason is because the new PCB will be updated by the USART with USB FTDI converter.
On this way, everyone can update the program without the programer, only need one USB cable.

In that case then you should install the bootloader.

Installing the bootloader is a very easy way to get the fuses set also.

Now it's me that have a question.I always question myself where the fuses are stored.Installing the bootloader also rewrite the fuses? Where fuses are stored anyway?

The High, Low, and Extended fuses are internal to the Atmega. Burning the bootloader sets them - oscillator type (external crystal), bootloader size, and other things. You can see the values used in boards.h. You can interpret what they do manually from the datasheet, see section 30.2, or enter them into a fuse calculator (google avr fuse calculator).

Dear CrossRoads I tried all the steps that you gived to me: Connect the MKii to your PC. Install the drivers for it that are in the IDE folder. My path is: c:/arduino-1.0.5/hardware/tools/avr/utils/libusb/bin

Once installed and appearing correctly in Device Manager, start the IDE. Select Files:Preference, and check the Verbose output boxes. Connect the MKii to the ICSP header on your board. Red light will be on. Power the board - MKii only monitors the power, it will not provide it. Green light should turn on.

Select Tools:Board:Mega2560 Select Tools: Programmer: AVR ISP MKii Select Tools: Burn Bootloader. Green light in MKii will flash for a while, when it goes steady green again the bootloader should be installed. Read the messages at the bottom of the IDE, there should be no error messages.

But I have only an error messege: "usbdev_open() : did not find eny usb device "usb" "

PC? Check that the driver is installed with no ! in Device Manager.

In device manager not appear the MKII like a com port. May be because I installes the ATMEL Studio. what can I do?...... =(

Install it. Search avrisp2.inf to find the path to the driver.