What is the benefit of the Second AVR on Arduino?

Just pondering...

Why choose an ATmegaxU2 for the USB interface?
Reliability, ease of programming, implementation, cost?

Wouldn't any USB to TTL adapter (I don't want to open up a can of worms by mentioning names) do the trick?
Atmel sells the 16U2 for $2.17 for 1000 minimum orders, so it's not free and I would assume it drives up the cost a bit. Add a few pennies for the extra ICSP header... which barely anyone ever touches...
Makes me wonder why the DIY solution of putting a cheap USB-TTL adapter wasn't adopted by Arduino. Even with a solid solution, I would think that would have been cheaper.
Unless they have a deal with Atmel and essentially they sell two AVRs for each unit, keeping costs low.

somedude:
Just pondering...

Why choose an ATmegaxU2 for the USB interface?
I think the idea was that people would be reprogramming them to act as mouse/keyboard/etc. It was a really cool idea - except a lot of the pins on the 16u2 weren't broken out, and basically not a damned thing was done to take advantage of this.
Reliability, ease of programming, implementation, cost?
Resounding no on first 3. Needs special drivers, and has the same UART speed artifacts as the Arduino does (whether that's good or bad is, of course, debatable). I hear Arduino got a sweetheart deal on the 16u2's, but I still can't imagine them being cheaper than CH340Gs.

Wouldn't any USB to TTL adapter (I don't want to open up a can of worms by mentioning names) do the trick?
Yes, unless you wanted to reprogram it to emulate a mouse/keyboard, or do what Hiduino does, I think it's for midi?
Atmel sells the 16U2 for $2.17 for 1000 minimum orders, so it's not free and I would assume it drives up the cost a bit. Add a few pennies for the extra ICSP header... which barely anyone ever touches...
Makes me wonder why the DIY solution of putting a cheap USB-TTL adapter wasn't adopted by Arduino.
It was, in the Duemillanove, which was... uh... essentially an Uno with a FT232 instead of a 16u2... The Uno was released later, with the 16u2 being touted as a feature

The ATmega16U2 is cheaper than the FTDI chip (FT232) which is used in the Nano and was used in the Duemilanove. I think the very cheap CH340 didn't exist back then.

I'm talking about the real FTDI chip of course, not one of the counterfeit FTDI chips.
The FT232 costs now about 4 or 5 dollars, but if I remember it well, it was about 8 dollars.

Thank you guys.

Doc, it almost looks like I struck a nerve, he he he.
Thank you for the thorough reply.

BTW, does the 16U2 need all the components on that USB side or could that be simplified, a la Digispark/LittleWire?

The FT232 costs now about 4 or 5 dollars, but if I remember it well, it was about 8 dollars.

FTDI chips used to be relatively hard to buy (only a few mid-sized distributors carried them.) But FT232RL's have been "about $4" for a very long time. Since before Uno came out, anyway. And the 8u2 didn't get cheaper than the 16u2, so it's about $4 too, plus the cost of extra component required by the xxu2 but not the FTDI.
And there are now cheaper FTDI parts (FT230x at about $2.)

The whole "you can be something other than a serial port" is an idea that never really caught on; not with the XXu2, not with Leonardo-like boards, and not with the ARM boards. It's "interesting" that products like the Adafruit "Metro" and Sparkfun "Redboard" have returned to FTDI controllers.

FT232RL, still $4.50 like it has been for 4 years.

Atmega16U2-AU, $4.35 plus you need a crystal, 22 ohm resistors, and other parts, and ICSP header so you can program it.

Priced at digikey.com

Exactly. This is why I started this thread, it seemed to me that it would be more economical with an USB to TTL adapter than another AVR.
I love Atmel, but if Arduino is aimed at the hobbyist market, wouldn't price be an issue?
Not to mention helping to curb counterfitting a bit.

And then there's the Chinese Hack 340 Great (my rendering of CH340G heh heh)...

CH340G not available at digikey or mouser, is there a valid US source with repeatable supplies available?
Not interested if not.

Until I can get CH340 from digikey etc. I won't be able to use it in any of my designs, fearing that I can't source it when I need it. I'll still carefully test my nano with CH340 on different OS to see how it fairs. FT232RL is indeed too expensive. Will try the FT230x that the sparkfun red board has.

CrossRoads:
CH340G not available at digikey or mouser, is there a valid US source with repeatable supplies available?

Not that I know of, I only found it on eBay or Amazon, shipped from the motherland.
manufacturer?

it seemed to me that it would be more economical with an USB to TTL adapter than another AVR.

Arduinos prior to Uno had USB/TTL adaptors. At the time, I suspect it looked like the 8u2 provided increased functionality at little to no increased cost. Uno is pretty old at this point

if Arduino is aimed at the hobbyist market, wouldn't price be an issue?

It was probably important to maintain the $30 price point; getting much lower than that: no so much.

Not to mention helping to curb counterfitting a bit.

One of the things that came with the 8u2 was the ability to use an Arduino-specific USB Vendor/Product ID. So it was probably expected that the 8u2 would help curb counterfeiting. Not that counterfeiting was as big a problem back then. And at least theoretically, FTDI has the ability to change VID/PID as well.

As engineering decisions go, I think the fancy power switching circuit is more questionable :frowning:

To me one big value that the 8u2/16u2 could offer that it doesn't, is the ability to ISP program the 328 instead of being just a dumb usb to serial interface that requires a bootloader in the 328.

If the 16u2 code was smarter (and assuming the uno board was updated for the needed wiring), it could act as both a USB to serial interface and a USB to serial programmer that programmed the 328 using ISP pins.
This would eliminate the need for a bootloader in the 328.

--- bill

it could act as both a USB to serial interface and a USB to serial programmer

I don't think the xxxu2 chips support enough USB "endpoints" to do that.
(Atmel mEDBG chip is a 32u4, and does this. It sets up 6 endpoints. The u2 chips only support 4 endpoints.)

somedude:
BTW, does the 16U2 need all the components on that USB side or could that be simplified, a la Digispark/LittleWire?

Yes, if you want any sort of reliability.

Of course, the FT232 and the CH340 are not the only USB to TTL chip options by any means. In fact, the only thing in favour of the CH340 is its rock-bottom price.

westfw:
As engineering decisions go, I think the fancy power switching circuit is more questionable :frowning:

As engineering decisions go, I think the power circuit in general is questionable - the wacky switching configuration doesn't help matters.

Thanks everyone, it turned out to be an interesting topic, not to mention getting the heavyweights involved, with a lot of expert insight.

I would like to take it to the next level and ask what would you choose for a front end to an AVR, if you were to design Arduino from scratch today?
I think USB is a must, as the ubiquitous interface, but I am curious what chipset/platform/manufacturer you would select.

I'm not sure I count as "heavy weight" but I am looking for alternatives (small production with ssop packages that I can fix by hand). FT is a despicable company. I wonder how many "fake" devices got disabled under the guise of their aggressive hunt for "fake" devices. If I don't trust the company's integrity, why would I trust its fake-hunting technique is precise and flawless?! I looked at PL-2303, CH340 etc. Support drivers are not universal especially with macs. ATMEL chip needs too many support components. 32U4 easily screws up if you allow yourself some mistakes. The 2-MCU idea is good. One is doing some predefined /well-defined work (USB/TTL, flashing code) while the other is allowed some wild and mistake-riddled dev code. It's a good model for dev and small productions.

the only thing in favour of the CH340 is its rock-bottom price.

I imagine that the cloners building boards in China find the CH340 easier to get than other parts.
(also: SOIC package; easier to hand solder!)
(They're not precisely "cloning" Arduino, since they have the the new USB/Serial circuitry, but they're cloning each other!)

If I were to buy some nano boards etc, I'd avoid any with "FTDI" and favor those with ch340. At least the chip is authentic and has no driver snafu.

I favor FTDI modules that can be mixed & matched. Don't USB for embedded application? Use an offboard module, unplug it when done testing.

Need onboard USB for the application? Build in a MIKROE483 from mouser. By the time you add in the USB chip, crystal, connectors, caps, resistors,, the price s almost a wash.

Or, go with a better USB-equipped chip (what's next in size from 32U4?) to have more memory, more IO, perhaps 2nd hardware serial port so you can have USB and 2 serial ports.