So after a mini victory this morning i have moved on to another problem.
Have a "bare" atmega16u2 that after a false start i've managed to get a bootloader on using Nick Gannon's excellent sketch, now windows won't recognise the device for dfu programming after momentarily shorting reset to gnd.
have connected the UGND, D+, D- and UVCC directly up to the relevent pins on a usb socket, but all i get is unrecognise device, tried loads of advice i found on google but none of its helped
Using Flip 3.4.7 and windows 7 64 bit , also tried on win xp with the same result have i missed a vital connection ? or a resistor or some such ? For instance have just seen the UCAP pin and its need for a 1uf cap on the Uno rev 3 schematic (my go to for connections for this project)
Update, it has to be something to do with the setup of the chip on the breadboard that i'm sure, just put my arduino into DFU and after forcing windows to install the driver it worked in Flip and showed up properly in device manager, anyone have any ideas ?
Hi,
According to UNO shematic, this chip needs an external Crystal to work (after updating it as USB Converter).
You probably set a fuse for external crystal.
I'll get my Chips today and know more in the evening.
Regards,
Maverick
Hi, did You solved Your problem?
I have got the same problem like You.
I can program the 16u2 via ISP but I cant put it in DFU Mode.
If you can use ISP then why use DFU? It is logical to use DFU only if you don't have an ISP programmer.
Easy way: http://www.instructables.com/id/How-to-Restore-the-Arduino-UNO-R3-ATmega16U2-Firmw/
Note you don't have to use another Arduino as an ISP programmer, you can use the same method with an ISP programmer device.
Hi, Can You please tell me what to copy on which folder exactly (standard Arduino IDE install)?
I tried like You wrote in your instructables but the folder structure incl. is not clear and it dosnt worked.
ps I tried DFU as my 16U2 was factory new with no data and i didnt know if works at all.
My USB Host doesnt recognise it anyway. Now I know at least I can upload with ISP.
If I would be able to setup the whole chip only over isp would be great.
In the directory where you installed the Arduino IDE app you may need to browse to see the exact names of the subdirectories. Start at C:\Program Files\Arduino\hardware\arduino\avr
You may find a subdirectory structure named firmwares\atmegaxxu2, I'm not sure on windows the exact path.
You are looking for the file Arduino-COMBINED-dfu-usbserial-atmega16u2-Uno-Rev3.hex and that is the file you need to upload using ISP with avrdude command line, or by using the Instructable method which details creating a custom board.txt file using that hex file as the bootloader and burning it with the IDE.
If you are just having difficulty finding the hex file on your computer, you could also probably find it on github or elsewhere on the Internet. Or use built-in windows search to find the file on your computer.
Puh. Now at least I have got UNO (clone) with working software reset.
During the last Days I run in to different problems, like half tombstoned Crystal for example.
I found a bad designed UVCC connection. My Mistake.
This was the reason I reached the 16U2 over ISP but not over USB I/O.
Thank You for the Instructable. It's great.
I think You should re-write it (make it more simple and more easy to read) and change the title.
I searched for the last 3-4 Days for the informations from Your instructables.
I cant find any. Till You gave me Your link.
Regards,
Maverick
Do you have any specific wording ideas for the Instructable which may improve it?
Hi,
I would change the Title to something like this...
"How to Restore the ATmega16U2 Using the Arduino IDE"
I think all people they searching for 16U2 knows what is this chip for.
You don't need to write Arduino UNO. Especially not before 16U2.
It's very important to clearly state on the very beginning,
after this procedure the chip will work -> "ready for use" and
programming over ISP. No DFU or other stuff.
I would delete first Page till the last Paragraph.
If You want to let it, put it on the end of Your instructables.
I knewed all this before and it doesn't worked for me.
First I have tried was Nick Gammons programmer, Flip and Hoodloader2.
I understand I can access the chip over ISP but not over USB.
On Your second page You explaining about the folder structure.
I read this part several times but i was not able to create a working solution.
I'm on German Windows, so the Folder structure is different.
Don't write the whole path, but only "../programs/arduino/avr"
Much easier to read.
I would begin the second page with explanation which files are needed and why.
Boards.txt for the listing in the IDE and the *.hex File, which will be written on the Chip.
I even run into another problem "write permision denied" for boards.txt
Maybe You could write that people use Notepad++ for editing to hold the formating of the Text.
If one have made this once, its easy.
Do You maybe know why does regular 32U4 and 328P with FTDI doesn't perform software RESET?
In the Hoodloader2 FAQ I read something he wrote "Fixing the SoftReset"
Regards,
Maverick
Thanks. I will read this and decide what to put into the Instructable. My purpose with the Instructable was to show an easier way to accomplish restoring the firmware. I was assuming the audience already could successfully use avrdude with he command line to do it. So, I may change my thoughts a little after reading your message.
I am concerned about some deletions because on the first page I show the avrdude command which actually does work with an ISP programmer. I double checked and it does work. The purpose of the first page is just to give some background information and get ready to explain what I consider a better way. I will re-arrange or change some of that wording.
I verified Hoodloader2 restore definitely works to fully restore the ATmega16U2, that method is exactly same as mine.
I don't know about your last paragraph, something about "32U4 and 328P with FTDI doesn't perform software RESET" and I was not able to find anything like that in the FAQ. I don't understand the topic.
Hi, I rewriten my previous post several times before I posted it 
Generally there are 2 kind of user.
First one using cmd, second one pushing buttons in IDE.
The first one will never use methods with IDE.
The second one is not interested in old cmd like "programming" ...
To be honest cmd is the relict of ~30 Years DOS "world"
I understand Your intensions with the instructables.
I think for first kind of user it is too little information or they know this allready
but for second kind of user it is the way to much information.
They dont want to read or they will not understand the content.
Maybe you make 2 instructables.
The one for beginners should be very short and easy to read and learn.
Keep sentences clear and short to get more audience.
I don't know if in one month 750 wievs are much or not, but I was shocked
that on this topic you got only 750 wievs. IMHO You should get much more wievs.
I have to take a second look on Hoodloader2.
Maybe there is a fix for the software Reset on another (32U4) boards.
My last paragraph is about my projects.
I made 3 Atmega based PCBs.
- 328P with 16U2 which is working as it should.
- 328P with FTDI which needs hard Reset to be able to upload new software.
- 32U4 with inchip USB controller which also needs hard Reset to upload new software.
On 2 and 3 I can upload new software only after pushing the Hardware Reset Btn.
The Software Reset doesnt work. I dont know why.
Regards,
Maverick
Thanks for your feedback, I will consider it.
To troubleshoot 2) 328P with FTDI automatic reset: connect VCC to 220 ohm resistor then other side of resistor to anode of LED and use the cathode as a logic probe. You should have the FTDI DTR connected to a 0.1uF cap and the other end of the cap connected to reset on the 328P. Reset on the 328P should also be connected to a 10K resistor and the other end of resistor connected to VCC. Hold the probe on the DTR side of the cap and open serial monitor. You should se the LED light for the entire time serial monitor is open. It does not light when serial monitor is closed. Hold the probe on the reset side of the cap and open serial monitor. You should see the LED flash when you open serial monitor. That is the reset pulse.
To troubleshoot 3) 32U4 automatic reset: the reset activity is not evident externally. You need to make sure you are using the Leonardo core and verify the boards.txt entry you are using also works with a Leonoardo or Pro Micro to auto reset. As I understand it, the CDC core is running on the chip, and it is a small piece of interrupt driven code which is compiled with and co-resides with a sketch you upload and it listens for a 1200 bps baud rate touch and then resets the processor via watchdog. In order for that hidden piece to be included in your sketch, there are critical parts of the boards.txt entry which need to be there, and probably the fuses need to be set exactly as on the Leonardo or Pro Micro. So examine those settings or just use the Leonardo board menu selection.
Thank You, I ll take a look on Nr2 later. I board is 0603 sized it will be hart to solder those connections.
About Nr 3. I burned the Leonardo bootloader from Nick Gammons programmer.
Later I tried Micros bootloader burned from the Arduino IDE.
It doesnt worked.
Nr 2 is about touching a probe to the auto reset circuitry you should already have on the board (if you designed it with auto reset in mind)
Nr 3 is not about the bootloader. The auto reset is not done by, nor does it really have anything to do with the bootloader. Auto reset is done by a hidden piece of the sketches you upload. That is why using the right core is important so that hidden piece will be automatically included when you compile. The part of your sketch you don't see needs to watch the USB port for a 1200 bps touch and reset the 32u4 via watchdog. Others on the forum may be able to explain it better than I do.
Du You know where can I can a HEX file for the 16U2 with the VID Signature of Atmel for the USB connection?
Or how to change the Arduino Signature in to Atmel Signature?
Regards,
Maverick
Well when you put the 16U2 in DFU mode by grounding the reset pin, I believe that is when it uses Atmel's VID/PID for the DFU bootloader. To change it I suppose you would have to compile whatever software you want, such as a DFU bootloader or HID software or USB-to-serial software, and put whatever VID/PID in the code you are compiling. Somewhere on the Internet is probably the source code for DFU bootloader, and for the Uno USB-to-serial software, both of which are compiled into that combined.hex file you restored. In fact I think some of the source code is buried down in the directory structure for the IDE app, where you got the combined.hex file from. I'm afraid I don't know enough about it to give more guidance than that.