Why to use ATMEGA16U with ATMEGA2560

Go To Last Post
18 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello

I am a newbie and i was just going through the forum regarding ATMEGA2560 to understand it better and to design my own PCB based on ATMEGA2560.

I want to know the use/importance of ATMEGA16U with the ATMEGA2560 board.

If its used just for UART-USB interface, that could have been achieved with many FTDI chips.

 

Please enlighten me on this.

 

Please check this thread for the schematic

https://www.avrfreaks.net/forum/our-own-designed-atmega2560-16au-board-not-connecting-computer

 

 

another schematic with no ATMEGA16U and no comparators

schematic2 without ATMEGA16U and comparators

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It's simply acting as a USB-UART bridge in the Arduino design.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The mega16U2 is probably cheaper than a ftdi chip. The cheapy chinese clones use a CH340 which is cheaper still.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

puneet1984 wrote:

If its used just for UART-USB interface, that could have been achieved with many FTDI chips.

 

Please enlighten me on this.

 

To save money.  The ATmega16U2 cost less than the FT232R.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks a lot for the reply.

 

So, we can use a CH340 instead of the ATMEGA16U.

Will save two steps of programming ATMEGA16U - burning bootloader and burning UART-USB code.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The CH340 doesn't have LED outputs for TX and RX activity. Also, make sure you choose the correct CH340; there are quite a few variants, some requiring an external crystal and others not.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Theoretically, you can burn new firmware into the 16u2 so that your arduino appears to you PC as some sort of device OTHER than a serial port.  MIDI and Game Controller emulation by Arduinos have been popular.

In reality, Arduino-compatible controllers with native USB came out at about the same time (32u4 based, ARM based) that better serve those needs anyway.
 

I've always wondered whether there's someone at Atmel whispering into the ears of the Arduino designers "Pay no attention to the cheaper (than FT2323rl) USB/Serial converter chips showing up from half-a-dozen vendors.  Put a 16u2 chip on your next board.  Or better yet, an mEDBG - I'm sure you'll get around to implementing some sort of debugging in the Arduino IDE Real Soon Now"...
 

For derivative boards, I'm a big fan of CH340E-based USB/Serial Modules like this:

It's got the USB/Serial chip, a USB connector, Power and "Traffic" LEDs, is easy to solder to a base board, and doesn't take up much more space than a full-sized USB-B connector.
And it's cheaper than most of the bare USB/Serial chips.

 

Last Edited: Sun. Apr 12, 2020 - 10:19 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Looking at the dates in Github, maybe things were different 8 years ago when the firmware was last updated, e.g. prices, availability, future plans. Different choices might be made today. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

puneet1984 wrote:

Thanks a lot for the reply.

 

So, we can use a CH340 instead of the ATMEGA16U.

Will save two steps of programming ATMEGA16U - burning bootloader and burning UART-USB code.

 

If I were doing it, I'd use FTDI. The 16U is no good past 115200 baud. 

 

And the FTDI has pins to drive the TX and RX leds. You can even copy the Duemilanove design and bring out the 4 extra pins to use the FTDI as an ISCP programmer.

 

Gentlemen may prefer Blondes, but Real Men prefer Redheads!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

maybe things were different 8 years ago

Oh, certainly.  There's also the annoying thing that happens when you start designing a product, and "newer and better" chips become announced before you release, but after it's too late to change your design.

It would have been nice if the "Arduino Mega" had an XMega chip, instead of the outlier m1280.  But the xMega chips were brand new at about that time, and there were serious availability problems.  (IIRC)

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

westfw wrote:

It would have been nice if the "Arduino Mega" had an XMega chip, instead of the outlier m1280.  But the xMega chips were brand new at about that time, and there were serious availability problems.  (IIRC)

A while later they upgraded the Arduino Mega with an m2560.

"I may make you feel but I can't make you think" - Jethro Tull - Thick As A Brick

"void transmigratus(void) {transmigratus();} // recursio infinitus" - larryvc

"It's much more practical to rely on the processing powers of the real debugger, i.e. the one between the keyboard and chair." - JW wek3

"When you arise in the morning think of what a privilege it is to be alive: to breathe, to think, to enjoy, to love." -  Marcus Aurelius

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

can someone provide me a link to the good working schematic and PCB layout of atmega2560 development board?

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

good working schematic and PCB layout of atmega2560 

https://content.arduino.cc/asset...

 

(of course life may be simpler to just go and buy an "Arduino Mega" ;-)

Last Edited: Tue. Apr 21, 2020 - 08:25 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

westfw wrote:
I'm sure you'll get around to implementing some sort of debugging in the Arduino IDE Real Soon Now

They have:

 

https://www.avrfreaks.net/forum/arduino-pro-ide-alpha-now-available

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello

 

With the FT232R, is it necessary to have a external crystal?

As per the datasheet, the IC has a 12MHZ internal clock.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

puneet1984 wrote:

With the FT232R, is it necessary to have a external crystal?

As per the datasheet, the IC has a 12MHZ internal clock.

while this is not the best place to ask that question, in most places I have seen FT232 usb/serial chips used, an external clock was not provided so it would seem it's not needed in most cases, i.e. normal temperatures, baud rates, etc., but as always, the DS is the place to look for answers if your use is outside the norm!

 

Jim

 

 

FF = PI > S.E.T

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Instead of redesigning a board for the Mega2560, try getting inexpensive Auduino Mega2560 clones from China.  Here's one for about $8 US { about 600 Indian Rupees }. https://www.ebay.com/itm/MEGA-25...

These boards have the Mega16U2 replaced by a CH340G USB-Serial chip.  And they arrive from the factory ready-to-use.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

puneet1984 wrote:

Hello

 

With the FT232R, is it necessary to have a external crystal?

As per the datasheet, the IC has a 12MHZ internal clock.

 

 

No.

 

Gentlemen may prefer Blondes, but Real Men prefer Redheads!