I have an issue with ATmega16U2 which includes hardware USB support. As the datasheet describes:
The 8bits mega AVR with USB interface devices are factory configured with a USB bootloader located in the on-chip flash boot section of the controller.
So I have created a printed circuit board with ATmega16U2 and plugged it into my PC. To start it into bootloader mode I have shorted RESET and HWB to ground, then released RESET and HWB after that (both pins are pulled up). Unfortunately, my PC is unable to communicate with plugged device, leaving following error:
To make sure that it's not hardware problem (bad circuit: coupling, long paths, high impedance, shorts etc) i connected to it with an ISP programmer. I was able to read chip signature, fuse/lock bits. I wiped whole chip and flashed it with Arduino software (first easy-to-find hex file on the Internet that came into my mind). It does work - recognized as serial communication device, which received it's COM enumeration. Then I have soldered another ATmega16U2 chip onboard and connected it again, but still I cannot communicate with factory chip bootloader. Only thing that changed is the chip: from flashed stock chip to pure stock.
Here is my circuit schematics. I'm using 16 MHz crystal right now, I have teste 8 MHz crystal too:
Thank you for reading and please share your experience if you have worked with those microcontrollers.