Atmega16u2 Incorrect PID

To start, I have an Arduino UNO clone made by GEEKCREIT.

I am not the Original purchaser. I acquired this UNO in a box of "Stuff" that I bought at a local "HAM Fest" and am trying to get it to work.
I have spent the last week reading and trying everything I can find here and elsewhere with absolutely no luck.

This board DOES NOT have the CH340 serial interface IC.
It has the Atmel Atmega16U2 interface.

The problem seems to be that the Atmega16U2 has the Incorrect PID. The VID seems to be correct.

When connected to a Windows 7 or Windows 10 machine, the Device manager shows the Uno as a libusbK USB Device / AVRISP mkII with a USB\VID 03EB and PID 2104.

When connected to a Linux machine, lsusb shows it as 03eb:2104 Atmel Corp. AVR ISP mkII.

The Atmega16U2 will NOT go into the DFU mode and will not program through its ICSP header.

Can someone point me it the right direction of a fix or solution to getting this UNO Atmega16U2 back to a working bootloader????
Or is this just a LOST cause.

Herb

This the message I get When using another UNO as ISP trying to burn the HoodLoader2 16U2 bootloader to the "Broken" UNO Atmega16U2 ICSP...

avrdude: Version 6.3-20190619
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch

     System wide configuration file is "C:\Users\Herb's Laptop\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf"

     Using Port                    : COM4
     Using Programmer              : stk500v1
     Overriding Baud Rate          : 19200
     AVR Part                      : ATmega16U2
     Chip Erase delay              : 9000 us
     PAGEL                         : PD7
     BS2                           : PC6
     RESET disposition             : possible i/o
     RETRY pulse                   : SCK
     serial program mode           : yes
     parallel program mode         : yes
     Timeout                       : 200
     StabDelay                     : 100
     CmdexeDelay                   : 25
     SyncLoops                     : 32
     ByteDelay                     : 0
     PollIndex                     : 3
     PollValue                     : 0x53
     Memory Detail                 :

                              Block Poll               Page                       Polled
       Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
       ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
       eeprom        65    20     4    0 no        512    4    128  9000  9000 0x00 0x00
       flash         65     6   128    0 yes     16384  128    128  4500  4500 0x00 0x00
       lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
       signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

     Programmer Type : STK500
     Description     : Atmel STK500 Version 1.x firmware
     Hardware Version: 2
     Firmware Version: 1.18
     Topcard         : Unknown
     Vtarget         : 0.0 V
     Varef           : 0.0 V
     Oscillator      : Off
     SCK period      : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.03s

avrdude: Device signature = 0xffffff (probably .avr8x_mega) (retrying)

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0xffffff (probably .avr8x_mega) (retrying)

Error while burning bootloader.
Reading | ################################################## | 100% 0.03s

avrdude: Device signature = 0xffffff (probably .avr8x_mega)
avrdude: Yikes! Invalid device signature.
Double check connections and try again, or use -F to override
this check.

avrdude done. Thank you.

Are you sure you are loading the bootloader correctly - the error suggests to me you selected UNO when loading the bootloader rather than mega ( which I think is your destination board ?)

Here is a screen shot of how I have things set..

I am 75 just learning.
I do have have it set to HoodLoader 2 UNO.
Do I have to set it to HoodLoader2 Mega for the atmega16u2?

Using AVRDude-Master and this command line, I get this result.

C:\AVRDUDE-Master\avrdude-master>avrdude -C avrdude.conf.in -p m16u2 -c avrispmkii -F -U flash:w:Arduino-usbserial-atmega16u2-Uno-Rev.hex -U lfuse:w:0xFF:m -U hfuse:w:0xD9:m -U efuse:w:0xF4 -U lock:w:oxCF:m -v -v -v

avrdude: Version 6.4
Copyright (c) Brian Dean, http://www.bdmicro.com/
Copyright (c) Joerg Wunsch

     System wide configuration file is "avrdude.conf.in"

     Using Port                    : usb
     Using Programmer              : avrispmkii

avrdude: usbdev_open(): Found AVRISP mkII, serno: 001D2C881679
avrdude: stk500v2_getsync(): found AVRISP mkII programmer
AVR Part : ATmega16U2
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PC6
RESET disposition : possible i/o
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :

                              Block Poll               Page                       Polled
       Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
       ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
       eeprom        65    20     4    0 no        512    4    128  9000  9000 0x00 0x00
                              Block Poll               Page                       Polled
       Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
       ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
       flash         65     6   128    0 yes     16384  128    128  4500  4500 0x00 0x00
                              Block Poll               Page                       Polled
       Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
       ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
       lfuse          0     0     0    0 no          1    1      0  9000  9000 0x00 0x00
                              Block Poll               Page                       Polled
       Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
       ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
       hfuse          0     0     0    0 no          1    1      0  9000  9000 0x00 0x00
                              Block Poll               Page                       Polled
       Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
       ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
       efuse          0     0     0    0 no          1    1      0  9000  9000 0x00 0x00
                              Block Poll               Page                       Polled
       Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
       ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
       lock           0     0     0    0 no          1    1      0  9000  9000 0x00 0x00
                              Block Poll               Page                       Polled
       Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
       ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
       calibration    0     0     0    0 no          1    1      0     0     0 0x00 0x00
                              Block Poll               Page                       Polled
       Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
       ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
       signature      0     0     0    0 no          3    1      0     0     0 0x00 0x00

     Programmer Type : STK500V2
     Description     : Atmel AVR ISP mkII
     Programmer Model: AVRISP mkII
     Hardware Version: 1
     Firmware Version Master : 1.24
     Vtarget         : 4.9 V
     SCK period      : 23.12 us

avrdude: stk500v2_command(): command failed
avrdude: stk500v2_program_enable(): bad AVRISPmkII connection status: Unknown status 0x00
avrdude: initialization failed, rc=-1
avrdude: AVR device initialized and ready to accept instructions
avrdude: Device signature = 0x000000 (probably m16u2) (retrying)
avrdude: Device signature = 0x000000 (probably m16u2) (retrying)
avrdude: Device signature = 0x000000 (probably m16u2)
avrdude: Yikes! Invalid device signature.
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.

avrdude done. Thank you.

I wonder,,,

It couldn't be as old as Rev1 could it and require the HWB line to be asserted?

Nope not a Rev1 board.

I can not get the 16u2 to even reset by shorting the Reset and Gnd pins.

Hmmm … I’ve only loaded bootloaders using code provided in the IDE examples folders , there is plenty about this on the internet and it just works .
Alternatively buy a ICSP programmer which is even better .

( in that you set the target board as the board type ) .

The hood loader software can modify both the 2560 programmer and the usb interface chip

  • your device signatures error might mean you are trying to change the wrong processor .

You seem to be getting in some deep water . If you are starting out , I would put that in a drawer for later and buy a new one . Alternatively just program via the ICSP pins , and forget about the USB

1 Like

I guess I should clarify. I am not just starting out. I am just learning how to fix this problem with the Atmel Atmega16U2 Identifying as an AVRISPMKII.
I spent 40 years in the communications field. I have been playing and hacking with electronic stuff for close to 60 years. I have built a number of projects using Pro Mini's and Nano's. My one big project being a Fuel Gauge/Sender calibration device. Just a little background.

This issue is not necessarily about burning a bootloader to the Atmega16U2. It is how to get it back to identifying with the correct PID as stated in my first post above.

I am trying to access/program the Atmega16U2 using its ICSP header using my AVRISPMkII or USBASP programmers. Not the USB port.

Using AVRDude or AVRDudess, I get semi random incorrect Device Signatures returned.

Can a fuse be set somehow that blocks the programming mode?

That code defines the PID.

Can I get a little guidance on doing this?

Does this have to be done on a linux machine or can it be on a windows machine?

There are several guides on line describing how to burn AVR Arduino bootloaders. You will need an ISP programmer. This one is by far the best.

"That code defines the PID."

So, the bootloader writes the VID & PID to the device?

What device?

When properly programmed, the ATmega16U2 is a USB device and must present the proper credentials, following the USB protocol, to be recognized by the PC.

The usb-serial code includes all of the USB functions and identifiers like VID and PID, required to behave as a USB device and to perform its various duties.

Did you read my first post? This is a UNO clone. When connected to a windows machine, device manager shows a VID & PID of 03EB &2104. Linux lsusb shows the same thing.
This VID & PID combination I believe is for a AVRISP MkII. I think whoever had it before me programmed it as a AVRISP MkII. The Atmega16U2 should be 03EB & 2FEF.
Now it will not go into the DFU mode no matter what I try. If I try to use the FLIP program I get the error"com.atmel.flip.IspException.
If I use the Arduino AVRDude from the windows command line using this command:
C:\Arduino AVRDude>avrdude -C avrdude.conf -p m16u2 -c avrispmkii -P usb -b 115200 -F -U flash:w:Arduino-usbserial-atmega16u2-Uno-Rev.hex -U lfuse:w:0xFF:m -U hfuse:w:0xD9:m -U efuse:w:0xF4 -U lock:w:oxCF:m -v -v -v
I get this message at the end of the attempt:
Programmer Type : STK500V2
Description : Atmel AVR ISP mkII
Programmer Model: AVRISP mkII
Hardware Version: 1
Firmware Version Master : 1.24
Vtarget : 4.9 V
SCK period : 23.12 us

avrdude: stk500v2_command(): command failed
avrdude: stk500v2_program_enable(): bad AVRISPmkII connection status: Target reverse inserted
avrdude: initialization failed, rc=-1
avrdude: AVR device initialized and ready to accept instructions
avrdude: Device signature = 0x000000 (retrying)
avrdude: Device signature = 0x000000 (retrying)
avrdude: Device signature = 0x000000
avrdude: Yikes! Invalid device signature.
avrdude: Expected signature for ATmega16U2 is 1E 94 89
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.

avrdude done. Thank you.

I have used my AVRISPMkII, USBASP, and another (Real) Arduino UNO as ISP with the same results.

Did you read my posts?

Check the USB-serial source code, linked in post #10, to determine whether the standard Atmega16U2 offering defines these constants as you expect.

I'm done with this thread, so good luck with your project.

I am sorry I am not as Smart and Understanding of these things as You Must be.

I came here looking for help and Guidance. Not Comments like I am done with this thread.

I'm sorry that you are unable to follow straightforward instructions.

The source code defines the ATmega16U2 PID as follows.

Does anything below look familiar to you?

#elif defined(__AVR_ATmega16U2__)
			#define PRODUCT_ID_CODE               0x2FEF
			#define AVR_SIGNATURE_1               0x1E
			#define AVR_SIGNATURE_2               0x94
			#define AVR_SIGNATURE_3               0x89

Yes, I realize that.
I am trying to load a new bootloader to the Atmega16U2 and it will not work, .it will NOT go into the DFU mode. I can not get it to accept any code.

That is what I need help with.

The problem for me is I read this statement and assume you know nothing , it then runs in a circle of responses as people spent time trying to respond to a beginner and you get frustrated with the responses and we get frustrated in having wasted time . (It’s just simple misunderstanding bought about by short txt messages. ).
Manners then go out the window as mud gets thrown .
The only cure is to be precise at the start and to remember no one gets paid to offer help on this forum , play nicely children .