Burn new chip ATMEL mega16u2

Hello, I would like to know if there is any special thing to program a new one Chip ATMEL mega16u2... I have been reading differents links but I can not find the right program to do it. I have bought it in Farnell I have wired it to a new board with the right Crystal (16MHz) and Capacitors... but I can not get the right link between the new PCB and my computer. Have I to burn any special file? or use one special Software to burn a new one Chip?

You have to program it using an ICSP programmer. If you don't have one you can use the ArduinoISP sketch that comes with newer versions of the IDE. I hope your board has the ICSP pins externally available, otherwise a programming will be quite difficult. What do you want to bring on the chip? An Arduino bootloader (to program it over USB)?

Hi Pylon, thanks for your response,

yes… I have ICSP pins in my board. But, I can’t program it in the right form. The first think that I have tested is to program through USBasp programmer with AVRdude. I can program the Fuses (L,H,E) and LB but it is not possible to read it in my Device Manager when I connect it to my computer through one USB cable.
With the USBasp i burned one DFU Bootloader file .hex to my ATMEL Chip but it does not appear in the right form in my computer, only as unknown USB.

I have tested both, the next links files:
Arduino\hardware\arduino\avr\firmwares\atmegaxxu2\arduino-usbserial
Arduino\hardware\arduino\avr\firmwares\atmegaxxu2

the differents files to one Arduino Mega R3.

I would like to program it (ATMEL mega16u2) as Mega2560. Do you know if it is possible?

I can program the Fuses (L,H,E) and LB but it is not possible to read it in my Device Manager when I connect it to my computer through one USB cable.

If you can program the fuses you usually can program the flash memory too. Please explain exactly what you you do and how you wired the board to the USBasp. Also please provide a schematic of that board and a link to the product if it's commercially available.

I would like to program it (ATMEL mega16u2) as Mega2560. Do you know if it is possible?

I don't know what you mean but if you want to select Mega2560 in the boards menu of the IDE to program that chip, that's not possible.

I have wired my USBasp direct to the ICSP (3x2) of my board through AVRdude and I have load the .hex with the next order:

-c usbasp -p m16u2 -P usb -b 19200 -B 2.0 -U flash:w:“C:…\Arduino…\atmegaxxu2\Arduino-COMBINED-dfu-usbserial-atmega16u2-Mega2560-Rev3.hex”:a

and I got the following answer:

Avrdude: set SCK frequency to 375000 Hz
Avrdude: warning: cannot set sck period. please check for usbasp firmware update.
Avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

Avrdude: Device signature = 0x1e9489
Avrdude: NOTE: “flash” memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
Avrdude: erasing chip
Avrdude: set SCK frequency to 375000 Hz
Avrdude: warning: cannot set sck period. please check for usbasp firmware update.
Avrdude: reading input file “C:\Program Files (x86)\Arduino\hardware\arduino\avr\firmwares\atmegaxxu2\Arduino-COMBINED-dfu-usbserial-atmega16u2-Mega2560-Rev3.hex”
Avrdude: input file C:\Program Files (x86)\Arduino\hardware\arduino\avr\firmwares\atmegaxxu2\Arduino-COMBINED-dfu-usbserial-atmega16u2-Mega2560-Rev3.hex auto detected as Intel Hex
Avrdude: writing flash (15668 bytes):

Writing | ################################################## | 100% 1.87s

Avrdude: 15668 bytes of flash written
Avrdude: verifying flash memory against C:\Program Files (x86)\Arduino\hardware\arduino\avr\firmwares\atmegaxxu2\Arduino-COMBINED-dfu-usbserial-atmega16u2-Mega2560-Rev3.hex:
Avrdude: load data flash data from input file C:\Program Files (x86)\Arduino\hardware\arduino\avr\firmwares\atmegaxxu2\Arduino-COMBINED-dfu-usbserial-atmega16u2-Mega2560-Rev3.hex:
Avrdude: input file C:\Program Files (x86)\Arduino\hardware\arduino\avr\firmwares\atmegaxxu2\Arduino-COMBINED-dfu-usbserial-atmega16u2-Mega2560-Rev3.hex auto detected as Intel Hex
Avrdude: input file C:\Program Files (x86)\Arduino\hardware\arduino\avr\firmwares\atmegaxxu2\Arduino-COMBINED-dfu-usbserial-atmega16u2-Mega2560-Rev3.hex contains 15668 bytes
Avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 1.24s

Avrdude: verifying …
Avrdude: 15668 bytes of flash verified

Avrdude: safemode: Fuses OK (E:F4, H:D9, L:EF)

I think all is Ok, but I find the same reply in the “Device Manager”: Unknown Device USB.

The wire is the same in Mega2560 R3 board as in the next image. The only difference is that I have another resistor (10K) wired to PD7 (pin 13 in Chip Mega16u2)

What vendor/device ID do you see then? (I hope Windows can display that)

You are sure that you don't see the USBasp as the unknown device, aren't you?

When I load the file “Arduino-COMBINED-dfu-usbserial-atmega16u2-Mega2560-Rev3.hex” trought USBasp to my board I see nothing in the “Device manager”, I don’t see ID, don’t USB connection.
When I finish to load throught USBasp I disconnect this cable and connect only the USB cable to connect my board to the computer to check that all is Ok.

and I see only the reply in the atached image “No id, no vendor”.

Post the schematics of that ATmega16U2 board.