5
\$\begingroup\$

I've played with AVRs before with my atmel development kit and have seen recently the use of Arduinos increasing. I have a few questions from users:

  1. Is it the same as using a microcontroller?
  2. Are there any restrictions with the use of the Arduino instead of using the microcontroller?

I am interested in moving to them but also which should i get as there are so many to choose from.

\$\endgroup\$
10
\$\begingroup\$

The various Arduino boards use AVR micro-controllers.

With the appropriate software, using the Arduino is the same as using any other micro-controller. However, the Arduino software doesn't support in-circuit debugging, which is available with other development software like Atmel's AVR Studio. You can use the Arduino hardware with AVR Studio and Atmel hardware tools like the Dragon programmer/debugger. The Arduino software supports downloading to the target via a bootloader.

The Arduino web site and forums are very useful if you need help.

\$\endgroup\$
6
\$\begingroup\$

An Arduino is basically a cheap, unsupported ("open-source") development board. You can use the Arduino libraries and software for a gentle introduction to MCUs, or you could go all out and use none of it and develop on the Atmel AVR directly with AVR Studio and WinAVR (containing the avr-gcc compiler).

Even if you don't use Arduino software, the board is still going to be physically the same size, so there's nothing preventing you from using shields, which is a convenient way for hobbyists to add hardware if you don't want to do much component assembly (let alone make/drill PCBs).

For what it's worth, I somewhat like the Arduino concept, but the use of C++ is obnoxious, and I fail to see the value in hiding main(); from the user. Fortunately, that can all be done away with.

\$\endgroup\$
3
  • 3
    \$\begingroup\$ I would qualify "unsupported" as "unsupported by Atmel" - there is a vast and growing community of Arduino users, not to mention the extensive resources available at arduino.cc \$\endgroup\$
    – vicatcu
    Dec 20 '10 at 20:32
  • \$\begingroup\$ @vicatcu, unsupported implies by the company, it might be worth adding that there is a large community, but there is not a team of applications engineers waiting for your call, which is what a company normally requires in support. \$\endgroup\$
    – Kortuk
    Dec 20 '10 at 22:02
  • 1
    \$\begingroup\$ +1 for the pointless use of C++ and hiding main(). I took a look at using the Arduino IDE when I first got mine. Then I decided I'd rather do it on my own and went straight to avr-gcc and avrdude for programming. It should be noted that the Wiring library can be used very easily without the Arduino IDE also. \$\endgroup\$
    – Earlz
    Dec 22 '10 at 11:02
5
\$\begingroup\$

Actually avr-gcc is under the covers in Arduino as well... you just have to use C++-ish syntax if you're using their libraries or writing your own. Otherwise, the only constraint is that you are 'forced' to use the pattern equivalent to:

int main(int argc, char *argv[]){ 
  setup(); 
  for(;;){ 
    loop();
  } 
  return 0;
} 

which is a pattern that fits a large cross-section (arguably the entirety) of embedded design. You just implement setup() and loop().

Also it's not a choice between Arduino and a micro-controller. In principle, you could take the ATMega328P out of an Arduino board context, programmed with a sketch, and transplant it into a more tightly integrated solution.

So I guess I disagree with the sentiment of some of the other answers here suggesting that Arduino is just a "toy" platform. In my opinion it's viable for more "serious" development. It just lowers the barrier to entry into the embedded world. The ability to program it without a separate programmer (e.g. AVRISP mkII, STK500, etc.) is kind of a big deal in this regard.

I don't really think that it demands significant compromise from more advanced users.

\$\endgroup\$
4
  • \$\begingroup\$ Most compilers and assemblers insert a reset type instruction after main finishes anyway, causing main to effectively run in an infinite loop - like running setup() then loop() once and then going back to the start. \$\endgroup\$
    – Thomas O
    Dec 20 '10 at 22:13
  • \$\begingroup\$ the main problem I have with the "Arduino system" is that once you grow beyond a single user module it's nauseating to manage as it just dumps all the code into a single file, so you can't hide anything. You can use normal files and #include, but if you bring them into the IDE it fails miserably. @Thom, not that one should ever relinquish control to...whatever is after main in an embedded system...but I'd expect the micro to just wait until it gets a reset or some interrupt. \$\endgroup\$
    – Nick T
    Dec 20 '10 at 22:24
  • \$\begingroup\$ @Nick, have you read the "how to make an Arduino library tutorial"... I just made my first recently and it worked fine for me. \$\endgroup\$
    – vicatcu
    Dec 21 '10 at 17:04
  • 1
    \$\begingroup\$ I would almost argue and say that the setup-loop pattern fits all programs, embedded and otherwise. \$\endgroup\$
    – Earlz
    Dec 22 '10 at 11:04
4
\$\begingroup\$

My first question for you is -- what are you going to do with it? While getting Arduino up and running is easy and there are quite a few sketches available to play with, development isn't all that fun. IMO, the IDE is a little quirky and some of the keyboard shortcuts are really obnoxious to Visual Studio developers. :) Like Leon said, you won't have in-circuit debugging, but some of the other ease-of-entry devices like mbed don't have it, either.

If you're just playing around and bitbanging to learn about LCDs, or want to read sensor data, or interact with serial devices, it's great. However, if I were deciding on a platform for a consumer-ish product, I would choose something else that provided in-circuit debugging.

\$\endgroup\$
5
  • \$\begingroup\$ Yeah just for playing really. \$\endgroup\$
    – Dean
    Dec 20 '10 at 15:56
  • \$\begingroup\$ I agree about the IDE quirks. Developing avr-gcc in eclipse makes programming a lot less painful. Ctrl-space auto-completion in particular is missing in my opinion. \$\endgroup\$
    – vicatcu
    Dec 20 '10 at 20:34
  • \$\begingroup\$ Arduino has an IDE? lol. \$\endgroup\$
    – Nick T
    Dec 20 '10 at 21:00
  • 1
    \$\begingroup\$ @Nick: haha, yeah more like Notepad with a different skin. \$\endgroup\$
    – Dave
    Dec 20 '10 at 21:17
  • \$\begingroup\$ Yes - must... have... autocomplete \$\endgroup\$
    – RQDQ
    Dec 22 '10 at 20:59
1
\$\begingroup\$

Dave Jones did a video blog on the Arduino. If the link doesn't work search for the EEVBlog #45.

\$\endgroup\$
1
  • 3
    \$\begingroup\$ @user1498, please don't just dump a link, especially when linking to blogs. Blogs are great at destroying links, so if someone comes along to your answer a few months later and if the link happens to be dead, your answer is totally worthless, and the site suffers as a result. Links aren't bad, but at least offer a little description with it. \$\endgroup\$
    – Nick T
    Jan 4 '11 at 23:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.