16U2 full HEX file with USB VID from Atmel (instead of Arduino)

Hi,

I'm searching for the complete HEX file for the Atmega 16U2 which is used for the USB Com on the Uno R3.

The original File is located in the Arduino install files. Some hints for a modification would be great too.

I'm on Windows and want to flash the Chip stand alone as is. I'll not have ISP connections on the PCB.

Thanks, Maverick

its an ATmega16u2 as such VUSB folks must have everything you are trying to do with it like USB HID emulation as well as Serial over USB implementation etc…!

I'm sorry, but did You read and understand my Question?

Regards, Maverick

Maverick71: I'm searching for the complete HEX file for the Atmega 16U2 which is used for the USB Com on the Uno R3. The original File is located in the Arduino install files.

As you point out, it is in the Arduino install files. You can search for it with the Windows search feature, it is called Arduino-COMBINED-dfu-usbserial-atmega16u2-Uno-Rev3.hex. On my computer it is in the C:\Program Files\Arduino\hardware\arduino\avr\firmwares\atmegaxxu2 directory. If you want to modify and re-compile, there is a README.txt file in the same directory with explanation of the bootloader and USB to serial program source files and info about the VID/PID used for each program (bootloader and USB to serial program).

Arduino-COMBINED-dfu-usbserial-atmega16u2-Uno-Rev3.hex is the complete contents of the Uno 16u2. It is 2 programs: the DFU bootloader and the USB to serial program. It has the Arduino VID/PID when it is running the USB to serial program, and it has the Atmel VID/PID when it is running the bootloader (when you put the chip in DFU mode by resetting it).

Maverick71: I'll not have ISP connections on the PCB.

It is probably not a good idea to omit ISP connections for a processor. You will have difficulty re-flashing it if necessary, and if the DFU bootloader is not working.

If all you're going to do is USB to serial, 16u2 is probably not the best choice of chip. There have been posts on the forum explaining the reason Arduino chose it is because they got a good deal from Atmel on a bulk purchase. There are dedicated USB to serial chips which are not programmable, and those are a better choice for solid serial communications that won't fail because the chip "lost" its flash memory.

You may notice the forum has a fairly large number of posts where people had difficulties with their Uno or Mega and the resolution was sometimes re-flashing the 16u2 processor. Sometimes the DFU bootloader remains on the processor and new firmware can be uploaded via DFU, and sometimes the DFU bootloader is messed up and ISP must be used to re-flash the DFU bootloader and USB to serial program together (Arduino-COMBINED-dfu-usbserial-atmega16u2-Uno-Rev3.hex).

If you will be doing fancier stuff than plain USB to serial conversion, maybe 16u2 would be OK. 32u4 may be better because you can easily put the Catarina bootloader on it and use the stock IDE with very little modification to upload a USB-to-serial program as a sketch. 32u4 is a Leonardo. The Catarina bootloader will not interfere with your main processor upload through its Optiboot or other serial bootloader. But then if you go down that road, you have to wonder why not just use the 32u4 by itself and not as an intermediate chip between your computer running the IDE and the main processor (328 or 2560 or something else). In the end, it comes down to what you are building and what is its purpose.

I'm sorry, but did You read and understand my Question?

In the absence of the reason and a purpose ,I had replied just thinking that even if you don't happen to get that file or modify it then VUSB guys maybe helpful.

Hi,

@NI$HANT Thank You, now I understand You :slight_smile:
I dropped the Idea to go with VUSB as many People complained…

@dmjlambert The only purpsoe of the Chip should be Serial <-> USB Communication.
I could go with another Chip too. FT232 for example.

I have read the rumors about the 16U2 vs FTDI Chips.
If I would be able to make it work I would go with the FTDI Chip.

I have got 2 Boards with the FTDI Chip they are not working.
I also have got board with the 32U4 but the SoftReset doesnt work.

Do You have got a Shema from a working 328P board with FTDI Chip?
Maybe a Link from someone else? Or a Setup for make a test?

Regards,
Maverick

Actually yes, there are numerous schematics for FTDI/328P boards.

The Duemilanove from Arduino would be the ultimate source and it has not only the schematic, but also the Eagle file with the PCB layout. https://www.arduino.cc/en/Main/ArduinoBoardDuemilanove

The older board from Arduino is the Diecimila https://www.arduino.cc/en/Main/ArduinoBoardDiecimila Note that right on the Diecimila web page they mention R3 is not a resistor but is actually a 0.1uF capacitor and R2 is omitted. So when you're looking at the schematic, make that adjustment. Since you have the Eagle file, you can actually correct the schematic if you want. [edit- this page is interesting because you can see right here in notes about R2 and R3 and in the schematic this is where auto-reset upon serial connection is being invented and perfected. Auto-reset has been a part of every board since, and has also been included in later derived boards such as the Nano, Metro 328, Freeduino, Redboard, etc.]

Yet another board from Arduino is the Nano and the schematic and Eagle file is available. https://www.arduino.cc/en/Main/arduinoBoardNano

This one is from a 3rd party and I don't know if they would offer you an Eagle file but they do have the schematic posted. http://mcukits.com/2009/03/12/arduino-usb-v22-assembly-guide/

Freeduino has open source hardware and schematic files. http://www.freeduino.org/freeduino_open_designs.html

The Metro 328 is from Adafruit, the famous and popular NY company led by Limor Fried, and they also post the open source hardware and schematic files on github. http://www.adafruit.com/products/2466

Thank You for the Links. I picked up my Shematic from the website of Arduino.

The documentation part of all this Projects are... well, horrible. I don't need the eagle files but working shematics wouls be "helpfull" ;)

I'll look on the Freeduino as some people wrote its working. They stated the Rev Nr is 1.16 but the Files I downloaded are 1.14.

I'm in Europe and its 18:30 allready. I'll make new PCB based on their Design and post the results here.

Do You know which bootloader are they using?

The beauty of Arduino is you can use whatever bootloader you like, or no bootloader at all. It's up to you. If you want to be able to choose Uno from the IDE menu to upload to your board, you would burn the bootloader for Uno. If you want to choose Nano or Pro Mini from the IDE menu to upload to your board, burn the Nano bootloader. If you want to directly upload using ISP to the board, use the Upload Using Programmer menu choice and for that you don't need a bootloader. In that case you can use the serial connection to interact with your sketches through serial monitor. I don't know why you say the documentation is horrible. I think the schematics and other documentation is great. The Eagle files also contain the schematics.

dmjlambert: I don't know why you say the documentation is horrible.

As I remember I don't saw a single Shematic till now it was complete. You should allways search for some parts or they are completely wrong in the Shema. Like Your Example with R2 and R3.

If one want to make a favour to the User, he will edit the Shema, but not add some notes. It looks like its a "False" open source. Obviuosly the Author doesn't want to publish his work. The most people will anyway buy the whole product, as -> You don't need the PCB if You dont know how to populate it.

The whole Arduino comunity seems infected from this "problem". A bit frustrating...

I see every schematic as complete and have found very few errors in all the various schematics. I study them. I did find a minor pin labeling error in the schematic for the Pro Micro, and I entered a github issue to ask for the fix. If I build a Diecimila or Duemilanove from the published schematic it will work. I don't think I would design a PCB based on those schematics because that would be re-inventing the wheel. The PCB layout is handed to us on a silver platter, it's already designed and published. If you just create a PCB based on the provided PCB design and populate it with components, it will just work. It would take effort to make it not work.

Even the Diecimila, if I pay attention to the history of Arduino and make note to myself that the auto reset feature was being developed at the time that board was coming out I can make good use of that schematic and PCB also. You don't even need to change the PCB design, just omit one of the resistors and swap out the other resistor with a capacitor. If you know how the auto reset feature works, it is logical to swap that resistor in the schematic with a capacitor. Now that the Diecimila is old history, there is probably not a great effort being made to maintain the documentation about it. It is nice that the note was added to the Diecimila page, and when we read that and look at the schematic we say "ah yes, of course," and move on.

In open source, all of us are the maintainers of the documentation and schematics. If we have enough interest and study enough, and demonstrate our skills to other members of the community to build up our reputation, we can end up having a great influence or end up being the maintainer of a particular aspect of the project. Be the change. Contribute. So I don't really agree there is an infection. In fact, I think the Arduino community as a whole gets the job done with amazing flexibility.

Well, I build my own PCB with replacement parts because I need some challenge :slight_smile:

I think that is an excellent reason for the PCB building hobby. If that auto reset thing is giving you trouble at the moment, I suggest switch your focus for a little while and come back to it at a later date. In the meanwhile if you make some boards which do other things and you can program them via ISP or with an external FTDI. For example, maybe you could make a board with SMD versions of ATmega328P and MAX7219 and MSGEQ7 all together on one small board which would fit under the pick guard on an electric guitar. The MAX7219 output will drive a bunch of LEDs all over the guitar body. See what I'm doing here, trying to rope you into another project :-) http://forum.arduino.cc/index.php?topic=341281.0 The original post seems to be deleted, but the original post just asked what the approach would be for taking the output of a guitar pickup and controlling LEDs based on the frequencies and volume (that would be a spectrum analyzer).

I started with the board You can see on the top.
I understand this is a nightmare and moved on SMD and 0603 components.

Spectrum Analyzer looks nice but I think, I should be able to build a working setup of Arduino
with different Serial to USB Interfaces… Uno, Mega and Due.
I have got the MOSFETs for the Spectrum Analyzer allready :wink:

I tried to refocus on another stuff (Popolu 8825 Stepper Driver) and run into similar problems.
I want to see something “moving”, not only “blinking” :slight_smile:

Hello,

So, I made separate FTDI I/O and it doesn't resets the Atmega. Obviuosly the FTDI Chip working perfectly but it doesn't resets.

I connected the FTDI I/O to Uno Rev3 and it uploads only after I perform Manual (Hard-) Reset. I guess the 0,1µF Capacitor on the DTR from FTDI Chip is to "much" and it doesn't resets the Atmega.

This is what I meant before. It's in Shema, but it doesn't work.

Regards, Maverick

If you are connecting an FTDI to Uno, it already has an FTDI-type device built in (the 16U2), and it already has a capactitor going between the 16U2 DTR and 328P reset. So if you hook up an additional cap to reset, the caps will be fighting each other. One won't be able to discharge without the other charging. So the signal is made weaker.

If you add a 15K pull down resistor between GND and Reset, it will hold the Reset line barely above the voltage required to get it to reset, and it will therefore make the reset pin of the 328P more sensitive, and the external FTDI DTR and cap will be able to reset it.

Or you can cut the reset enable jumper/trace on the Uno. Install jumper pins or a small SMD switch across the cut jumper so you can enable/disable auto reset at will.

DrAzzy points out the caps fighting each other concept: http://forum.arduino.cc/index.php?topic=334914.0

Puh... This is absolutelly crazy.

I take a look with the Scope. The standalone FTDI makes noticable "Reset" from 5 to 0. Also the Hardware Reset Btn makes a "Reset" from 5 to 0. When I hook it up to the 328 it can't reset for some reason. With a 10K pull down resistor the one becomes ~3V and reset's to 0.

I wonder what about my Board? I'll be back in 5 minutes...

Btw. The reset pin of the FTDI Chip on my Board stuck on 0 while I tried to connect and upload something.

This is not crazy. It may be diabolical, but not crazy. :-) You may need 15K pull down, not 10K pull down, for your board. We are talking about a balancing act here, putting the reset pin right on the edge of acceptably high. The cleaner way to do this is to cut the reset trace. There is a jumper pad on the Uno with a small trace between the two sides, and that is designed to be cut if you want to disable onboard auto reset for some reason. This is a reason. The DTR pin should go from high to low when you start upload, and stay low for the entire upload process. The cap turns that long low signal to a brief pulse low.

It’s done. I can’t believe.

So, the question is, why does this work on the original Unos without pull down resistors?
What about the 32U4 Reset Mechanism? I have got the same problem with it (no SoftReset).
I have to clean my brain after this.
It’s 04:16 in Europe.

Now, You helped me the second time allready.

Regards,
Maverick

There's no telling about the difference between Unos. Using a pulldown is a work around fix, and the proper way is cutting the onboard DTR if you're going to use external FTDI. Or experiment with a Pro Mini or Arduino Mini, and those would more closely approximate what you try to accomplish when you are making your own Duemilanove-type board from scratch. In fact, if you want a fun PCB project make yourself a board in the ProtoSnap style. ProtoSnap Pro Mini is a break apart Duemilanove. The FTDI is built in, until you break the board in half. It is interesting.

32U4 is a whole different thing. The reset happens when you run a sketch which has been compiled with the Leonardo core. A small and hidden part of the sketch runs in the background and is on the lookout for a 1200pbs touch and it does a watchdog reset. Then the bootloader runs. It is a little mysterious for me too, and it is because I have not studied the source code enough. If you can't get that auto reset working, it may be because you are using the wrong boards.txt entry which specifies the variant, 1200 bps touch, USB wait, extra_flags and other essential features, or you're using an old core which is pre-leonardo. There are comments about the 1200 bps touch in CDC.cpp, part of the Arduino IDE.