Arduino and the Atmega Microcontrollers?

Hello, I'm new to the Arduino and had a newbie question I was hoping some of you could please answer.

I notice that the pre-built Arduino boards use only a couple of the Atmega microcontrollers. Is there a reason for this? I'm a bit confused if these that are used have some special bootloader allowing for the Arduino architecture to work with them and this is not supported by other Atmega microcontrollers.

The only reason I ask is because as I learn more about designing with these, I may require some more advanced features that may not be available on the current microcontroller. So, I wasn't sure if starting off with a different development environment or PIC controller would be beneficial in anyway. Also, what opinions do you have about the Netdruino that allows the use of .NET programming? I'm a C# programmer, so that peaks my interest some, but not sure if all the libraries for using SD cards, Ethernet, etc... are available for the .NET version (nor if I can build my own PCB rather than buying one).

Any information would be greatly appreciated. Thank you very much for your time.

Best Regards,

DataCrypt

one avr is acting like a USB to serial bridge, it used to be a FTDI device, the other is the main MCU, its programmed with avrgcc and a nice thick layer of user friendly libraries, there is no real reason you could not take the same board and program it in plain C or ASM

arduino also supports darn near every 8 bit atmel mcu though the use of core files, and you can use the arduino as a programmer ... as far as .NET stuff, i have no idea, but the only thing keeping you from making your own for pretty much any microcontroller system is your time and fabrication skills

Thank you. I'm glad to learn that I can use the Arduino programming and bootloader on other 8bit processors from Atmel. That was what I wanted to know so I wasn't stuck being able to only use a few mcu's. Would be nice if it grows to supports some of the larger mcu's from Atmel in the future.

Since a board like the Uno uses 2 Atmel mcu's (one for the USB and one for the program), if I was building my own PCB - do I need to program that USB mcu with any special bootloader or program?

Kindest Regards,

DataCrypt

DataCrypt:
Since a board like the Uno uses 2 Atmel mcu's (one for the USB and one for the program), if I was building my own PCB - do I need to program that USB mcu with any special bootloader or program?

Actually I prefer to dispense with the second MCU that does the USB interface. That function can be moved off board. See similar thread here:

Here's one of my boards. Just a 328P. FTDI header upper right, ICSP header upper left.

psMonitor v1.1.jpg

It depends on what you need to do with the board. It seems like most people (?) use a development board, like the Uno or one of the full-featured clones, as a prototype board. Then, if there's a project you've made that you want to keep, you can use a bare ATmega chip programmed with the same code (or just take the chip off the Uno) and off you go.

If you're looking to build your own development board, it's nice to have the USB interface on it, so it's self-contained -- self-powered, programmable, that sort of thing. But for projects, it makes sense to just use a standalone chip, and leave pins for connecting a programmer (which can be just another Uno board) or serial interface (FTDI cable or breakout board).

As far as the chip selection goes, there are lots of Arduino and clone boards out there using a whole gamut of chips. The ones that are most common (like the ATmega328, or the Tiny's, or the Megas) represent particular usage cases (small, middle of the road, lots of I/O). There are other chips, but these will do for just about anything you want to do. If you outgrow the Mega, you need to start thinking about getting into ARM or something like that.

I know you think the '328 looks limited. I did, when I first started. But as you start to get your hands on them, you start to realize you really don't need a Mega for every little project. E.g... There are I/O expanders to add inputs and outputs or interrupts; you can use several SPI sensors on the same clock and data lines; you don't really need KBs and KBs of RAM as often as you'd think...

The biggest thing is thinking in terms of a microcontroller, and not a computer. If you have some grand scheme where you think even the Mega might not have enough I/O or memory, you might be asking too much of one chip. More often than not, it's easer to split those projects up into pieces and have separate chips doing one part and communicating with each other, rather than trying to put touchscreen and Ethernet and sensors and whatnot on a single MCU. Without having a real OS, with task schedulers and all that, it gets cumbersome to service all those concurrent needs far before you run out of resources.

As for languages -- if there's a compiler to convert your preferred language to AVR binary, you can use it. The choices are C(++) and ASM for the most part, but something else may be available. IMO, .NET is a heavy language for embedded applications, but I've heard of people using it. Not specifically with AVR chips, but for microcontrollers in general. Obviously, if library support is important, you need libraries written in your language. And you'll probably have to give up the Arduino environment, as it's fundamentally a C++ wrapper to make the native AVR command set a little more accessible.

AFAIK, bootloaders execute the binary code flashed onto the chip, so you can use whatever bootloader you want regardless of how you write and compile your code. I think. I could be wrong.

Nothing answers your questions better than getting involved, though. So you might be best served by buying a board and giving it a shot. You'll get a handle on what's possible, and what's not, and be able to make more accurate sizing decisions.

DataCrypt:
Since a board like the Uno uses 2 Atmel mcu's (one for the USB and one for the program), if I was building my own PCB - do I need to program that USB mcu with any special bootloader or program?

yea there is a program on that chip that does the USB to TTL serial conversion, though you could replace it with a FTDI chip or a MCP2000 (which is more or less a pre-programmed for USB to serial pic), or heck if your computer has a RS232 device a few parts and a couple transistors would get you by (I used a dongle with a couple zenier diodes to clamp voltages, and a hex inverter for years before my current "bench" machine cheated me out of a serial port)

on regards to PIC vs AVR, its a ford vs chevy debate, AVR does more per cycle, PIC's seem to have more options, though more options means more decisions lol

I think the .net stuff works on more powerful chips, but its a much heavier programing system so performance and memory consumption would be something to look at. PIC32's are also in about the same price range as arduino and offer BASIC languages that run on the MCU itself (like stickOS basic)

I have a PIC32 with stickOS loaded on it, due to the overhead its actually about the same speed functionally as an arduino ... even-though it runs at 32 bit 80MHz (vs 8 bit 16MHz) though it has half meg of storage and 96-128k of ram. That being said it would kick the crap out of an arduino if programmed with some low level stuff, I have owned it for longer than my oldest arduino and have never really made heads or tails out of 70% of it... (and most of its software is windows only which puts a kink in my linux bench machine, that is just screwy enough to crash windows constantly ... stupid dumpster computer)

arduino also supports darn near every 8 bit atmel mcu though the use of core files

I'm not sure I'd say that. Arduino supports atmega8, atmega168, atmega328p, atmega1280, and atmega2560.
It is expected to support a couple of others, and various third parties have added and/or otherwise implemented some compatibility with quite a few additional that span a large portion of the AVR "space." But those last have varying degrees of "support", and none that comes directly from the Arduino team.

Not all AVR cpus support a bootloader. But then, the arduino bootloader is not strictly necessary to run Arduino code.

Lot of support for atmega1284 here in the forum, and for the atmega32U4 with built in USB interface (Leonardo and variations).

See also www.avr-developers.com